Skip to content

Instagram General Search API (V1) ​

GET
API health status
Healthy Available Limited Mostly unavailable No data
Loading health status...

Performs a general search on Instagram by keyword with token-based pagination. Use it to discover matching results, research topics, and continue through subsequent result pages.

Parameters ​

NameInTypeRequiredDefaultDescription
tokenquerystringYes-Access token for the API service.
keywordquerystringYes-The keyword to search for on Instagram.
paginationTokenquerystringNoPagination token from the previous response. Omit it for the first page.

Code Samples ​

bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/instagram/general-search/v1?token=YOUR_API_KEY&keyword=VALUE'
text
I want to use the "General Search (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/instagram/general-search/v1?token=YOUR_API_KEY&keyword=VALUE
API Endpoint: BASE_URL + /api/instagram/general-search/v1?token=YOUR_API_KEY&keyword=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/instagram/general-search-v1-en.json

Parameters:
- token (query): Access token for the API service. (Required)
- keyword (query): The keyword to search for on Instagram. (Required)
- paginationToken (query): Pagination token from the previous response. Omit it for the first page.

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/general-search/v1?token=YOUR_API_KEY&keyword=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/general-search/v1?token=YOUR_API_KEY&keyword=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/general-search/v1?token=YOUR_API_KEY&keyword=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/general-search/v1?token=YOUR_API_KEY&keyword=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/general-search/v1?token=YOUR_API_KEY&keyword=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).

Results and continuation5 fields

data

Instagram general search results and continuation, when returned.

FieldTypeDescription
dataobjectResults returned for the current search page.
data.countintegerNumber of items reported for this search page.
data.itemsarrayMedia results returned on this search page.
data.items[]objectOne reported Instagram media result. Fields can vary by media type.
pagination_tokenstringOpaque continuation value for the search. If provided, send it as paginationToken with the same keyword to request the next page.
Media information12 fields

data.data.items[]

FieldTypeDescription
idstringIdentifier returned for the Instagram media result.
codestringShortcode returned for the Instagram post, when available.
taken_atintegerPost time as a Unix timestamp in seconds.
taken_at_datestringPost time as a date and time string.
media_typeintegerInstagram media type code for this post.
product_typestringReported Instagram product type for the media.
media_formatstringReported media format label.
is_videobooleanWhether Instagram marks the media as video.
is_pinnedbooleanWhether Instagram reports the post as pinned.
is_paid_partnershipbooleanWhether the post is marked as a paid partnership.
original_widthintegerReported width of the original media.
original_heightintegerReported height of the original media.
Engagement counts8 fields

data.data.items[]

FieldTypeDescription
like_countintegerReported like count for the post.
comment_countintegerReported comment count for the post.
share_countinteger | nullReported share count for the post, which can be null.
repost_countinteger | nullReported repost count for the post, which can be null.
play_countinteger | nullReported play count for the post, which can be null.
ig_like_countintegerInstagram-specific like count, when provided separately.
fb_like_countinteger | nullFacebook-specific like count, when reported.
fb_play_countinteger | nullFacebook-specific play count, when reported.
Captions and hashtags12 fields

data.data.items[]

FieldTypeDescription
caption_is_editedbooleanWhether the caption is marked as edited.
captionobjectCaption information returned for the post.
caption.idstringIdentifier of the caption, returned as text.
caption.textstringCaption text for the post.
caption.created_atintegerCaption creation time as a Unix timestamp in seconds.
caption.created_at_utcintegerCaption creation timestamp in UTC, in Unix seconds.
caption.content_typestringContent type label reported for the caption.
caption.text_translationstring | nullTranslated caption text, when available.
caption.hashtagsarrayHashtags found in the caption.
caption.hashtags[]stringOne hashtag from the caption.
caption.mentionsarrayAccount mentions found in the caption.
caption.mentions[]stringOne account mention from the caption.
Authors and tagged accounts37 fields

data.data.items[]

FieldTypeDescription
caption.userobjectAccount information returned with the caption.
caption.user.idstringInstagram account identifier returned as text.
caption.user.usernamestringInstagram username reported for the account.
caption.user.full_namestringDisplay name reported for the Instagram account.
caption.user.is_privatebooleanWhether Instagram marks the account as private.
caption.user.is_verifiedbooleanWhether Instagram marks the account as verified.
caption.user.profile_pic_idstringIdentifier of the Instagram profile image.
caption.user.profile_pic_urlstringProfile image URL returned for the account.
caption.user.follower_countintegerReported Instagram follower count for this account.
userobjectInstagram account information returned for the media author.
user.idstringInstagram account identifier returned as text.
user.usernamestringInstagram username reported for the account.
user.full_namestringDisplay name reported for the Instagram account.
user.is_privatebooleanWhether Instagram marks the account as private.
user.is_verifiedbooleanWhether Instagram marks the account as verified.
user.profile_pic_idstringIdentifier of the Instagram profile image.
user.profile_pic_urlstringProfile image URL returned for the account.
user.follower_countintegerReported Instagram follower count for this account.
coauthor_producersarrayPublic profile summaries for the post's reported coauthors.
coauthor_producers[]objectOne reported coauthor profile.
coauthor_producers[].idstringInstagram account identifier returned as text.
coauthor_producers[].usernamestringInstagram username reported for the account.
coauthor_producers[].full_namestringDisplay name reported for the Instagram account.
coauthor_producers[].is_privatebooleanWhether Instagram marks the account as private.
coauthor_producers[].is_verifiedbooleanWhether Instagram marks the account as verified.
coauthor_producers[].profile_pic_idstringIdentifier of the Instagram profile image.
coauthor_producers[].profile_pic_urlstringProfile image URL returned for the account.
tagged_usersarray | nullAccounts tagged in the media, when returned.
tagged_users[]objectOne account tag on the media.
tagged_users[].userobjectProfile information for the tagged account.
tagged_users[].user.idstringInstagram account identifier returned as text.
tagged_users[].user.usernamestringInstagram username reported for the account.
tagged_users[].user.full_namestringDisplay name reported for the Instagram account.
tagged_users[].user.is_privatebooleanWhether Instagram marks the account as private.
tagged_users[].user.is_verifiedbooleanWhether Instagram marks the account as verified.
tagged_users[].user.profile_pic_idstringIdentifier of the Instagram profile image.
tagged_users[].user.profile_pic_urlstringProfile image URL returned for the account.
Places and AI attribution8 fields

data.data.items[]

FieldTypeDescription
locationobject | nullPublic place tag returned for the post, when present.
location.idstringIdentifier of the place tag, returned as text.
location.namestringDisplay name of the tagged place.
location.short_namestringShort display name of the tagged place.
location.citystringCity reported for the tagged place.
ai_label_infoobject | nullAI attribution display information returned for the media.
ai_label_info.attribution_label_textstring | nullDisplayed AI attribution label, when provided.
ai_label_info.subtitle_textstringSubtitle text returned with the AI attribution label.
Image versions16 fields

data.data.items[]

FieldTypeDescription
thumbnail_urlstringThumbnail URL returned for the media.
image_versionsobjectImage versions available for this media.
image_versions.itemsarrayImage candidates returned for this media.
image_versions.items[]objectOne candidate image returned for the media.
image_versions.items[].urlstringURL returned for this image version.
image_versions.items[].widthintegerReported width of this image version.
image_versions.items[].heightintegerReported height of this image version.
image_versions.additional_itemsobject | nullAdditional named image variants for this media.
image_versions.additional_items.first_frameobjectImage version reported for the video first frame.
image_versions.additional_items.first_frame.urlstringURL returned for this image version.
image_versions.additional_items.first_frame.widthintegerReported width of this image version.
image_versions.additional_items.first_frame.heightintegerReported height of this image version.
image_versions.additional_items.igtv_first_frameobjectFirst-frame image version labeled IGTV in the response.
image_versions.additional_items.igtv_first_frame.urlstringURL returned for this image version.
image_versions.additional_items.igtv_first_frame.widthintegerReported width of this image version.
image_versions.additional_items.igtv_first_frame.heightintegerReported height of this image version.
Video and subtitles14 fields

data.data.items[]

FieldTypeDescription
has_audioboolean | nullWhether the media is reported as having audio.
video_urlstringVideo playback URL returned for the media.
video_durationnumber | nullReported video duration as a number, which can be null.
video_codecstring | nullVideo codec label returned for the media.
video_versionsarray | nullVideo versions returned for the media.
video_versions[]objectOne available video version in the result.
video_versions[].idstringIdentifier of the video version, returned as text.
video_versions[].typeintegerType code reported for this video version.
video_versions[].urlstringURL returned for this video version.
video_versions[].widthintegerReported width of this video version.
video_versions[].heightintegerReported height of this video version.
video_subtitles_enabledboolean | nullWhether subtitles are reported as enabled for this video.
video_subtitles_localestring | nullLocale reported for the video's subtitles.
video_subtitles_uristring | nullSubtitle URI returned for this video, when provided.
Carousel media16 fields

data.data.items[]

FieldTypeDescription
carousel_media_countinteger | nullReported number of media entries in the carousel.
carousel_mediaarray | nullMedia entries returned for a carousel post.
carousel_media[]objectOne media entry in the carousel.
carousel_media[].idstringIdentifier of the carousel media entry, returned as text.
carousel_media[].carousel_parent_idstringParent carousel identifier reported for the entry.
carousel_media[].media_typeintegerReported media type code of the carousel entry.
carousel_media[].is_videobooleanWhether Instagram marks the carousel entry as video.
carousel_media[].original_widthintegerReported original width of the carousel entry.
carousel_media[].original_heightintegerReported original height of the carousel entry.
carousel_media[].thumbnail_urlstringThumbnail URL returned for the carousel entry.
carousel_media[].image_versionsobjectImage versions returned for the carousel entry.
carousel_media[].image_versions.itemsarrayImage candidates returned for the carousel entry.
carousel_media[].image_versions.items[]objectOne image candidate for this carousel entry.
carousel_media[].image_versions.items[].urlstringURL returned for this image version.
carousel_media[].image_versions.items[].widthintegerReported width of this image version.
carousel_media[].image_versions.items[].heightintegerReported height of this image version.
Original audio18 fields

data.data.items[].clips_metadata

Clip metadata returned with some media results.

FieldTypeDescription
audio_typestringAudio type label reported for this clip.
audio_canonical_idstringAudio identifier returned in the clip information.
original_sound_infoobject | nullOriginal audio information returned for the clip.
original_sound_info.audio_idstringIdentifier of the original audio, returned as text.
original_sound_info.original_audio_titlestringDisplay title of the original audio.
original_sound_info.original_media_idstringIdentifier of the original media reported with this audio.
original_sound_info.duration_in_msintegerOriginal audio duration in milliseconds.
original_sound_info.is_explicitbooleanWhether the original audio has an explicit-content label.
original_sound_info.time_createdintegerOriginal audio creation time as a Unix timestamp in seconds.
original_sound_info.progressive_download_urlstringAudio media URL returned for the original sound.
original_sound_info.ig_artistobjectInstagram artist profile returned for the original audio.
original_sound_info.ig_artist.idstringInstagram account identifier returned as text.
original_sound_info.ig_artist.usernamestringInstagram username reported for the account.
original_sound_info.ig_artist.full_namestringDisplay name reported for the Instagram account.
original_sound_info.ig_artist.is_privatebooleanWhether Instagram marks the account as private.
original_sound_info.ig_artist.is_verifiedbooleanWhether Instagram marks the account as verified.
original_sound_info.ig_artist.profile_pic_idstringIdentifier of the Instagram profile image.
original_sound_info.ig_artist.profile_pic_urlstringProfile image URL returned for the account.
Catalog music29 fields

data.data.items[].clips_metadata

FieldTypeDescription
music_infoobject | nullCatalog music information returned for the clip.
music_info.music_asset_infoobjectReported catalog music asset information.
music_info.music_asset_info.idstringIdentifier of the catalog music asset.
music_info.music_asset_info.audio_idstringAudio identifier for the catalog music asset.
music_info.music_asset_info.artist_idstring | nullArtist identifier for the catalog music, when provided.
music_info.music_asset_info.titlestringTitle reported for the catalog music.
music_info.music_asset_info.subtitlestringSubtitle returned with the catalog music information.
music_info.music_asset_info.display_artiststringDisplay name of the catalog music artist.
music_info.music_asset_info.ig_usernamestring | nullInstagram username reported for the music artist.
music_info.music_asset_info.duration_in_msintegerCatalog music asset duration in milliseconds.
music_info.music_asset_info.has_lyricsbooleanWhether lyrics are reported for this music asset.
music_info.music_asset_info.is_explicitbooleanWhether the catalog music has an explicit-content label.
music_info.music_asset_info.cover_artwork_uristringCover artwork URI for the catalog music.
music_info.music_asset_info.cover_artwork_thumbnail_uristringCover artwork thumbnail URI for the catalog music.
music_info.music_asset_info.progressive_download_urlstringAudio media URL returned for the catalog music.
music_info.music_asset_info.fast_start_progressive_download_urlstringAudio URL reported for fast-start playback of the catalog music.
music_info.music_asset_info.highlight_start_times_in_msarrayHighlight start offsets returned for the music asset.
music_info.music_asset_info.highlight_start_times_in_ms[]integerOne highlight start offset in milliseconds.
music_info.music_consumption_infoobjectDetails about the portion of catalog music used in the clip.
music_info.music_consumption_info.audio_asset_start_time_in_msinteger | nullStart offset in the music asset, in milliseconds.
music_info.music_consumption_info.overlap_duration_in_msinteger | nullReported duration of music overlap with the clip, in milliseconds.
music_info.music_consumption_info.ig_artistobject | nullInstagram artist profile returned with the catalog music use.
music_info.music_consumption_info.ig_artist.idstringInstagram account identifier returned as text.
music_info.music_consumption_info.ig_artist.usernamestringInstagram username reported for the account.
music_info.music_consumption_info.ig_artist.full_namestringDisplay name reported for the Instagram account.
music_info.music_consumption_info.ig_artist.is_privatebooleanWhether Instagram marks the account as private.
music_info.music_consumption_info.ig_artist.is_verifiedbooleanWhether Instagram marks the account as verified.
music_info.music_consumption_info.ig_artist.profile_pic_idstringIdentifier of the Instagram profile image.
music_info.music_consumption_info.ig_artist.profile_pic_urlstringProfile image URL returned for the account.

Response Example ​

Loading the response example...