This endpoint will retrieve listing information from a single 'For Sale' property listing page and transform it into usable JSON.
Copy <?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);
?>
Copy <?php
$curl = curl_init();
$data = json_encode(array(
'apiKey' => 'APIKEY',
'urls' => ['URL1','URL2'],
'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);
?>
Copy {
"id": "aa65d866-b53f-4488-9cbe-2bee29d6f65c",
"status": "running",
"statusUrl": "https://async.scraperapi.com/jobs/aa65d866-b53f-4488-9cbe-2bee29d6f65c",
"url": "https://www.redfin.com/NH/Salem/1-Chestnut-Dr-03079/home/96531263"
}
Copy [
{
"id": "6d282e78-4d1a-46cb-838f-cc59e592774f",
"attempts": 0,
"status": "running",
"statusUrl": "https://async.scraperapi.com/jobs/6d282e78-4d1a-46cb-838f-cc59e592774f",
"url": "https://www.redfin.com/NH/Salem/1-Chestnut-Dr-03079/home/96531263"
},
{
"id": "d59ed100-6213-4097-afe5-6488ec5dda12",
"attempts": 0,
"status": "running",
"statusUrl": "https://async.scraperapi.com/jobs/d59ed100-6213-4097-afe5-6488ec5dda12",
"url": "https://www.redfin.com/MA/Methuen/72-Sheldon-St-01844/home/11773076"
}
]