Facebook - obtain location /places ID via location name

前端 未结 3 1708
囚心锁ツ
囚心锁ツ 2021-02-01 22:51

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 i

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-01 23:20

    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¢er=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.

提交回复
热议问题