Redfin 'For Sale' Listings API (Async)

Scrape Redfin For Sale pages in structured JSON/CSV with ScraperAPI async in PHP. Supports URL, country code, TLD, and raw data extraction for flexible scraping.

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

Single query request:

<?php

$curl = curl_init();

$data = json_encode(array(
    'apiKey' => 'APIKEY',
    'url' => 'URL',
    'country_code' => 'COUNTRY_CODE',
    'tld' => 'TLD',
    'raw' => 'RAW',
    'callback' => array(
        'type' => 'webhook',
        'url' => 'YYYYY'
    )
));

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://async.scraperapi.com/structured/redfin/forsale',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => $data,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

if (curl_errno($curl)) {
    echo 'Error:' . curl_error($curl);
} else {
    echo $response;
}

curl_close($curl);

?>

Multiple Query Request:

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

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

TLD

The top level domain to scrape.

Valid options:

com’ (for redfin.com)

ca’ (for redfin.ca)

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

For single query requests:

For multiple query requests:

Last updated

Was this helpful?