mcpField
R
redfin-api

redfin-api

github.com/brojonatOther135 installsUpdated 1w ago
Repository

About redfin-api

redfin-api documents how to call and parse Redfin's unofficial JSON API for developers working with property data. It covers location-based listing searches, property-detail endpoints, and response handling.

Key features

  1. 01Search listings by location
  2. 02Query property and listing details
  3. 03Retrieve estimates and nearby listings
  4. 04Parse JSON and GIS CSV responses
  5. 05Handle rate limits and response errors

Use cases

  1. 01Find listings by ZIP code
  2. 02Review property history, images, and estimates
  3. 03Analyze comparable homes and regional data

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/brojonat/llmsrules --skill redfin-api

After installing, type/redfin-apiin Claude Code to confirm it loaded.

Details

From the project README

Redfin API

Redfin exposes an unofficial JSON API at https://www.redfin.com/stingray/. All requests are HTTP GET. Responses are prefixed with {}& (4 bytes) before valid JSON — always strip this prefix before parsing.

Authentication & Headers

  • User-Agent header is required (use a current Chrome UA string)
  • Optional cookies for authenticated access:
    • RF_ACCESS_LEVEL, RF_AUTH, RF_W_AUTH, RF_SECURE_AUTH, RF_PARTY_ID
  • Add rate-limiting delays between requests to avoid being blocked

Response Format

Every endpoint returns this wrapper:

{
  "version": 1,
  "errorMessage": "Success",
  "resultCode": 0,
  "payload": { ... }
}

resultCode == 0 and errorMessage == "Success" indicates success. The payload structure varies by endpoint.

Core Workflows

1. Search for Listings by Zip Code / Location

Step 1: Location autocomplete to get a region ID.

GET /stingray/do/location-autocomplete?location={query}&v=2

Response payload:

{
  "sections": [{ "rows": [{ "id": "2_12345", "type": "2", "name": "92708", ... }] }],
  "exactMatch": { "id": "2_12345", ... }
}

The id field is {region_type}_{region_id}. Split on _ to extract both.

Step 2: GIS CSV download to get property listings for that region.

GET /stingray/api/gis-csv?region_id={id}&region_type={type}&...

Returns CSV data (not JSON — no {}& prefix). The CSV has:

  • Row 0: headers (look for URL column)
  • Row 1: MLS disclaimer text ("In accordance with local MLS rules...")
  • Rows 2+: property data

Extract the URL column to get Redfin property URLs for further querying.

2. Get Property IDs from a URL
GET /stingray/api/home/details/initialInfo?path={redfin_path}

Where path is the URL path portion (e.g., /CA/Fountain-Valley/12345-Main-St-92708/home/12345678).

Payload:

{
  "propertyId": 12345678,
  "listingId": 234567890,
  "latLong": { "latitude": 33.71, "longitude": -117.95 }
}
3. Get Property Details

Most detail endpoints live under /stingray/api/home/details/. Some require just propertyId, others require both propertyId and listingId.

For property-only endpoints, add accessLevel=1 and optionally pageType=3.

Endpoint Reference

URL-based (pass path parameter)
EndpointPath
Initial Infoapi/home/details/initialInfo
Page Tagsapi/home/details/v1/pagetagsinfo
Primary Regionapi/home/details/primaryRegionInfo
Search
EndpointPathKey Params
Location Autocompletedo/location-autocompletelocation, v=2
GIS CSVapi/gis-csvregion_id, region_type, filters (see below)
Property ID Only (propertyId param)
EndpointPathPage Type
Below The Fold (MLS)api/home/details/belowTheFold3
Hood Photosapi/home/details/hood-photos—
More Resourcesapi/home/details/moreResourcesInfo—
Page Headerapi/home/details/homeDetailsPageHeaderInfo—
Property Commentsapi/v1/home/details/propertyCommentsInfo—
Building Detailsapi/building/details-page/v1—
Owner Estimateapi/home/details/owner-estimate—
Claimed Seller Dataapi/home/details/claimedHomeSellerData—
Cost of Ownershipdo/api/costOfHomeOwnershipDetails—
Listing ID Only (listingId param)
EndpointPath
Floor Plansapi/home/details/listing/floorplans
Tour Date Pickerdo/tourlist/getDatePickerData
Table ID (tableId param)
EndpointPathExtra Params
Shared Regionapi/region/shared-region-inforegionTypeId=2, mapPageTypeId=1
Full Property Details (propertyId + listingId params)
EndpointPathPage Type
Similar Listingsapi/home/details/similars/listings—
Similar Soldapi/home/details/similars/solds—
Nearby Homesapi/home/details/nearbyhomes—
Above The Foldapi/home/details/aboveTheFold—
Property Parcelapi/home/details/propertyParcelInfo3
Activity/Historyapi/home/details/activityInfo—
Off-Market Infoapi/home/details/customerConversionInfo/offMarket3
Rental Estimateapi/home/details/rental-estimate—
AVM Historicalapi/home/details/avmHistoricalData—
Info Panelapi/home/details/mainHouseInfoPanelInfo—
Descriptionapi/home/details/descriptiveParagraph—
AVM Detailsapi/home/details/avm—
Tour Insightsapi/home/details/tourInsights3
Statsapi/home/details/statsalso needs regionId

GISCSV Default Parameters

These defaults return a broad set of listings for a given region. Override region_id and region_type per search.

DEFAULT_GISCSV_PARAMS = {
    "al": "3",
    "num_homes": "350",
    "ord": "redfin-recommended-asc",
    "page_number": "1",
    "region_id": "",          # required — from location autocomplete
    "region_type": "2",       # 2 = zipcode
    "sf": "1,2,5,6,7",       # property sub-filters
    "status": "9",            # 9 = all statuses
    "uipt": "1,2,3,4,5,6,7,8",  # all property types
    "v": "8",
    # boolean filters (all false for broadest results)
    "has_pool": "false",
    "has_parking": "false",
    "has_laundry_facility": "false",
    "has_laundry_hookups": "false",
    "has_dishwasher": "false",
    "has_att_fiber": "false",
    "has_deal": "false",
    "has_short_term_lease": "false",
    "include_pending_homes": "false",
    "isRentals": "false",
    "is_furnished": "false",
    "is_income_restricted": "false",
    "is_senior_living": "false",
    "pool": "false",
    "travel_with_traffic": "false",
    "travel_within_region": "false",
    "utilities_included": "false",
}
Filtering for Single-Family Homes Only

To restrict to single-family homes (relevant for this project):

  • Set uipt=1 (single family only, instead of 1,2,3,4,5,6,7,8)
  • Set sf=1,2,5,6,7 (keeps the default sub-filters)
Property Type Codes (uipt)
CodeType
1Single Family
2Condo
3Townhouse
4Multi-Family
5Land
6Mobile/Manufactured
7Co-op
8Other

Parsing Response Payloads

Redfin payloads are deeply nested. Use JMESPath expressions (or equivalent dictionary traversal) to extract data.

From InitialInfo Payload
FieldJMESPath
Property IDpropertyId
Listing IDlistingId
LatitudelatLong.latitude
LongitudelatLong.longitude
From BelowTheFold (MLS) Payload
FieldJMESPath
Zip CodepublicRecordsInfo.addressInfo.zip
CitypublicRecordsInfo.addressInfo.city
StatepublicRecordsInfo.addressInfo.state
Image URLspropertyHistoryInfo.mediaBrowserInfoBySourceId.*.photos[].photoUrls.nonFullScreenPhotoUrlCompressed
Thumbnail URLspropertyHistoryInfo.mediaBrowserInfoBySourceId.*.photos[].thumbnailData.thumbnailUrl
Realtor AttributionpropertyHistoryInfo.mediaBrowserInfoBySourceId.*.photoAttribution | [0]
Event Countlength(propertyHistoryInfo.events)
Event PricepropertyHistoryInfo.events[N].price
Event DescriptionpropertyHistoryInfo.events[N].eventDescription
Event SourcepropertyHistoryInfo.events[N].source
Event Source IDpropertyHistoryInfo.events[N].sourceId
Event DatepropertyHistoryInfo.events[N].eventDate (Unix ms)
Realtor Name Parsing

The photoAttribution field looks like "Listed by Jane Smith • Acme Realty.". Split on •, trim whitespace, strip "Listed by " prefix from part 0, strip trailing . from part 1.

Event Date Handling

Event dates are Unix timestamps in milliseconds. Convert: datetime.fromtimestamp(event_date / 1000) (Python) or time.Unix(0, event_date * int64(time.Millisecond)) (Go).

Most Useful Endpoints for Home Buying

For property evaluation, these three give you the most value:

  1. InitialInfo — property/listing IDs, lat/long
  2. BelowTheFold — address, property history (price changes), images, realtor info
  3. AVMDetails — Redfin's automated valuation model estimate

Additional high-value endpoints:

  • SimilarSold — recent comparable sales
  • SimilarListings — competing listings
  • CostOfHomeOwnership — estimated monthly costs breakdown
  • Activity — showing activity, saves, views
  • Stats — market statistics for the region

Implementation Notes

Response Prefix Stripping

Every response (except GISCSV which returns raw CSV) is prefixed with {}& (exactly 4 bytes). Strip before JSON parsing:

// Go
jsonBytes := responseBytes[4:]
# Python
data = json.loads(response.text[4:])
Rate Limiting

Add delays between requests (the gredfin project uses a configurable interval, typically a few seconds). Redfin will block aggressive scraping.

Error Handling

Always check both the HTTP status code AND the resultCode/errorMessage fields in the JSON response. A 200 HTTP status can still contain an error in the Redfin response body.

Hash-Based Deduplication

When polling properties over time, hash the payload bytes (MD5) and skip re-processing if unchanged from the last scrape.

Comments

Markdown supported