On September 4, 2024, we announced the deprecation of the Instagram Basic Display API.
Starting December 4, 2024, all requests to the Instagram Basic Display API will return an error message. We recommend that you migrate your app to the Instagram API to avoid any disruption to your services.
This guide explains how to get an Instagram user’s profile and media.
Perform the following steps to get an Instagram user’s profile data (fields) on the User.
Follow our Get Access Tokens and Permissions guide to get the user’s Instagram User Access Token. You will need the instagram_graph_user_profile
permission, so request the user_profile
scope when you get authorization from the user.
Send a request to the following endpoint:
GET /me?fields={fields}&access_token={access-token}
Replace {fields}
with a comma-separated list of User fields you want returned and {access-token}
with the user’s access token. The GET /me
endpoint will determine the user’s ID from the token and redirect the request to the User node.
curl -X GET \ 'https://graph.instagram.com/me?fields=id,username&access_token=IGQVJ...'
{ "id": "17841405793187218", "username": "jayposiris" }
Perform the following steps to get a collection of Media on an Instagram User.
Follow our Get Access Tokens and Permissions guide to get the user’s Instagram User Access Token. You will need the instagram_graph_user_profile
and instagram_graph_user_media
permissions, so request the user_profile
and user_media
scopes when you get authorization from the user.
Send a request to the following endpoint:
GET /me/media?fields={fields}&access_token={access-token}
Replace {fields}
with a comma-separated list of Media fields you want returned for each Media included in the response (or omit the fields
parameter entirely if you just want IDs), and {access-token}
with the user’s access token. The GET /me
endpoint will determine the user’s ID from the token and redirect the request to the User node.
curl -X GET \ 'https://graph.instagram.com/me/media?fields=id,caption&access_token=IGQVJ...'
{ "data": [ { "id": "17895695668004550", "caption": "" }, { "id": "17899305451014820", "caption": "" }, { "id": "17896450804038745", "caption": "" }, { "id": "17881042411086627", "caption": "" } ], "paging": { "cursors": { "after": "MTAxN...", "before": "NDMyN..." }, "next": "https://graph.faceb..." } }
Perform the following steps to get data (fields) on an image, video, or album.
Follow our Get Access Tokens and Permissions guide to get the user’s Instagram User Access Token. You will need the instagram_graph_user_media
permission, so request the user_media
scopes when you get authorization from the user.
Send a request to the following endpoint:
GET /{media-id}?fields={fields}&access_token={access-token}
Replace {media-id}
with the ID of the image, video, or album you want to query, {fields}
with a comma-separated list of Media fields you want returned, and {access-token}
with the user’s access token.
curl -X GET \ 'https://graph.instagram.com/17895695668004550?fields=id,media_type,media_url,username,timestamp&access_token=IGQVJ...'
{ "id": "17895695668004550", "media_type": "IMAGE", "media_url": "https://fb-s-b-a.akamaihd.net/...", "username": "jayposiris" "timestamp": "2017-08-31T18:10:00+0000" }
You can query the User Media edge to get a collection of Media on the User and use field expansion to have the response include Media fields on each Media in the collection. To do this, send a request to the following endpoint:
GET /me/media?fields={fields}&access_token={access-token}
Replace {fields}
with a comma-separated list of Media fields you want returned for each Media in the collection, and {access-token}
with the user’s access token. The GET /me
endpoint will determine the user’s ID from the token and redirect the request to the User node.
curl -X GET \ 'https://graph.instagram.com/me/media?fields=id,caption&access_token=IGQVJ...'
{ "data": [ { "id": "17895695668004550", "caption": "" }, { "id": "17899305451014820", "caption": "" }, { "id": "17896450804038745", "caption": "" }, { "id": "17881042411086627", "caption": "" } ], "paging": { "cursors": { "after": "MTAxN...", "before": "NDMyN..." }, "next": "https://graph.faceb..." } }
Perform the following steps to get a collection of image and video Media on an album Media.
Follow our Get Access Tokens and Permissions guide to get the user’s Instagram User Access Token. You will need the instagram_graph_user_media
permission, so request the user_media
scopes when you get authorization from the user.
Send a request to the following endpoint:
GET /{media-id}/children?fields={fields}&access_token={access-token}
Replace {media-id}
with the ID of the album you want to query, {fields}
with a comma-separated list of Media fields you want returned for each image and video Media in the collection (or omit the fields
parameter entirely if you just want their IDs), and {access-token}
with the user’s access token.
curl -X GET \ 'https://graph.instagram.com/17896450804038745/children?access_token=IGQVJ...'
{ "data": [ { "id": "17880997618081620" }, { "id": "17871527143187462" } ], "paging": { "cursors": { "after": "MTAxN...", "before": "NDMyN..." }, "previous": "https://graph.faceb...", "next": "https://graph.faceb..." } }