Instagram Post Details API (V1)
API health status
Healthy Available Limited Mostly unavailable No data
Loading health status...
Retrieves an Instagram post by its shortcode. Use it to look up a known post before content review, archiving, comment analysis, or related workflows.
Parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
token | query | string | Yes | - | Access token for the API service. |
code | query | string | Yes | - | The unique shortcode from the Instagram post URL. |
Code Samples
bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/instagram/get-post-detail/v1?token=YOUR_API_KEY&code=VALUE'text
I want to use the "Post Details (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/instagram/get-post-detail/v1?token=YOUR_API_KEY&code=VALUE
API Endpoint: BASE_URL + /api/instagram/get-post-detail/v1?token=YOUR_API_KEY&code=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/instagram/post-details-v1-en.json
Parameters:
- token (query): Access token for the API service. (Required)
- code (query): The unique shortcode from the Instagram post URL. (Required)
Return format: safely handle JSON or text according to the actual Content-Type.
Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set the request timeout to 120 seconds. If 120 seconds is too long for your use case, use at least 60 seconds, but a small number of requests may time out before receiving a result.
3. Business Code Reference:
- 0: Success
- 100: Invalid or Inactive Token
- 301: Collection Failed. Please Retry.
- 302: Rate Limit Exceeded
- 303: Daily Quota Exceeded
- 400: Invalid Parameters
- 500: Internal Server Error
- 600: Permission Denied
- 601: Insufficient Balance
- 602: Token Budget Exceeded
4. Code 601 means the shared account balance is insufficient. Code 602 means the current API token's own cumulative budget limit has been reached. Token budget limits do not transfer funds out of the shared account balance.
Please help me write a script in my preferred programming language to call this API and handle the response.python
import requests
BASE_URL = "https://api.justoneapi.com" # Provided by OpenAPI servers
url = BASE_URL + "/api/instagram/get-post-detail/v1?token=YOUR_API_KEY&code=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
content_type = response.headers.get("content-type", "").lower()
if "json" in content_type:
try:
print(response.json())
except ValueError:
print(response.text)
elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
print(response.text)
else:
with open("response.bin", "wb") as output:
output.write(response.content)
print(f"Saved {len(response.content)} bytes to response.bin")js
const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/instagram/get-post-detail/v1?token=YOUR_API_KEY&code=VALUE";
const response = await fetch(url, {
method: "GET",
signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
const contentType = (response.headers.get("content-type") || "").toLowerCase();
const mediaType = contentType.split(";", 1)[0].trim();
const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
if (textual) {
const responseText = new TextDecoder().decode(responseBytes);
let data = responseText;
if (contentType.includes("json")) {
try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
}
console.log(data);
} else {
console.log(`Received ${responseBytes.byteLength} binary bytes`);
}
}java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
public class Main {
public static void main(String[] args) throws Exception {
final String BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
final String url = BASE_URL + "/api/instagram/get-post-detail/v1?token=YOUR_API_KEY&code=VALUE";
HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
HttpRequest.Builder builder = HttpRequest.newBuilder()
.uri(URI.create(url))
.timeout(Duration.ofSeconds(120))
.method("GET", HttpRequest.BodyPublishers.noBody());
HttpRequest request = builder.build();
HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
System.out.println(response.statusCode());
String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
String mediaType = contentType.split(";", 2)[0].trim();
if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
System.out.println(new String(response.body(), StandardCharsets.UTF_8));
} else {
Files.write(Path.of("response.bin"), response.body());
System.out.println("Saved " + response.body().length + " bytes to response.bin");
}
}
}go
package main
import (
"fmt"
"io"
"os"
"strings"
"net/http"
"time"
)
const BASE_URL = "https://api.justoneapi.com" // Provided by OpenAPI servers
func main() {
client := &http.Client{Timeout: 120 * time.Second}
url := BASE_URL + "/api/instagram/get-post-detail/v1?token=YOUR_API_KEY&code=VALUE"
req, _ := http.NewRequest("GET", url, nil)
resp, _ := client.Do(req)
defer resp.Body.Close()
fmt.Println(resp.StatusCode)
bodyBytes, _ := io.ReadAll(resp.Body)
contentType := strings.ToLower(resp.Header.Get("Content-Type"))
mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
fmt.Println(string(bodyBytes))
} else {
os.WriteFile("response.bin", bodyBytes, 0600)
fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
}
}php
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/instagram/get-post-detail/v1?token=YOUR_API_KEY&code=VALUE';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
echo $response;
} else {
file_put_contents('response.bin', $response);
echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}Response Fields
Key fields in a successful response (code = 0).
Lookup status and post identity7 fields
data
Details for an Instagram post lookup. Check status to see whether media details are available.
| Field | Type | Description |
|---|---|---|
status | boolean | Media lookup status inside data. A successful API response can contain false when media details are unavailable. |
errorMessage | string | Message returned when media details are unavailable. |
__typename | string | Media type label. Verified labels include GraphImage for images, GraphVideo for videos, and GraphSidecar for carousels. |
id | string | Instagram media identifier, returned as text. |
is_video | boolean | Whether the media item is marked as a video. |
shortcode | string | Shortcode of the requested Instagram post. |
taken_at_timestamp | integer | Publication time of the post as Unix epoch seconds. |
Images and dimensions11 fields
data
| Field | Type | Description |
|---|---|---|
display_url | string | Link to the displayed image for this media item. |
accessibility_caption | string | Text description provided for accessibility. |
dimensions | object | Dimensions reported for this media item. |
dimensions.width | integer | Width reported for the media. |
dimensions.height | integer | Height reported for the media. |
display_resources | array | Display image variants and their reported size configuration. |
display_resources[] | object | One reported display image variant. |
display_resources[].src | string | Link to the display image variant. |
display_resources[].config_width | integer | Configured width of the display resource. |
display_resources[].config_height | integer | Configured height of the display resource. |
thumbnail_src | string | Link to the thumbnail reported for the post. |
Video and playback18 fields
data
| Field | Type | Description |
|---|---|---|
video_url | string | Video link for the post, when returned. |
video_view_count | integer | View count reported for the video. |
video_play_count | integer | Play count reported for the video. |
video_duration | number | Video duration in seconds, including fractions when supplied. |
has_audio | boolean | Whether the video is marked as containing audio. |
video_dash_manifest | string | MPEG-DASH playback manifest returned as XML text, when supplied. |
video_versions | array | Video versions and their reported playback metadata. |
video_versions[] | object | One reported version of the video. |
video_versions[].id | string | Identifier reported for the video version. |
video_versions[].type | integer | Numeric type code of the video version. |
video_versions[].url | string | Link to this video version. |
video_versions[].width | integer | Width reported for the video version. |
video_versions[].height | integer | Height reported for the video version. |
video_versions[].bandwidth | integer | Bandwidth value reported for this video version. |
dash_info | object | MPEG-DASH playback data reported for the video. |
dash_info.is_dash_eligible | boolean | Whether the video is marked as eligible for MPEG-DASH playback. |
dash_info.number_of_qualities | integer | Number of qualities reported in the DASH data. |
dash_info.video_dash_manifest | string | MPEG-DASH manifest included in the video playback data as XML text. |
Carousel media19 fields
data
| Field | Type | Description |
|---|---|---|
edge_sidecar_to_children | object | Media items belonging to this carousel post, when present. |
edge_sidecar_to_children.edges | array | Child media entries included with the carousel. |
edge_sidecar_to_children.edges[] | object | One child media entry in the carousel. |
edge_sidecar_to_children.edges[].node | object | Details for one carousel child. |
edge_sidecar_to_children.edges[].node.__typename | string | Type label reported for this media item. |
edge_sidecar_to_children.edges[].node.id | string | Instagram media identifier, returned as text. |
edge_sidecar_to_children.edges[].node.display_url | string | Link to the displayed image for this media item. |
edge_sidecar_to_children.edges[].node.is_video | boolean | Whether the media item is marked as a video. |
edge_sidecar_to_children.edges[].node.accessibility_caption | string | Text description provided for accessibility. |
edge_sidecar_to_children.edges[].node.dimensions | object | Dimensions reported for this media item. |
edge_sidecar_to_children.edges[].node.dimensions.width | integer | Width reported for the media. |
edge_sidecar_to_children.edges[].node.dimensions.height | integer | Height reported for the media. |
edge_sidecar_to_children.edges[].node.display_resources | array | Display image variants and their reported size configuration. |
edge_sidecar_to_children.edges[].node.display_resources[] | object | One reported display image variant. |
edge_sidecar_to_children.edges[].node.display_resources[].src | string | Link to the display image variant. |
edge_sidecar_to_children.edges[].node.display_resources[].config_width | integer | Configured width of the display resource. |
edge_sidecar_to_children.edges[].node.display_resources[].config_height | integer | Configured height of the display resource. |
edge_sidecar_to_children.edges[].node.edge_media_to_tagged_user | object | Account tags reported for the carousel child. |
edge_sidecar_to_children.edges[].node.edge_media_to_tagged_user.edges | array | Tag entries included with this carousel child. The array can be empty. |
Publishing account and tags21 fields
data
| Field | Type | Description |
|---|---|---|
owner | object | Public profile details for the publishing account. |
owner.id | string | Instagram account identifier, returned as text. |
owner.username | string | Instagram username reported for this account. |
owner.full_name | string | Display name of the Instagram account. |
owner.is_verified | boolean | Whether the Instagram account is marked as verified. |
owner.profile_pic_url | string | Link to the reported profile image. |
owner.is_embeds_disabled | boolean | Whether the publishing account is marked as having embeds disabled. |
edge_media_to_tagged_user | object | Account tags returned for the post. |
edge_media_to_tagged_user.edges | array | Tag entries included in this media response. |
edge_media_to_tagged_user.edges[] | object | One account tag entry. |
edge_media_to_tagged_user.edges[].node | object | Account tag and placement data in this entry. |
edge_media_to_tagged_user.edges[].node.id | string | Identifier reported for the media tag. |
edge_media_to_tagged_user.edges[].node.user | object | Public profile information of the tagged account. |
edge_media_to_tagged_user.edges[].node.user.id | string | Instagram account identifier, returned as text. |
edge_media_to_tagged_user.edges[].node.user.username | string | Instagram username reported for this account. |
edge_media_to_tagged_user.edges[].node.user.full_name | string | Display name of the Instagram account. |
edge_media_to_tagged_user.edges[].node.user.is_verified | boolean | Whether the Instagram account is marked as verified. |
edge_media_to_tagged_user.edges[].node.user.profile_pic_url | string | Link to the reported profile image. |
edge_media_to_tagged_user.edges[].node.x | integer | Horizontal placement value reported for the tag. |
edge_media_to_tagged_user.edges[].node.y | integer | Vertical placement value reported for the tag. |
coauthor_producers | array | Coauthor entries reported for the post. The array can be empty. |
Caption8 fields
data
| Field | Type | Description |
|---|---|---|
edge_media_to_caption | object | Caption data returned for the post. |
edge_media_to_caption.edges | array | Caption entries included with the post. |
edge_media_to_caption.edges[] | object | One caption entry. |
edge_media_to_caption.edges[].node | object | Caption record returned for the entry. |
edge_media_to_caption.edges[].node.id | string | Caption identifier returned as text. |
edge_media_to_caption.edges[].node.created_at | string | Caption creation time as Unix epoch seconds encoded as text. |
edge_media_to_caption.edges[].node.text | string | Text of the post caption. |
caption_is_edited | boolean | Whether the caption is marked as edited. |
Comments and engagement24 fields
data
| Field | Type | Description |
|---|---|---|
edge_media_to_parent_comment | object | Reported top-level comment count and inline entries for this post. |
edge_media_to_parent_comment.count | integer | Reported count of top-level comments. A positive count can accompany an empty inline list. |
edge_media_to_parent_comment.edges | array | Top-level comment entries provided inline. The array can be empty. |
edge_media_to_parent_comment.page_info | object | Paging status of the inline comments bundle. |
edge_media_to_parent_comment.page_info.has_next_page | boolean | Whether the inline bundle indicates another page. |
edge_media_preview_comment | object | Comment preview metadata returned with this post. |
edge_media_preview_comment.count | integer | Comment count reported in the preview bundle. It can be positive with no inline comment entries. |
edge_media_preview_comment.edges | array | Comments included in the inline preview. The array can be empty. |
edge_media_to_hoisted_comment | object | Highlighted comment bundle returned for the post. |
edge_media_to_hoisted_comment.edges | array | Highlighted comment entries included with the post. The array can be empty. |
edge_media_preview_like | object | Like count and inline account preview for the post. |
edge_media_preview_like.count | integer | Reported like count in the post preview. |
edge_media_preview_like.edges | array | Like-preview account entries when supplied. The array can be empty. |
edge_media_preview_like.edges[] | object | One like-preview entry. |
edge_media_preview_like.edges[].node | object | One public account entry returned in a like preview. |
edge_media_preview_like.edges[].node.id | string | Instagram account identifier, returned as text. |
edge_media_preview_like.edges[].node.username | string | Instagram username reported for this account. |
edge_media_preview_like.edges[].node.full_name | string | Display name of the Instagram account. |
edge_media_preview_like.edges[].node.is_verified | boolean | Whether the Instagram account is marked as verified. |
edge_media_preview_like.edges[].node.profile_pic_url | string | Link to the reported profile image. |
comments_disabled | boolean | Whether comments are marked as disabled on the post. |
has_ranked_comments | boolean | Whether the post is marked as having ranked comments. |
like_and_view_counts_disabled | boolean | Whether the post is marked as hiding like and view counts. |
reshare_count | integer | Reshare count reported for the post, when supplied. |
Advertising and partnership flags3 fields
data
| Field | Type | Description |
|---|---|---|
is_affiliate | boolean | Whether the post is marked as affiliate content. |
is_paid_partnership | boolean | Whether the post is marked as a paid partnership. |
is_ad | boolean | Whether the post is marked as an advertisement. |
Response Example
Loading the response example...