Skip to content

GetContactInfo#

Beta version

The functionality is in beta. Features may change and may also work unstably.

The method returns the data of an Instagram profile.

The method uses the limits on the number of requests per second.

Request#

To get the data of a contact, you have to execute a request at:

POST
{{apiUrl}}/waInstance{{idInstance}}/getContactInfo/{{apiTokenInstance}}

For apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.

Request parameters#

Parameter Type Mandatory Description
chatId string Yes The numeric account identifier or a username with the @ prefix

Request body example#

{
    "chatId": "49547665464"
}

By username:

{
    "chatId": "@green_api"
}

Response#

Response parameters#

Field Type Description
name string The name from the Instagram profile. If the profile has no name - the username without @
username string The username with the @ prefix
avatar string The link to the avatar. An empty string means there is no avatar
chatId string The numeric identifier of the account
chatType string The type of the chat: user - an account, bot - the Meta AI bot
description string The profile description (bio). An empty string means there is no description
isVerified boolean A verified account
isPrivate boolean A private account
followersCount integer The number of followers
followingCount integer The number of following
postsCount integer The number of posts

Response body example#

{
    "name": "GREEN-API",
    "username": "@green_api",
    "avatar": "https://instagram.ftse3-2.fna.fbcdn.net/v/t51.2885-19/495386024_18031684346649465_5390906708136372152_n.jpg?efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby41MDAuYzIifQ&_nc_ht=instagram.ftse3-2.fna.fbcdn.net&_nc_cat=109&_nc_oc=Q6cZ2gFYb76TFMAltxyIuECYSkeKF15EWC0Ewtgt_FxzjEto8qeTbbYkzC4i5Mr2sPRmxCw&_nc_ohc=JEfpfr8uH-EQ7kNvwFa8Qqc&_nc_gid=A4BiW9omBwmCnTODEk03_g&edm=APs17CUBAAAA&ccb=7-5&ig_cache_key=GKj9hh15Gy_suA9AALgnvbsWWdBKbvEnAQAB0j-ccb7-5&oh=00_AQKIjxJWaZU_pmN8R0orM_ejwdU76mlR8XrQ08loqbKeGg&oe=6AB7F464&_nc_sid=10d13b",
    "chatId": "49547665464",
    "chatType": "user",
    "description": "An IT company developing the Instagram API gateway for sending messages and building bots in PHP, NodeJs, JavaScript, Python and 1C.",
    "isVerified": false,
    "isPrivate": false,
    "followersCount": 143,
    "followingCount": 5,
    "postsCount": 128
}

GetContactInfo errors#

For a list of errors common to all methods, refer to the Common errors section

HTTP code Error ID Description
400 Bad Request
Validation failed
Validation error

Request examples#

import requests

url = "{{apiUrl}}/waInstance{{idInstance}}/getContactInfo/{{apiTokenInstance}}"

payload = {"chatId": "@green_api"}
headers = {'Content-Type': 'application/json'}

response = requests.post(url, json=payload, headers=headers)

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/getContactInfo/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{"chatId": "@green_api"}'