Skip to content

Get Instagram Profile ​

GEThttps://api.repliz.com/public/addon/instagram/profile

Gets the profile of an Instagram user who has messaged a connected Instagram account, including whether they follow the account. Use it to check that someone follows before replying, for example to send a link only to followers. Pass the senderId of the chat from Get Chat or the chat webhook event.

Endpoint Details ​

  • Authentication: Basic Auth (Authorization: Basic Base64(AccessKey:SecretKey)) or Bearer token from Login with Repliz
  • Scope (Bearer only): addon:read (or addon:write)
  • Access Tier: Premium+

Parameters ​

ParameterTypeRequiredDescription
accountIdstringYesID of a connected Instagram account, the _id from Get Account.
senderIdstringYesInstagram-scoped ID of the user, the senderId from Get Chat, for example 6793729447315239. A username is not accepted.

Example Request ​

bash
curl -X GET "https://api.repliz.com/public/addon/instagram/profile?accountId=680affa5ce12f2f72916f67e&senderId=6793729447315239" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)"
javascript
import axios from "axios";

const response = await axios.get("https://api.repliz.com/public/addon/instagram/profile", {
  params: {
    accountId: "680affa5ce12f2f72916f67e",
    senderId: "6793729447315239",
  },
  auth: {
    username: "YOUR_ACCESS_KEY",
    password: "YOUR_SECRET_KEY",
  },
});

console.log(response.data);
javascript
const credentials = btoa("YOUR_ACCESS_KEY:YOUR_SECRET_KEY");

const response = await fetch("https://api.repliz.com/public/addon/instagram/profile?accountId=680affa5ce12f2f72916f67e&senderId=6793729447315239", {
  headers: {
    Authorization: `Basic ${credentials}`,
  },
});

const data = await response.json();
console.log(data);

Response ​

json
{
  "id": "6793729447315239",
  "name": "Repliz",
  "username": "repliz.id",
  "picture": "https://scontent.cdninstagram.com/v/t51.2885-19/123456789_n.jpg",
  "followerCount": 1200,
  "isFollower": true,
  "isFollowing": false
}
json
{
  "code": 400,
  "message": "invalid account type"
}
json
{
  "code": 404,
  "message": "account not found"
}
json
{
  "code": 401,
  "message": "unauthorized"
}
FieldDescription
idInstagram-scoped ID of the user, the senderId you sent.
nameName on the user's profile. Empty when they have none.
usernameInstagram username, without @.
pictureURL of the profile picture. Empty when there is none.
followerCountNumber of followers of the user.
isFollowertrue when the user follows the account.
isFollowingtrue when the account follows the user.

Instagram only returns the profile of a user who has sent a message to the account, so a senderId from a chat always works. Anyone else, or an ID that doesn't exist, fails with the status and message from Instagram, never with an empty profile. Every call reads Instagram directly, so isFollower is the follow status at that moment. 400 with invalid account type means accountId is not an Instagram account.