Resolve a place name (city, region, or country) to Facebook location IDs. Use a returned id as the location_id filter on Search Posts to scope post results to a place.
curl "https://apidirect.io/v1/facebook/locations?query=London" \
-H "X-API-Key: YOUR_API_KEY"
{
"results": [
{
"id": "106078429431815",
"label": "London, United Kingdom",
"timezone": "Europe/London"
},
{
"id": "107624535933778",
"label": "London, Ontario",
"timezone": "America/Toronto"
},
{
"id": "108364785855057",
"label": "London, Kentucky",
"timezone": "America/New_York"
}
],
"count": 3
}
Call this endpoint with a place name, pick the result you want, and pass its id to the Search Posts endpoint as the location_id parameter to scope that search to the location.
Place names are often ambiguous (for example, London, UK vs London, Ontario). Use the label field to choose the right match, or add a country or region to your query to narrow results.
No. Location filtering biases results toward the chosen place rather than applying a strict geofence, so an occasional out-of-area post may still appear.
You only pay for successful requests. The Facebook Search Locations API costs $0.004 per request. There are no monthly fees or commitments. You get 50 free requests per endpoint every month.
No. You can sign up and use the free tier (50 requests/endpoint/month) without adding a payment method. You only need to add a card when you want to exceed the free tier.
Yes, there's a concurrency limit of 3 simultaneous requests per endpoint per user. If you need more, just get in touch.
Get your API key and start making requests in minutes. 50 requests/month free every month.
Get API Key