Erick Veras
Erick Veras

Reputation: 21

How get the list of cities on facebook API with a region param

I want get a list of cities passing a state region param.

I got make this facebook webservice that i get the list of states from a country

https://graph.facebook.com/v3.1/search?country_code=BR&limit=1000&location_types%5B0%5D=region&type=adgeolocation&access_token=XXXX

Response code with this url:

{
   "data": [
      {
          "key": "438",
          "name": "Acre",
          "type": "region",
          "country_code": "BR",
          "country_name": "Brazil",
          "supports_region": true,
          "supports_city": true
      },
      {
          "key": "439",
          "name": "Alagoas",
          "type": "region",
          "country_code": "BR",
          "country_name": "Brazil",
          "supports_region": true,
          "supports_city": true
      }
    ]
}

Someone can help me ? Thanks!

Upvotes: 1

Views: 508

Answers (1)

camelsWriteInCamelCase
camelsWriteInCamelCase

Reputation: 1665

You can get a list of cities only with a non-empty value of q parameter, containing the value of the city name substring. I think for queries with region_id this is an unnecessary restriction.

Upvotes: 1

Related Questions