通过API从Instagram照片中提取经纬度 [英] Extract lat/lng from an Instagram photo via API

查看:94
本文介绍了通过API从Instagram照片中提取经纬度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,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照片中提取经纬度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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