Instagram Basic Display API Guide: Fetch Instagram User Info

Mark Ponomarev

Mark Ponomarev

11 April 2025

Instagram Basic Display API Guide: Fetch Instagram User Info

Instagram, with its visually-driven platform, has become a powerful tool for businesses, developers, and creators. To enhance the user experience and facilitate seamless integration, Instagram provides two essential tools: Instagram Graph API and Instagram Basic Display API. In this article, we'll focus on the capabilities of Instagram Basic Display API and how it can be leveraged to optimize your Instagram presence.

šŸ’”
Apidog is an All-in-one API development platform which allows you to easily design, test, and document your API. For the one who wants to test Instagram API, using Apidog is always the easiest solution.
button

Instagram Basic Display API

The Instagram Basic Display API is a tool provided by Instagram (a subsidiary of Facebook) that allows developers to access basic user information, media content, and other data from Instagram accounts. This API is specifically designed for scenarios where read-only access to user data is required, making it suitable for applications that focus on displaying Instagram content or providing personalized experiences.

Set up before accessing to API

Requirements:

1. A Facebook developer account.

2. A tester Instagram account.

3. A web page (URL) for redirect, to grant permission for the application to access Instagram.

Steps for setup:

  1. In developer page, click on Create App. Select Other to proceed.
create app facebook

2. choose customer as app type for Instagram basic display API

choose app type

Next, fill in your information (App name, contact email) and proceed

3. Set platform URL. Go to setting > basic, click on add platform at the bottom and enter your URL (The web page mentioned in requirement).

edit basic info
update website url

4. Set up Instagram Basic API on dashboard

set up instagram basic api

After the app is created, a form will appear with some things to be saved and to be filled in.

check api info

App ID and secret will be needed later.

5. Enter the same URL as before in Valid OAuth redirect URI, Deauthorization callback URL and data deletion request since this app is for testing purpose.

client oauth uri

Add tester into the form, for example, if Alice want to retrieve Bob’s information, then enter Bob account username.

add app roles

After adding a user, the status of the user will be pending since authorization from user is needed. It is recommend to use the tester account.

6. Login to your tester Instagram account, go to settings> website permission> Apps and Websites> Tester Invites. Accept the test invitation.

login to tester instagram account

Basic set up is complete!

How to request for authorization?

Authorization code is needed before using API, the survival time of this authorization code is 1 hour. To obtain the code, enter the URL in this form:

https://api.instagram.com/oauth/authorize?client_id={app-id}&redirect_uri={redirect-uri}
&scope=user_profile,user_media
&response_type=code

Explanation for the attributes:

ā€ƒApp-id: The application id is the app-id, this can be found in basic display under Instagram basic display app.

ā€ƒredirect_uri: the same URL as valid OAuth redirect URI.

redirect uri

Remember not to leave space for the whole URL.

After click on enter, it will go to the page for allowing authorization.

allow auth

After allowing all access, it will redirect to the your own url, with code parameter attached to url, looks like

https://www.example.com/?code=ABCD......#_

The authorization code is the one after code=, remember to delete the #_ since this is not the part of authorization code.

How to use Apidog to use exchange the code to access token?

Apidog is an All-in-one API development platform which allows you to easily design, test, and document your API. For the one who wants to test Instagram API, using Apidog is always the easiest solution.

button

Convert the authorization code to access token

Switch method to POST, input URL:

https://api.instagram.com/oauth/access_token

Added these parameters that is needed:

Set up with Apidog

Click on send, the access token will be returned in form of JSON file, looks like:

{
"access_token": "IGQWR9......",
"user_id": 7666070400110123
}

Note: the token is also valid for 1 hour

How to use access token and user ID to query account information?

There are brunch of features can be fetch using Instagram Display Basic API, here below are two examples of information retreiving.

  1. access an account's basic information

Sample request using curl:

curl -X GET \  'https://graph.instagram.com/{user-id}?fields=id,username&access_token={access-token}'

Parameters explanation: Ā 

1. Account_type: account type 
2. Id: user_id 
3. Media_count: number of posts
4. Username: account name

If you want to get all of these four, enter all of them separate by comma (,)

Set up in Apidog

The return result:

2. Retrieve user’s post information

Sample request:

curl -X GET \ 
'https://graph.instagram.com/me/media?fields=id,caption&access_token=IGQVJ...'

Set up in Apidog:

For more features with Instagram display API, refer to:

Get Profiles and Media - Instagram Platform - Documentation - Meta for Developers

Conclusion

In conclusion, the Instagram API opens up a world of possibilities for developers to interact with the Instagram platform and create innovative applications. From accessing user information and media content to posting new photos and videos, the diverse range of endpoints allows developers to tailor their applications to specific needs.

Explore more

Apidog SEO Settings Explained: Maximize Your API Docs Visibility

Apidog SEO Settings Explained: Maximize Your API Docs Visibility

Discover how to supercharge your API documentation's visibility with Apidog's powerful SEO features. This comprehensive guide covers everything from page-level optimizations like custom URLs and meta tags to site-wide settings such as sitemaps and robots.txt.

18 June 2025

How to Protect API Specification from Unauthorized Users with Apidog

How to Protect API Specification from Unauthorized Users with Apidog

Learn how Apidog empowers you to protect API specification from unauthorized users. Explore advanced API documentation security, access controls, and sharing options for secure API development.

17 June 2025

How to Use the PostHog MCP Server?

How to Use the PostHog MCP Server?

Discover how to use the PostHog MCP server with this in-depth technical guide. Learn to install, configure, and optimize the server for seamless PostHog analytics integration using natural language. Includes practical use cases and troubleshooting.

16 June 2025

Practice API Design-first in Apidog

Discover an easier way to build and use APIs