instagram - 在哪里可以找到图片的 Instagram 媒体 ID

标签 instagram instagram-api

我正在寻找已上传的 Instagram 图像的 MediaID。它应该看起来像

1234567894561231236_33215652



我发现最后一组整数是 usersID
例如:这是直接指向图像的链接,但是我没有看到格式正确的 mediaID
http://distilleryimage11.ak.instagram.com/d33aafc8b55d11e2a66b22000a9f09de_7.jpg

虽然这是链接
http://instagram.com/p/Y7GF-5vftL/

我不希望使用 API,因为我只需要来自选定图像的 MediaID。

最佳答案

这是一个更好的方法:

http://api.instagram.com/oembed?url=http://instagram.com/p/Y7GF-5vftL/

渲染为 json 对象,您可以轻松地从中提取媒体 ID ---

例如,在 PHP
$api = file_get_contents("http://api.instagram.com/oembed?url=http://instagram.com/p/Y7‌​GF-5vftL/");      
$apiObj = json_decode($api,true);      
$media_id = $apiObj['media_id'];

例如,在 JS
$.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){}   
    } 
});

关于instagram - 在哪里可以找到图片的 Instagram 媒体 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16758316/

相关文章:

facebook-graph-api - OAuthException error_message : "Invalid scope: []" What am I doing wrong?

javascript - 如何在 Instagram 上找到当天最受欢迎的图片?

android - 在 Instagram 中分享照片

facebook - 为什么 Instagram Graph API webhook 不起作用

instagram - Instagram通过分页接收相同的图像

instagram - 新的 Instagram Graph API 是否包含媒体项目的位置元素?

instagram - 如何获得给定媒体 ID 的所有喜欢

api - 现在有没有办法在不使用访问 token 的情况下获取 instagram 提要(06/2016)?

ios - 如何在 Swift3 中打开带参数的 URL

instagram-api - Instagram API 按标签搜索,空白返回