GetPostInfo#
Beta version
The functionality is in beta. Features may change and may also work unstably.
The method returns the data of a post.
The method uses the limits on the number of requests per second.
Request#
To get the data of a post, you have to execute a request at:
POST
{{apiUrl}}/waInstance{{idInstance}}/getPostInfo/{{apiTokenInstance}}
For apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.
Request parameters#
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
postId | string | Yes | The post identifier |
Request body example#
{
"postId": "2907515653209522683"
}
By the short code:
{
"postId": "ChZkhT4cQH7"
}
By a link:
{
"postId": "https://www.instagram.com/p/ChZkhT4cQH7/"
}
Response#
Response parameters#
| Field | Type | Description |
|---|---|---|
postId | string | The post identifier |
type | string | The type of the post. image for a photo, album for a carousel, video for a feed video, reel for a Reel |
caption | string | The caption of the post |
timestamp | integer | The time of the publication in UNIX format (in seconds) |
likeCount | integer | The number of likes |
commentCount | integer | The number of comments |
downloadUrl | string | The link to the file: the video for a feed video and a Reel, the first image for a photo and a carousel. It leads to the Instagram servers and is valid for a limited time |
urlFiles | array | The files of a carousel in the order of the post. Only for type = album. Fields of the array |
urlsCount | integer | The number of files in a carousel. Only for type = album |
postUrl | string | The permanent link to the post on the web |
commentsDisabled | boolean | The comments to the post are closed |
Fields of the urlFiles array#
| Field | Type | Description |
|---|---|---|
type | string | The type of the file: image or video |
downloadUrl | string | The link to the file. It leads to the Instagram servers and is valid for a limited time |
Response body example#
A photo:#
{
"postId": "2907515653209522683",
"type": "image",
"caption": "The caption of the post",
"timestamp": 1788407884,
"likeCount": 42,
"commentCount": 7,
"downloadUrl": "https://scontent.cdninstagram.com/v/photo.jpg",
"postUrl": "https://www.instagram.com/p/ChZkhT4cQH7/",
"commentsDisabled": false
}
A Reel:#
{
"postId": "2907515653209522684",
"type": "reel",
"caption": "The caption of the post",
"timestamp": 1788407884,
"likeCount": 42,
"commentCount": 7,
"downloadUrl": "https://scontent.cdninstagram.com/v/video.mp4",
"postUrl": "https://www.instagram.com/reel/ChZkhT4cQH8/",
"commentsDisabled": false
}
A carousel:#
{
"postId": "2907515653209522685",
"type": "album",
"caption": "The caption of the post",
"timestamp": 1788407884,
"likeCount": 42,
"commentCount": 7,
"downloadUrl": "https://scontent.cdninstagram.com/v/photo.jpg",
"urlFiles": [
{"type": "image", "downloadUrl": "https://scontent.cdninstagram.com/v/photo.jpg"},
{"type": "video", "downloadUrl": "https://scontent.cdninstagram.com/v/video.mp4"},
{"type": "image", "downloadUrl": "https://scontent.cdninstagram.com/v/photo2.jpg"}
],
"urlsCount": 3,
"postUrl": "https://www.instagram.com/p/ChZkhT4cQH9/",
"commentsDisabled": false
}
GetPostInfo 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 |
| 400 | post not found | There is no post with such an identifier in Instagram |
Request examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/getPostInfo/{{apiTokenInstance}}"
payload = {"postId": "2907515653209522683"}
headers = {'Content-Type': 'application/json'}
response = requests.post(url, json=payload, headers=headers)
print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/getPostInfo/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{"postId": "2907515653209522683"}'