Places to search around
The places a search can be centred on by name: each with name, slug (pass it as city), country, latitude and longitude. Anywhere else, search by latitude and longitude. Up to 50. Free.
POST
/locations Utilities https://api.fetchlayer.dev/facebook-marketplace/locations Headers
Authorization string required Bearer token — your FetchLayer API key.
Parameters
query string optional A place name or part of one; empty lists the first places.
country string optional Only places in this country (two letters, such as US or GB).
limit integer optional How many places, 1-50. (default: 10)
format string optional json or markdown. (default: json)
Response Fields
locations
Places to search around
transport string The data source: always "facebook-marketplace".
notes string[] Caveats you can act on, such as a list that stopped early. Empty when there are none.
locationCount number How many places are in this response.
locations object[] { name, slug, country, latitude, longitude }.
Request
curl -X POST "https://api.fetchlayer.dev/facebook-marketplace/locations" \
-H "Authorization: Bearer ss-your-key" \
-H "Content-Type: application/json" \
-d '{"query":"san","country":"US","limit":2}'Response
{
"transport": "facebook-marketplace",
"notes": [],
"locationCount": 2,
"locations": [
{
"name": "San Francisco",
"slug": "sanfrancisco",
"country": "US",
"latitude": 37.7749,
"longitude": -122.4194
},
{
"name": "San Diego",
"slug": "sandiego",
"country": "US",
"latitude": 32.7157,
"longitude": -117.1611
}
]
}