How to get Self Instagram User ID

In previous tutorial I have explained how to Get Instagram Access Token Using Client-Side Authentication. Now In this tutorial I will show you how to get self Instagram user ID.

Get self Instagram User ID:

Click Here to receive Instagram Access Token. Now using this token, you can get self basic details like username, profile pic, bio, etc by following URL:

I have created a function getSelfInstaID() to get self instagram user id using access token.

function getSelfInstaID(){
    $token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; 
    $url = "".$token;
    $get = file_get_contents($url);
    $user = json_decode($get);

        return $user->data->id;

    return '00000000'; // return this if nothing is found

Hope this tutorial will help you to get self instagram user id.