Instagram的API如何获得最佳的照片通过用户ID [英] Instagram api how to get best photos by user id

查看:549
本文介绍了Instagram的API如何获得最佳的照片通过用户ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那么,问题的所有诠释的称号。

Well, the question all int the title.

我肯定知道,我们可以得到最近有媒体这样的要求。

I'm sure know that we can get recent media with such request.

<一个href=\"https://api.instagram.com/v1/users/3/media/recent/?access_token=576700128.f59def8.d9c85d1ef8e84be383ca95657921c3f8\" rel=\"nofollow\">https://api.instagram.com/v1/users/3/media/recent/?access_token=576700128.f59def8.d9c85d1ef8e84be383ca95657921c3f8

可是如何才能让所有的媒体?

But how to get all of the media?

我认为这将是关键的答案,因为我们可以只得到所有照片,然后通过喜欢的数量进行排序,然后只让他们的某些部分。

I think that will be the key to the answer, because we can just get all photos, then sort them by the number of likes and then just get some portion of them.

推荐答案

您可以用两个请求,因为我认为实现这一目标。

You can achieve this with two requests as I think.

首先,你可以请求/用户/用户ID

First you can request /users/user-id

{
"data": {
    "id": "1574083",
    "username": "snoopdogg",
    "full_name": "Snoop Dogg",
    "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1574083_75sq_1295469061.jpg",
    "bio": "This is my bio",
    "website": "http://snoopdogg.com",
    "counts": {
        "media": 1320,
        "follows": 420,
        "followed_by": 3410
    }
}

正如你看到有媒体所有媒体这个用户上传,计数器

As you see there is counter of media all media uploaded by this user.

然后在/用户/用户ID /媒体/最近你可以参数COUNT为媒体计数的数量,所以你会得到所有的媒体,这个用户上传,我想。

Then in /users/user-id/media/recent you can set parameter COUNT to number of media counts, so you will get all media, uploaded by this user, I think.

我还没有尝试过,虽然

这篇关于Instagram的API如何获得最佳的照片通过用户ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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