Skip to content

Instagram Post Details API (V1) ​

GET
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 ​

NameInTypeRequiredDefaultDescription
tokenquerystringYes-Access token for the API service.
codequerystringYes-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.

FieldTypeDescription
statusbooleanMedia lookup status inside data. A successful API response can contain false when media details are unavailable.
errorMessagestringMessage returned when media details are unavailable.
__typenamestringMedia type label. Verified labels include GraphImage for images, GraphVideo for videos, and GraphSidecar for carousels.
idstringInstagram media identifier, returned as text.
is_videobooleanWhether the media item is marked as a video.
shortcodestringShortcode of the requested Instagram post.
taken_at_timestampintegerPublication time of the post as Unix epoch seconds.
Images and dimensions11 fields

data

FieldTypeDescription
display_urlstringLink to the displayed image for this media item.
accessibility_captionstringText description provided for accessibility.
dimensionsobjectDimensions reported for this media item.
dimensions.widthintegerWidth reported for the media.
dimensions.heightintegerHeight reported for the media.
display_resourcesarrayDisplay image variants and their reported size configuration.
display_resources[]objectOne reported display image variant.
display_resources[].srcstringLink to the display image variant.
display_resources[].config_widthintegerConfigured width of the display resource.
display_resources[].config_heightintegerConfigured height of the display resource.
thumbnail_srcstringLink to the thumbnail reported for the post.
Video and playback18 fields

data

FieldTypeDescription
video_urlstringVideo link for the post, when returned.
video_view_countintegerView count reported for the video.
video_play_countintegerPlay count reported for the video.
video_durationnumberVideo duration in seconds, including fractions when supplied.
has_audiobooleanWhether the video is marked as containing audio.
video_dash_manifeststringMPEG-DASH playback manifest returned as XML text, when supplied.
video_versionsarrayVideo versions and their reported playback metadata.
video_versions[]objectOne reported version of the video.
video_versions[].idstringIdentifier reported for the video version.
video_versions[].typeintegerNumeric type code of the video version.
video_versions[].urlstringLink to this video version.
video_versions[].widthintegerWidth reported for the video version.
video_versions[].heightintegerHeight reported for the video version.
video_versions[].bandwidthintegerBandwidth value reported for this video version.
dash_infoobjectMPEG-DASH playback data reported for the video.
dash_info.is_dash_eligiblebooleanWhether the video is marked as eligible for MPEG-DASH playback.
dash_info.number_of_qualitiesintegerNumber of qualities reported in the DASH data.
dash_info.video_dash_manifeststringMPEG-DASH manifest included in the video playback data as XML text.
Carousel media19 fields

data

FieldTypeDescription
edge_sidecar_to_childrenobjectMedia items belonging to this carousel post, when present.
edge_sidecar_to_children.edgesarrayChild media entries included with the carousel.
edge_sidecar_to_children.edges[]objectOne child media entry in the carousel.
edge_sidecar_to_children.edges[].nodeobjectDetails for one carousel child.
edge_sidecar_to_children.edges[].node.__typenamestringType label reported for this media item.
edge_sidecar_to_children.edges[].node.idstringInstagram media identifier, returned as text.
edge_sidecar_to_children.edges[].node.display_urlstringLink to the displayed image for this media item.
edge_sidecar_to_children.edges[].node.is_videobooleanWhether the media item is marked as a video.
edge_sidecar_to_children.edges[].node.accessibility_captionstringText description provided for accessibility.
edge_sidecar_to_children.edges[].node.dimensionsobjectDimensions reported for this media item.
edge_sidecar_to_children.edges[].node.dimensions.widthintegerWidth reported for the media.
edge_sidecar_to_children.edges[].node.dimensions.heightintegerHeight reported for the media.
edge_sidecar_to_children.edges[].node.display_resourcesarrayDisplay image variants and their reported size configuration.
edge_sidecar_to_children.edges[].node.display_resources[]objectOne reported display image variant.
edge_sidecar_to_children.edges[].node.display_resources[].srcstringLink to the display image variant.
edge_sidecar_to_children.edges[].node.display_resources[].config_widthintegerConfigured width of the display resource.
edge_sidecar_to_children.edges[].node.display_resources[].config_heightintegerConfigured height of the display resource.
edge_sidecar_to_children.edges[].node.edge_media_to_tagged_userobjectAccount tags reported for the carousel child.
edge_sidecar_to_children.edges[].node.edge_media_to_tagged_user.edgesarrayTag entries included with this carousel child. The array can be empty.
Publishing account and tags21 fields

data

FieldTypeDescription
ownerobjectPublic profile details for the publishing account.
owner.idstringInstagram account identifier, returned as text.
owner.usernamestringInstagram username reported for this account.
owner.full_namestringDisplay name of the Instagram account.
owner.is_verifiedbooleanWhether the Instagram account is marked as verified.
owner.profile_pic_urlstringLink to the reported profile image.
owner.is_embeds_disabledbooleanWhether the publishing account is marked as having embeds disabled.
edge_media_to_tagged_userobjectAccount tags returned for the post.
edge_media_to_tagged_user.edgesarrayTag entries included in this media response.
edge_media_to_tagged_user.edges[]objectOne account tag entry.
edge_media_to_tagged_user.edges[].nodeobjectAccount tag and placement data in this entry.
edge_media_to_tagged_user.edges[].node.idstringIdentifier reported for the media tag.
edge_media_to_tagged_user.edges[].node.userobjectPublic profile information of the tagged account.
edge_media_to_tagged_user.edges[].node.user.idstringInstagram account identifier, returned as text.
edge_media_to_tagged_user.edges[].node.user.usernamestringInstagram username reported for this account.
edge_media_to_tagged_user.edges[].node.user.full_namestringDisplay name of the Instagram account.
edge_media_to_tagged_user.edges[].node.user.is_verifiedbooleanWhether the Instagram account is marked as verified.
edge_media_to_tagged_user.edges[].node.user.profile_pic_urlstringLink to the reported profile image.
edge_media_to_tagged_user.edges[].node.xintegerHorizontal placement value reported for the tag.
edge_media_to_tagged_user.edges[].node.yintegerVertical placement value reported for the tag.
coauthor_producersarrayCoauthor entries reported for the post. The array can be empty.
Caption8 fields

data

FieldTypeDescription
edge_media_to_captionobjectCaption data returned for the post.
edge_media_to_caption.edgesarrayCaption entries included with the post.
edge_media_to_caption.edges[]objectOne caption entry.
edge_media_to_caption.edges[].nodeobjectCaption record returned for the entry.
edge_media_to_caption.edges[].node.idstringCaption identifier returned as text.
edge_media_to_caption.edges[].node.created_atstringCaption creation time as Unix epoch seconds encoded as text.
edge_media_to_caption.edges[].node.textstringText of the post caption.
caption_is_editedbooleanWhether the caption is marked as edited.
Comments and engagement24 fields

data

FieldTypeDescription
edge_media_to_parent_commentobjectReported top-level comment count and inline entries for this post.
edge_media_to_parent_comment.countintegerReported count of top-level comments. A positive count can accompany an empty inline list.
edge_media_to_parent_comment.edgesarrayTop-level comment entries provided inline. The array can be empty.
edge_media_to_parent_comment.page_infoobjectPaging status of the inline comments bundle.
edge_media_to_parent_comment.page_info.has_next_pagebooleanWhether the inline bundle indicates another page.
edge_media_preview_commentobjectComment preview metadata returned with this post.
edge_media_preview_comment.countintegerComment count reported in the preview bundle. It can be positive with no inline comment entries.
edge_media_preview_comment.edgesarrayComments included in the inline preview. The array can be empty.
edge_media_to_hoisted_commentobjectHighlighted comment bundle returned for the post.
edge_media_to_hoisted_comment.edgesarrayHighlighted comment entries included with the post. The array can be empty.
edge_media_preview_likeobjectLike count and inline account preview for the post.
edge_media_preview_like.countintegerReported like count in the post preview.
edge_media_preview_like.edgesarrayLike-preview account entries when supplied. The array can be empty.
edge_media_preview_like.edges[]objectOne like-preview entry.
edge_media_preview_like.edges[].nodeobjectOne public account entry returned in a like preview.
edge_media_preview_like.edges[].node.idstringInstagram account identifier, returned as text.
edge_media_preview_like.edges[].node.usernamestringInstagram username reported for this account.
edge_media_preview_like.edges[].node.full_namestringDisplay name of the Instagram account.
edge_media_preview_like.edges[].node.is_verifiedbooleanWhether the Instagram account is marked as verified.
edge_media_preview_like.edges[].node.profile_pic_urlstringLink to the reported profile image.
comments_disabledbooleanWhether comments are marked as disabled on the post.
has_ranked_commentsbooleanWhether the post is marked as having ranked comments.
like_and_view_counts_disabledbooleanWhether the post is marked as hiding like and view counts.
reshare_countintegerReshare count reported for the post, when supplied.
Advertising and partnership flags3 fields

data

FieldTypeDescription
is_affiliatebooleanWhether the post is marked as affiliate content.
is_paid_partnershipbooleanWhether the post is marked as a paid partnership.
is_adbooleanWhether the post is marked as an advertisement.

Response Example ​

Loading the response example...