通过 API 从 Instagram 照片中提取 lat/lng [英] Extract lat/lng from an Instagram photo via API
问题描述
默认情况下,Instagram 会为所有提交的照片保存地理标签.然后,您可以使用 /media/search
按位置搜索.但是,当我尝试使用 /media/media-id
从特定图片中提取地理标签时,我总是在 json 响应中得到 "location": null
而没有纬度/经度对.
By default, Instagram saves geo tags for all submitted photos. You can then search by location using /media/search
. However, when I try to extract the geo tags from a specific pic using /media/media-id
, I always get "location": null
in the json response and no lat/lng pairs.
Instagram 是否简单地阻止了此功能?还有其他方法吗?
Is this functionality simply blocked by Instagram? Is there another way to do it?
推荐答案
get/media/{media-id} 端点确实会返回可用的位置信息.用户可以选择不提供它,所以不是每个图像都会有它.
The get /media/{media-id} endpoint does return location information if it is available. Users can chose not to make it available, so not every image will have it.
此示例将返回带有位置信息的图像.您需要提供自己的访问令牌:
This example will return an image with location information. You'll need to supply your own access token:
https://api.instagram.com/v1/media/432039264888987277_4513750
响应看起来像这样:
{
"meta": {
"code": 200
},
"data": {
"attribution": null,
"tags": [],
"type": "image",
"location": {
"latitude": 48.8635,
"longitude": 2.301333333
},
"comments": {
"count": 0,
"data": []
},
..........
这篇关于通过 API 从 Instagram 照片中提取 lat/lng的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!