user1685095
user1685095

Reputation: 6121

Instagram api how to get best photos by user id

Well, the question all int the title.

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

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.

Upvotes: 2

Views: 1422

Answers (1)

user1685095
user1685095

Reputation: 6121

You can achieve this with two requests as I think.

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.

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.

I haven't tried it, although.

Upvotes: 2

Related Questions