Facebook-通过位置名称获取位置/地点ID [英] Facebook - obtain location /places ID via location name

查看:192
本文介绍了Facebook-通过位置名称获取位置/地点ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过图形api通过查询发送带有位置ID的查询来返回位置的详细信息,但是我想实现相反的效果-通过发送包含位置名称(城市,状态等).这可能吗?

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?

推荐答案

这可以通过几种不同的方法来实现.您可以使用多头/纬度头寸进行搜索,然后将地名放入查询中.此搜索将仅搜索地点.

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.

执行以下操作

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

这将返回礼仪咖啡.

另一种方法是使用以下内容搜索Facebook页面 https://graph.facebook.com/search?q = ritual%20coffee& type = page& access_token = mytoken

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.

这篇关于Facebook-通过位置名称获取位置/地点ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆