【问题标题】:Get location info from a Instagram link从 Instagram 链接获取位置信息
【发布时间】:2015-09-17 17:15:24
【问题描述】:

我可以从 Instagram 链接获取信息吗,例如:https://instagram.com/p/7u46R_Ia9X/ 我发现我们可以使用 Instargram API 获取带有位置 ID 的信息,但我不知道如何从上面的链接中获取位置 ID 或位置信息。 非常感谢

更新:我们可以通过下面的答案来解决,如果您没有访问令牌,我们可以通过简单的链接接收: http://bobmckay.com/web/simple-tutorial-for-getting-an-instagram-clientid-and-access-token/

【问题讨论】:

    标签: java api instagram


    【解决方案1】:

    您首先需要获取图像的media-id 值,然后使用以下端点获取location-id 和其他相关信息。

    https://api.instagram.com/v1/media/{media-id}?access_token=ACCESS-TOKEN
    

    此端点的响应返回位置以及媒体的所有详细信息。

    在 JS 中从 instagram url 获取媒体 ID 的代码

    $.ajax({     
        type: 'GET',     
        url: 'http://api.instagram.com/oembed?callback=&url=http://instagram.com/p/Y7GF-5vftL‌​/',     
        cache: false,     
        dataType: 'jsonp',     
        success: function(data) {           
            try{              
                var media_id = data[0].media_id;          
            }catch(err){}   
        } 
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-13
      • 2023-03-08
      • 2021-11-19
      • 2013-01-03
      • 1970-01-01
      • 2018-04-10
      • 2017-10-02
      相关资源
      最近更新 更多