如何使用API从Instagram帖子中获取位置地理标签



我正在尝试使用基本显示Instagram API从已经发布的Instagram帖子中获取位置地理标签?

我找不到任何可以让我获得位置的端点。我是错过了什么,还是我们做不到?

此时,您只能在通过API创建介质时设置location-id,但在检索介质时不可用。

对API的POST调用https://developers.facebook.com/docs/instagram-api/reference/ig-user/media#create-照片容器

进行GET调用时可用的字段https://developers.facebook.com/docs/instagram-api/reference/ig-media#fields

您可以使用我使用的data365.co Instagram API获得它。

如果你有post ID或shortcode,你可以构建一个任务,通过post请求下载:https://api.data365.co/v1.1/instagram/post/CYjV-nusXA8/update?access_token=TOKEN

此GET请求向您返回有关发布的信息:https://api.data365.co/v1.1/instagram/post/CYjV-nusXA8?access_token=TOKEN

您会收到这样一个字段列表,其中包括location_id:

{
"data": {

"attached_media_content": null,
"attached_media_display_url": "https://instagram.fclj4-1.fna.fbcdn.net/v/t51.2885-15/e35/s1080x1080/271671353_2486006594877541_7824177366520402526_n.jpg?_nc_ht=instagram.fclj4-1.fna.fbcdn.net&_nc_cat=101&_nc_ohc=6N-Dwpx8IvEAX9Zjcvp&edm=AABBvjUBAAAA&ccb=7-4&oh=00_AT88wqJiMtaSe4Ma8xtcixRCdaIozxnXKK_6k1W-84k3ZQ&oe=61E6FF84&_nc_sid=83d603",
"attached_media_tagged_users": [
"dilettazamba.iti",
"laura_medeghini"
],
"attached_video_url": null,
"comments_count": 8,
"created_time": "2022-01-10T14:04:24",
"id": "2748136859869737020",
"is_comments_disabled": false,
"is_video": false,
"likes_count": 257,
"location_id": "447269731",
"owner_id": "182171607",
"related_posts": null,
"shortcode": "CYjV-nusXA8",
"sponsors": [
"dilettazamba.iti",
"laura_medeghini"
],
"text": "Pretending it was not all about grappa 🦠#italiansdoitbetter🇮🇹",
"text_lang": "en",
"text_tagged_users": null,
"text_tags": [
"italiansdoitbetter"
],
"timestamp": 1641823464,
"video_plays_count": null,
"video_views_count": null
},
"error": null,
"status": "ok"
}

如果需要获取更多位置数据,可以创建一个任务来下载位置信息。

创建任务示例POST请求:

https://api.data365.co/v1.1/instagram/location/447269731/update?access_token=TOKEN

获取数据示例,GET请求:

https://api.data365.co/v1.1/instagram/location/447269731?access_token=TOKEN

GET请求的位置数据示例:

{
"data": {
"address": null,
"city": null,
"country_code": "IT",
"description": null,
"external_url": "http://www.regione.lombardia.it/",
"has_public_page": false,
"id": "447269731",
"is_exact_city_match": null,
"is_exact_country_match": null,
"is_exact_region_match": true,
"latitude": 45.65,
"longitude": 9.95,
"name": "Lombardy",
"phone": null,
"posts_count": 752322,
"primary_alias_on_fb": "234765516537015",
"region": "Lombardia",
"slug": "lombardy",
"thumb_url": "https://instagram.fhel6-1.fna.fbcdn.net/v/t51.2885-15/e35/s150x150/133538449_422161569029342_6176236793032572073_n.jpg?_nc_ht=instagram.fhel6-1.fna.fbcdn.net&_nc_cat=102&_nc_ohc=TKr1bwmeTxsAX8c_2AW&tp=1&oh=6d7d9df9654741083884c5880496fc5a&oe=60269982",
"zip_code": null
},
"error": null,
"status": "ok"
}

您可以在上查看有关我们的API功能及其提供的数据的更多信息https://data365.co/instagram.

这可以通过打开帖子,右键单击帖子顶部,勾选Properties,然后选择Location来完成。你会得到一张位置坐标为十进制的地图,你可以用它在谷歌地图或其他地图服务上精确定位该地点。API也计算出了这一点,但API仅适用于开发者,因此除非你正在构建与之相关的应用程序,否则普通Instagram用户无法访问它。

最新更新