{"base_url":"https://fetch-listing.gorent.homes","curl_examples":{"basic_scrape":"curl 'https://fetch-listing.gorent.homes/scrape/sync?url=https://www.fazwaz.com/property-sales/2-bedroom-condo-for-sale-at-arise-vibe-in-si-sunthon-phuket-u5634262'","force_refresh":"curl 'https://fetch-listing.gorent.homes/scrape/sync?url=URL&refresh=1'","get_cached":"curl 'https://fetch-listing.gorent.homes/cache/5634262-sale'","list_cache":"curl 'https://fetch-listing.gorent.homes/cache'","multiple_urls":"curl 'https://fetch-listing.gorent.homes/scrape/sync?url=URL1&url=URL2'"},"description":"AI-powered FazWaz property scraper with caching","endpoints":{"GET /cache":{"description":"List all cached properties","method":"GET","parameters":{},"response":{"count":"Number of cached properties","files":"Array of cached property filenames"}},"GET /cache/<property_id>":{"description":"Get cached data for specific property","example":"GET /cache/5634262-sale","method":"GET","parameters":{"property_id":"property_id from a scrape/discover result. FazWaz ids are basis-qualified, e.g. 5634262-sale / 5634262-rent"}},"GET /health":{"description":"Health check endpoint","method":"GET","response":{"scraping_in_progress":"boolean","status":"healthy","timestamp":"ISO timestamp"}},"GET /scrape/sync":{"description":"Scrape property URLs synchronously (waits for completion)","examples":{"force_refresh":"GET /scrape/sync?url=URL&refresh=1","multiple_urls":"GET /scrape/sync?url=URL1&url=URL2&url=URL3","single_url":"GET /scrape/sync?url=https://www.fazwaz.com/property-sales/2-bedroom-condo-for-sale-at-arise-vibe-in-si-sunthon-phuket-u5634262"},"method":"GET","parameters":{"delay":"Optional. Delay between requests in seconds (default: 2.0)","refresh":"Optional. Set to 1 to force re-scrape (ignore cache)","url":"Property URL(s) to scrape (can be multiple)"}},"POST /discover":{"auth":"X-API-Key header OR ?api_key= query param","body":{"bedrooms_max":"Optional int. Note: ignored on renthub.","bedrooms_min":"Optional int. Note: ignored on renthub (search-page payload doesn't expose bedroom counts).","listing_type":"'sale' or 'rent' (required). Note: renthub supports rent only in v1.","location":"Location slug or name. FazWaz: any FazWaz location. DDproperty: 'bangkok','phuket','pattaya','hua hin','chiang mai','chonburi','rayong','khon kaen','samut prakan','nonthaburi','pathum thani','nakhon pathom' (or raw 'slug-thNNN'). Renthub: any English zone slug ('patong-beach'), English name ('Patong Beach'), or Thai name ('\u0e2b\u0e32\u0e14\u0e1b\u0e48\u0e32\u0e15\u0e2d\u0e07') \u2014 auto-resolved.","max_pages":"Optional int (default 3, max 10)","max_results":"Optional int (default 60, max 200)","price_max":"Optional int (THB)","price_min":"Optional int (THB)","property_type":"Optional: condo | house | villa | townhouse | land. Note: ignored when site=ddproperty (DDproperty 'all-types' search pages don't expose per-card property type). Renthub maps these to its English path segments.","site":"Optional: 'fazwaz' (default), 'ddproperty', 'renthub', 'both' (=fazwaz+ddproperty, legacy), or 'all' (all three). DDproperty uses camoufox (~30s cold start). Renthub uses plain requests (fast, no cookies, no browser)."},"description":"Search property listings on FazWaz, DDproperty, and/or renthub.in.th. Auth required (X-API-Key header or ?api_key= query param).","examples":{"all":"GET /discover?api_key=KEY&site=all&listing_type=rent&location=phuket","both_legacy":"GET /discover?api_key=KEY&site=both&listing_type=rent&location=phuket","ddproperty":"GET /discover?api_key=KEY&site=ddproperty&listing_type=rent&location=phuket","fazwaz_default":"GET /discover?api_key=KEY&listing_type=rent&location=phuket","renthub_en":"GET /discover?api_key=KEY&site=renthub&listing_type=rent&location=patong-beach","renthub_thai":"GET /discover?api_key=KEY&site=renthub&listing_type=rent&location=\u0e2b\u0e32\u0e14\u0e1b\u0e48\u0e32\u0e15\u0e2d\u0e07"},"method":"POST or GET","response_shape":{"site=all":"{success, count, results, sources: {fazwaz: {\u2026}, ddproperty: {\u2026}, renthub: {\u2026}}}","site=both":"{success, count, results, sources: {fazwaz: {count, error?}, ddproperty: {count, error?}}} \u2014 legacy two-source merge, does NOT include renthub","site=ddproperty":"{success, count, results} \u2014 each result has source='ddproperty'","site=fazwaz (default)":"{success, count, results} \u2014 unchanged from v2 contract","site=renthub":"{success, count, results} \u2014 each result has source='renthub'"}}},"name":"FazWaz Scraper API","notes":["Cookies are automatically loaded from cookies.json file","First scrape may take 10-30 seconds due to AI processing","Subsequent requests return cached data instantly","Use refresh=1 to force re-scrape and get fresh data","FazWaz property_id is the URL u-number plus a basis suffix (u5634262 on a /property-sales/ URL -> 5634262-sale; on a /property-rent/ URL -> 5634262-rent). The rent and sale listing of a dual-listed unit thus stay distinct, basis-consistent records."],"python_examples":{"basic_request":"import requests\n\nurl = 'https://fetch-listing.gorent.homes/scrape/sync'\nparams = {'url': 'https://www.fazwaz.com/property-sales/2-bedroom-condo-for-sale-at-arise-vibe-in-si-sunthon-phuket-u5634262'}\n\nresponse = requests.get(url, params=params)\ndata = response.json()\n\nif 'success' in data:\n    for prop in data['results']:\n        print(f\"{prop['title']} - {prop['price_formatted']}\")\nelse:\n    print(f\"Error: {data['error']}\")","with_refresh":"params = {\n    'url': 'https://www.fazwaz.com/property-sales/2-bedroom-condo-for-sale-at-arise-vibe-in-si-sunthon-phuket-u5634262',\n    'refresh': 1\n}"},"response_format":{"error":{"error":"error message"},"success":{"count":"number of properties scraped","results":[{"bathrooms":"number","bedrooms":"number","description":"string","extraction_method":"ai","facilities":["array"],"images":["array of image URLs"],"listing_type":"string - 'rent' or 'sale'; price always matches this basis","location":{"district":"string","province":"string","subdistrict":"string"},"price":"number - monthly rent when listing_type=rent, else sale price","price_formatted":"string","property_id":"string - FazWaz: <u-id>-rent / <u-id>-sale (basis-qualified)","property_type":"string","scraped_at":"ISO timestamp","size_sqm":"number","title":"string","url":"original URL"}],"success":true}},"version":"2.0.0"}
