The User Profile API allows your app to get an Instagram user's profile information using the user's Instagram-scoped ID received from an Instagram messaging webhook notification. Your app can use this information to create a personalized messaging experience for Instagram users who are interacting with your app users.
User consent is required to access an Instagram user's profile.
User consent is set only when an Instagram user sends a message to your app user, or clicks an icebreaker or persistent menu. If an Instagram user comments on a post or comment but has not sent a message to your app user, and your app tries to send the Instagram user a message, your app will receive an error, User consent is required to access user profile.
This guide assumes you have read the Instagram Platform Overview and implemented the needed components for using this API, such as a Meta login flow and a webhooks server to receive notifications.
You will need the following:
All endpoints can be accessed via the graph.instagram.com host.
/<IGSID><IGSID>) for the Instagram user interested in your app user; received from a webhook notificationinstagram_business_basic instagram_business_manage_messagesmessagesmessaging_optinsmessaging_postbacksmessaging_referralIn order to get profile information for an Instagram user who has messaged your app user's Instagram professional account, you need the Instagram-scoped ID for the Instagram user that was sent in a message notification, the value of the messages.sender.id property.
{
"object": "instagram",
"entry": [
{
"id": "<YOUR_APP_USERS_IG_ID>", // Your app user's Instagram Professional account ID
"time": <UNIX_TIMESTAMP>,
"messaging": [
{
"sender": { "id": "<INSTAGRAM_SCOPED_ID>" }, // Instagram-scoped ID for the Instagram user who sent the message
...
To get an the Instagram user's profile information, send a GET request to the /<INSTAGRAM_SCOPED_ID> endpoint, where <INSTAGRAM_SCOPED_ID> is the Instagram-scoped ID received in a messaging webhook notification, with the fields parameter set to a comma separated list of information you would like to view.
curl -X GET "https://graph.instagram.com/v25.0/<INSTAGRAM_SCOPED_ID> \
?fields=name,username,profile_pic,follower_count,is_user_follow_business,is_business_follow_user \
&access_token=<INSTAGRAM_ACCESS_TOKEN>"
On success, your app will receive the following JSON response:
{
"name": "Peter Chang",
"username": "peter_chang_live",
"profile_pic": "https://fbcdn-profile-...",
"follower_count": 1234
"is_user_follow_business": false,
"is_business_follow_user": true,
}
| Field Name | Description |
|---|---|
| The Instagram user access token from your app user who can manage messages on the Instagram professional account who received the webhook notification |
| The number of followers the Instagram user has |
| The Instagram-scoped ID returned in a webhook notification that represents the Instagram user who interacted with your app user's Instagram professional account and triggered the notification |
| Indicates whether your app user follows the Instagram user ( |
| Indicates whether the Instagram user follows your app user ( |
| Indicates whether the Instagram user has a verified Instagram account ( |
| The Instagram user's name (can be null if name not set) |
| The URL for the Instagram user's profile picture (can be null if profile pic not set). The URL will expire in a few days |
| The Instagram user's username |
Use this information to send a quick reply.