This guide has been updated: Instagram now requires an access token to fetch user data. This guide covers how to authenticate and retrieve user details using the Instagram Graph API.
Get-Instagram-Details (Updated)
Instagram has deprecated its public API, and now you need an Instagram Access Token to fetch user data. To retrieve details like username, profile picture, bio, and follower count, you must authenticate your app and get the appropriate permissions using the Instagram Graph API.
Steps to Get Instagram Details
Set up your Instagram Developer account:
- Go to the Instagram for Developers page.
- Create an app and get the App ID and App Secret.
Get User Access Token:
- After setting up the app, use OAuth to authenticate users and retrieve the access token. You’ll need the user_profile and user_media permissions to access user details.
- You can refer to Facebook’s OAuth documentation for details on the authentication flow.
Make API requests:
- Once authenticated, you can use the following endpoint to get the user’s data:
https://graph.instagram.com/me?fields=id,username,media_count,account_type&access_token={access-token}
Here’s an example of how you can use fetch to get the data:
|
|
Important Notes:
The new Instagram API only supports user data that you have permission to access (your account or authenticated users).
You can also fetch media-related data such as recent posts using the media endpoints:
https://graph.instagram.com/me/media?fields=id,caption,media_url&access_token={access-token}
Demo URL (Deprecated)
The demo that previously used the public GraphQL API no longer works, as Instagram now requires OAuth authentication and access tokens. You can check the Instagram API documentation for more details on building your app.
If you are still reading this, 👍 thank you so very much for your time ⌛.
✋ If you are getting any errors, you can create an issue on this repo with proper details.
If it is helpful and saves your valuable Time ⏱ please show your support 👇.
Buy me A Coffee, Thank you and canva ( For Beautiful designs ). Thanks for the reading 👍.