Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook - obtain location /places ID via location name

I'm able to return a location's details by sending a query via the graph api with the location's ID, however I'm looking to achieve the reverse - effectively find location id by sending a request containing the location name (city, state etc). Is this possible?

like image 548
BrynJ Avatar asked Mar 18 '11 20:03

BrynJ


People also ask

Can Facebook track your location?

Here are three ways Facebook tracks your location: Location services – This involves your phone or tablet's GPS coordinates, as well as Wi-Fi and cellular network locations. IP address – IP (internet) addresses give a vague idea of your whereabouts, sometimes down to the postcode.

Why can't I see my location history on Facebook?

Open the Settings & Privacy option and tap on the Privacy Shortcuts option. Tap on the Manage your location settings option. Tap on the Location history option that should have a small cog wheel next to it. Toggle the Location history slider on and off to have Facebook record your location.


1 Answers

This is possible under a few different approaches. You can either search using long / lat positions and put the place name into the query. This search will search places only.

Do the following

https://graph.facebook.com/search?q=ritual&type=place&center=37.76,-122.427&distance=1000&access_token=mytoken.

This will return ritual coffee.

Another way is to search through facebook pages using the following https://graph.facebook.com/search?q=ritual%20coffee&type=page&access_token=mytoken

This way is more difficult as you will obviously need to parse the list in more detail.

like image 142
Steve Avatar answered Oct 02 '22 14:10

Steve