<?php
$query = http_build_query(["engine" => "realtor", "q" => "Austin, TX", "type" => "for_sale"]);
$ch = curl_init("https://api.scraperdata.com/v1/search?$query");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-API-Key: YOUR_API_KEY"],
CURLOPT_TIMEOUT => 60,
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);
{ "search_metadata": { "status": "Success", "pages": 1, "credits_charged": 1 }, "search_parameters": { "engine": "realtor", "q": "New York, NY", "type": "for_sale", "page": 1 }, "search_information": { "total_results": 24739, "page": 1, "per_page": 42, "total_pages": 50 }, "listings": [ { "position": 1, "street_address": "78-41 82nd St", "city": "Glendale", "state": "NY", "price": 1198000, "bedrooms": 6, "bathrooms": 3, "home_type": "multi_family", "url": "https://www.realtor.com/realestateandhomes-detail/..." } ]}