Instagram how to get my user id from username?

前端 未结 24 1142
傲寒
傲寒 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:54

    https://api.instagram.com/v1/users/search?q="[USERNAME]"&access_token=[ACCESS TOKEN]
    

    Please notice the quotation marks.

    This does not always return a valid result but more often than non-quoted one:

    https://api.instagram.com/v1/users/search?q="self"&count=1&access_token=[ACCESS TOKEN] 
    

    returns user "self" (id: 311176867)

    https://api.instagram.com/v1/users/search?q=self&count=1&access_token=[ACCESS TOKEN]
    

    returns user "super_selfie" (id: 1422944651)

提交回复
热议问题