Instagram how to get my user id from username?

前端 未结 24 1059
傲寒
傲寒 2020-11-30 17:14

I\'m in the process of embedding my image feed in my website using JSON, the URL needs my user id so I can retrieve this feed.

So, where can I find/get my user id?

24条回答
  •  醉梦人生
    2020-11-30 17:35

    This can be done through apigee.com Instagram API access here on Instagram's developer site. After loging in, click on the "/users/search" API call. From there you can search any username and retrieve its id.

    {
    "data": [{
        "username": "jack",
        "first_name": "Jack",
        "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_66_75sq.jpg",
        "id": "66",
        "last_name": "Dorsey"
    },
    {
        "username": "sammyjack",
        "first_name": "Sammy",
        "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_29648_75sq_1294520029.jpg",
        "id": "29648",
        "last_name": "Jack"
    },
    {
        "username": "jacktiddy",
        "first_name": "Jack",
        "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_13096_75sq_1286441317.jpg",
        "id": "13096",
        "last_name": "Tiddy"
    }]}
    


    If you already have an access code, it can also be done like this: https://api.instagram.com/v1/users/search?q=USERNAME&access_token=ACCESS_TOKEN

提交回复
热议问题