<?php
$query = http_build_query(["engine" => "forsalebyowner", "q" => "Houston, 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": "forsalebyowner", "q": "Houston, TX", "type": "for_sale", "page": 1 }, "search_information": { "total_results": 347, "page": 1, "per_page": 50, "total_pages": 7 }, "listings": [ { "position": 1, "street_address": "2218 Isabella Street", "city": "Houston", "price": 525000, "bedrooms": 5, "bathrooms": 2.5, "living_area": 3500, "property_type": "Multi-Family", "year_built": 1945, "url": "https://www.forsalebyowner.com/listing/6b0463f4414517774c067ae4" } ]}