- Use cases
- Marketplace research
Marketplace research
Search listings by place and keyword and read the price.
The job
Resellers and analysts want the market price. Resolve a place to coordinates, search a keyword there, and read each listing.
Endpoints
Failed requests and cached repeats cost 0 credits. Send max_age_days to accept a recent cached copy. See credits and caching.
| Endpoint | Returns | Cost |
|---|---|---|
| Facebook Marketplace location search | 1 credit | |
| Facebook Marketplace search | 1 credit | |
| Facebook Marketplace listing | 1 credit |
Recipe
- Resolve a city name to latitude and longitude.
- Search listings around it.
- Open an item for the details.
1import os2import requests34API = "https://api.socialscrape.dev"5HEADERS = {"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]}678def get(path, **params):9 res = requests.get(API + path, headers=HEADERS, params=params, timeout=60)10 res.raise_for_status()11 return res.json()["data"]1213# Facebook Marketplace location search14places = get("/v1/facebook/marketplace/location/search", query="Austin")1516print(places["items"][:3])1const API = "https://api.socialscrape.dev";2const headers = { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! };34async function get(path: string, params: Record<string, string | number | boolean>) {5 const query = new URLSearchParams(Object.entries(params).map(([k, v]) => [k, String(v)]));6 const res = await fetch(`${API}${path}?${query}`, { headers });7 if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);8 return (await res.json()).data;9}1011// Facebook Marketplace location search12const places = await get("/v1/facebook/marketplace/location/search", { query: "Austin" });1314console.log(places.items.slice(0, 3));Calls use api.socialscrape.dev and return the shapes in the reference.
Good to know
A marketplace search needs a place, either a location or latitude and longitude, so resolve the city first. The search endpoint page lists the filters.