LogoLogo
Release NotesDataPipelineFAQs
Ruby
Ruby
  • Making Requests
    • API Endpoint Method
    • Proxy Port Method
    • SDK Method
    • Async Requests Method
      • How to use
      • Callbacks
      • API Parameters
      • Async Batch Requests
      • Decoding
    • Structured Data Collection Method
      • Amazon Product Page API
      • Amazon Search API
      • Amazon Offers API
      • Amazon Reviews API
      • Ebay Product Page API
      • Ebay Search API
      • Google SERP API
      • Google News API
      • Google Jobs API
      • Google Shopping API
      • Google Maps Search API
      • Redfin Agent Details API
      • Redfin 'For Rent' Listings API
      • Redfin 'For Sale' Listings API
      • Redfin Listing Search API
      • Walmart Search API
      • Walmart Category API
      • Walmart Product API
      • Walmart Reviews API
    • Async Structured Data Collection Method
      • Amazon Product Page API (Async)
      • Amazon Search API (Async)
      • Amazon Offers API (Async)
      • Amazon Reviews API (Async)
      • Ebay Product Page API (Async)
      • Ebay Search API (Async)
      • Google Search API (Async)
      • Google News API (Async)
      • Google Jobs API (Async)
      • Google Shopping API (Async)
      • Google Maps Search API (Async)
      • Redfin Agent Details API (Async)
      • Redfin 'For Rent' Listings API (Async)
      • Redfin 'For Sale' Listings API (Async)
      • Redfin Listing Search API (Async)
      • Walmart Search API (Async)
      • Walmart Category API (Async)
      • Walmart Product API (Async)
      • Walmart Reviews API (Async)
    • Making POST/PUT Requests
    • Customizing Requests
      • Amazon ZIP Code Targeting
      • Cached Results
      • Cost Control
      • Custom Headers
      • Device Type
      • Geotargeting
      • Geotargeting (Premium)
      • Parameters as Headers
      • Premium Residential/Mobile Proxy Pools
      • Rendering Javascript
        • Render Instruction Set
        • Screenshot Capture🆕
      • Sessions
  • Handling and Processing Responses
    • API Status Codes
    • Output Formats
      • JSON Response - Autoparse 📜
      • LLM Output Formats 💻
    • Response Encoding and Content-Type
  • Dashboard & Billing
    • API Key
    • Credit Usage
    • Delete Account
    • Invoice History
    • Billing Email
    • Billing Address
    • VAT Number
    • Payment Method
    • Cancel Subscription
  • Credits and Requests
  • Account Information
  • Documentation Overview
Powered by GitBook

Quick links

  • Homepage
  • Dashboard
  • Pricing
  • Contact Sales

Resources

  • Developer Guides
  • Blog
  • Contact Support
  • Learning Hub
On this page

Was this helpful?

  1. Making Requests
  2. Structured Data Collection Method

Redfin 'For Sale' Listings API

This endpoint will retrieve listing information from a single 'For Sale' property listing page and transform it into usable JSON.

require 'net/http'
require 'json'
params = {
:api_key => "API_KEY",
:url => "URL",
:country_code => "COUNTRY_CODE",
:tld => "TLD",
:raw => "RAW",
}
uri = URI('https://api.scraperapi.com/structured/redfin/forsale')
uri.query = URI.encode_www_form(params)
website_content = Net::HTTP.get(uri)
print(website_content)

Parameters
Details

API_KEY (required)

User's API Key.

URL (required)

The URL of the Redfin page. The URL has to be the URL of a property for sale.

country_code

TLD

The top level domain to scrape.

Valid options:

raw

This is a boolean param - true or false

If the raw parameter is set to true, the raw data will be extracted from the page without further parsing.

Important: The structure of the data in raw mode cannot be guaranteed, it’s a tradeoff: You get a lot more information back, but the structure of the response may change if Redfin modifies their page layout.

Sample Response

{
  "url": "https://redfin.com/NH/Salem/1-Chestnut-Dr-03079/home/96531263",
  "type": "for_sale",
  "image_urls": [
    "https://ssl.cdn-redfin.com/photo/154/bigphoto/196/5023196_0.jpg",
    "https://ssl.cdn-redfin.com/photo/154/bigphoto/196/5023196_1_0.jpg",
    ...
  ],
  "price": 899900,
  "currency": "$",
  "sq_ft": 2928,
  "price_per_sq_ft": 307,
  "latitude": 42.755854,
  "longitude": -71.2134495,
  "beds": 4,
  "baths": 2.5,
  "url_map": "https://maps.google.com/maps/api/staticmap?sensor=false&style=feature%3Aadministrative.land_parcel%7Cvisibility%3Aoff&style=feature%3Alandscape.man_made%7Cvisibility%3Aoff&style=feature%3Atransit.station%7Chue%3A0xffa200&center=42.755854%2C-71.2134495&channel=desktop_xdp_above_fold_static_preview&size=200x200&scale=1&format=jpg&zoom=11&client=gme-redfin&signature=UOuXHmn2QMUheU2YnGaziirBk9w=",
  "description": "Welcome to this pristine four-bedroom Colonial situated in a desirable cul-de-sac neighborhood. Thoughtfully cared for and updated this home offers a functional and welcoming layout featuring spacious rooms, hardwood floors throughout and plenty of natural light. The chef’s kitchen is the heart of the home with high-end stainless steel appliances, a 5 burner gas cooktop, custom cabinetry and a large quartz-topped island perfect for meal prep or casual dining. The main level also includes a comfortable living room a formal dining room for hosting and a cozy family room with a gas fireplace that’s perfect for gathering. Upstairs the primary suite offers a peaceful retreat with a private en-suite bath and walk-in closet. Three additional bedrooms provide flexibility for family, guests or a home office. Outside the backyard is ideal for relaxing or entertaining with a well-maintained lawn and a deck that’s r
  "address": "1 Chestnut Dr, Salem, NH 03079",
  "active": true,
  "agents": [
    {
      "name": "Caroleann M. Ohannessian",
      "broker_name": "RE/MAX Innovative Properties"
    }
  ],
  "amenities": {
    "stories": "2",
    "community": "Salem",
    "county": "Rockingham",
    "mls": "5023196",
    "built": "Built in 2002",
    "lot_size": "0.58 acres",
    "property_type": "Single-family",
    "heating_cooling": "Has A/C",
    "parking": "2 garage spaces"
  },
  "year_built": 2002,
  "property_type": "Single Family Residential",
  "schools": [
    {
      "name": "Dr. L. F. Soule School",
      "address": "173 S Policy St, Salem, NH 03079",
      "url": "http://redfin.com/school/135289/NH/Salem/Dr-L-F-Soule-School",
      "review_count": 3,
      "great_schools_rating": 4,
      "great_school_url": "https://www.greatschools.org/new-hampshire/salem/434-Dr.-L.-F.-Soule-School/",
      "parent_rating": 4,
      "distance_in_miles": "0.8",
      "grade_ranges": "K-5",
      "institution_type": "Public",
      "number_of_students": 249,
      "student_to_teacher_ratio": 11
    },
    {
      "name": "Woodbury School",
      "address": "206 Main St, Salem, NH 03079",
      "url": "http://redfin.com/school/136522/NH/Salem/Woodbury-School",
      "review_count": 3,
      "great_schools_rating": 5,
      "great_school_url": "https://www.greatschools.org/new-hampshire/salem/439-Woodbury-School/",
      "parent_rating": 2,
      "distance_in_miles": "1.9",
      "grade_ranges": "6-8",
      "institution_type": "Public",
      "number_of_students": 799,
      "student_to_teacher_ratio": 14
    },
    {
      "name": "Salem High School",
      "address": "44 Geremonty Dr, Salem, NH 03079",
      "url": "http://redfin.com/school/135508/NH/Salem/Salem-High-School",
      "review_count": 2,
      "great_schools_rating": 5,
      "great_school_url": "https://www.greatschools.org/new-hampshire/salem/438-Salem-High-School/",
      "parent_rating": 5,
      "distance_in_miles": "1.7",
      "grade_ranges": "9-12",
      "institution_type": "Public",
      "number_of_students": 1131,
      "student_to_teacher_ratio": 11
    }
  ],
  "similar_homes": [
    {
      "remarks": "Discover unparalleled luxury in this exquisite 4-bedroom, 3.5-bath estate overlooking Campbell's Scottish Highlands Golf Course. This masterpiece blends contemporary sophistication with timeless elegance. Enter the stately foyer into a world of refinement. To your right, an elegant dining room with wainscoting and tray ceiling awaits. Across, find a well-appointed office with tiled floor and an expansive window. The great room impresses with the first of two fireplaces, rich hardwood floors, and soaring vaulted ceilings, perfect for entertaining. From there, you head to the four seasons room which boasts the second stone gas fireplace and scenic views. Indulge your culinary passions in the c",
      "url": "http://redfin.com/NH/Salem/43-Ticklefancy-Ln-03079/home/60349931",
      "price": 1275000,
      "sq_ft": 5188,
      "beds": 4,
      "baths": 3.5,
      "stories": 1
    }
  ],
  "walk_score": 62,
  "bike_score": 37,
  "nearby_places": [
    {
      "name": "99 Restaurants",
      "address": "149 S Broadway, Salem, NH, 03079, us",
      "latitude": 42.76888656616211,
      "longitude": -71.21973419189453,
      "popularity": 0.5199999809265137,
      "phone_number": "(603) 893-5596",
      "website": "http://www.99restaurants.com/",
      "categories": [
        "Bar"
      ],
      "distance": 0.9563021208779819
    },
    {
      "name": "Peppers Pub",
      "address": "326 S Broadway, Salem, NH, 03079, us",
      "latitude": 42.75418472290039,
      "longitude": -71.20906066894531,
      "popularity": 0.10000000149011612,
      "categories": [
        "Bar",
        "Sports Bar",
        "Burger Joint",
        "Sandwich Restaurant"
      ],
      "distance": 0.25103686646367174
    },
    ...
  ],
  "transit": [
    {
      "stop_name": "Village Plaza -  Jo-Anns Fabrics",
      "latitude": 42.736726540051,
      "longitude": -71.196858494474,
      "routes": [
        {
          "short_name": "10",
          "long_name": "VILLAGE MALL VIA BROADWAY"
        },
        {
          "short_name": "10",
          "long_name": "Methuen Square"
        },
        {
          "short_name": "40",
          "long_name": "Methuen Square"
        }
      ]
    },
    {
      "stop_name": "Pelham Street Park & Ride",
      "latitude": 42.727395,
      "longitude": -71.200232,
      "routes": [
        {
          "short_name": "99",
          "long_name": "Methuen-Lawrence-Andover to Boston"
        }
      ]
    },
    ...
  ],
  "redfin_agent": "Sherre Dubis",
  "redfin_agent_average_rating": 10,
  "redfin_agent_url": "http://redfin.com/real-estate-agents/sherre-dubis",
  "redfin_agent_phone_number": "603-968-5261",
  "redfin_agent_deal_count": 232,
  "redfin_agent_volume": 92046099,
  "redfin_agent_highest_deal": 1300000,
  "url_map_2_x": "https://maps.google.com/maps/api/staticmap?sensor=false&style=feature%3Aadministrative.land_parcel%7Cvisibility%3Aoff&style=feature%3Alandscape.man_made%7Cvisibility%3Aoff&style=feature%3Atransit.station%7Chue%3A0xffa200&center=42.755854%2C-71.2134495&channel=ldp-minimap&path=color%3A0x2E7E36AA%7Cweight%3A1%7Cfillcolor%3A0x2E7E3633%7C42.7556517661979%2C-71.2136135592431%7C42.755652853304%2C-71.2136293929133%7C42.7556559108632%2C-71.2136447455755%7C42.7556608497788%2C-71.2136591683348%7C42.7556675261445%2C-71.2136722383488%7C42.7556757440131%2C-71.2136835759095%7C42.7556852653219%2C-71.2136928504789%7C42.755701061368%2C-71.2137021953775%7C42.7557599003748%2C-71.213722775569%7C42.7558199448114%2C-71.213735406652%7C42.7558806135693%2C-71.2137399682356%7C42.7559413186263%2C-71.2137364132741%7C42.7560014722875%2C-71.2137247777876%7C42.7561640281287%2C-71.2136878321098%7C42.7561751049447%2C-71.2136832168033%7C42.7561854509485%2
}
PreviousRedfin 'For Rent' Listings APINextRedfin Listing Search API

Last updated 2 months ago

Was this helpful?

Allows you to geotarget the request. Use this parameter if you want Redfin to be scraped from a specific .

‘com’ (for )

‘ca’ (for )

country
redfin.com
redfin.ca