Instagram how to get my user id from username?

前端 未结 24 1101
傲寒
傲寒 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

    Here is how you can retrieve your user id from a username:

    $url = "https://api.instagram.com/v1/users/search?q=[username]&access_token=[your_token]";
    $obj = json_decode(@file_get_contents($url));
    echo $obj->data[0]->id;
    

提交回复
热议问题