Instagram General Search API (V1)
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
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
token | query | string | Yes | - | Access token for the API service. |
keyword | query | string | Yes | - | The keyword to search for on Instagram. |
paginationToken | query | string | No | | Pagination 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.
| Field | Type | Description |
|---|---|---|
data | object | Results returned for the current search page. |
data.count | integer | Number of items reported for this search page. |
data.items | array | Media results returned on this search page. |
data.items[] | object | One reported Instagram media result. Fields can vary by media type. |
pagination_token | string | Opaque 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[]
| Field | Type | Description |
|---|---|---|
id | string | Identifier returned for the Instagram media result. |
code | string | Shortcode returned for the Instagram post, when available. |
taken_at | integer | Post time as a Unix timestamp in seconds. |
taken_at_date | string | Post time as a date and time string. |
media_type | integer | Instagram media type code for this post. |
product_type | string | Reported Instagram product type for the media. |
media_format | string | Reported media format label. |
is_video | boolean | Whether Instagram marks the media as video. |
is_pinned | boolean | Whether Instagram reports the post as pinned. |
is_paid_partnership | boolean | Whether the post is marked as a paid partnership. |
original_width | integer | Reported width of the original media. |
original_height | integer | Reported height of the original media. |
Engagement counts8 fields
data.data.items[]
| Field | Type | Description |
|---|---|---|
like_count | integer | Reported like count for the post. |
comment_count | integer | Reported comment count for the post. |
share_count | integer | null | Reported share count for the post, which can be null. |
repost_count | integer | null | Reported repost count for the post, which can be null. |
play_count | integer | null | Reported play count for the post, which can be null. |
ig_like_count | integer | Instagram-specific like count, when provided separately. |
fb_like_count | integer | null | Facebook-specific like count, when reported. |
fb_play_count | integer | null | Facebook-specific play count, when reported. |
Captions and hashtags12 fields
data.data.items[]
| Field | Type | Description |
|---|---|---|
caption_is_edited | boolean | Whether the caption is marked as edited. |
caption | object | Caption information returned for the post. |
caption.id | string | Identifier of the caption, returned as text. |
caption.text | string | Caption text for the post. |
caption.created_at | integer | Caption creation time as a Unix timestamp in seconds. |
caption.created_at_utc | integer | Caption creation timestamp in UTC, in Unix seconds. |
caption.content_type | string | Content type label reported for the caption. |
caption.text_translation | string | null | Translated caption text, when available. |
caption.hashtags | array | Hashtags found in the caption. |
caption.hashtags[] | string | One hashtag from the caption. |
caption.mentions | array | Account mentions found in the caption. |
caption.mentions[] | string | One account mention from the caption. |
Authors and tagged accounts37 fields
data.data.items[]
| Field | Type | Description |
|---|---|---|
caption.user | object | Account information returned with the caption. |
caption.user.id | string | Instagram account identifier returned as text. |
caption.user.username | string | Instagram username reported for the account. |
caption.user.full_name | string | Display name reported for the Instagram account. |
caption.user.is_private | boolean | Whether Instagram marks the account as private. |
caption.user.is_verified | boolean | Whether Instagram marks the account as verified. |
caption.user.profile_pic_id | string | Identifier of the Instagram profile image. |
caption.user.profile_pic_url | string | Profile image URL returned for the account. |
caption.user.follower_count | integer | Reported Instagram follower count for this account. |
user | object | Instagram account information returned for the media author. |
user.id | string | Instagram account identifier returned as text. |
user.username | string | Instagram username reported for the account. |
user.full_name | string | Display name reported for the Instagram account. |
user.is_private | boolean | Whether Instagram marks the account as private. |
user.is_verified | boolean | Whether Instagram marks the account as verified. |
user.profile_pic_id | string | Identifier of the Instagram profile image. |
user.profile_pic_url | string | Profile image URL returned for the account. |
user.follower_count | integer | Reported Instagram follower count for this account. |
coauthor_producers | array | Public profile summaries for the post's reported coauthors. |
coauthor_producers[] | object | One reported coauthor profile. |
coauthor_producers[].id | string | Instagram account identifier returned as text. |
coauthor_producers[].username | string | Instagram username reported for the account. |
coauthor_producers[].full_name | string | Display name reported for the Instagram account. |
coauthor_producers[].is_private | boolean | Whether Instagram marks the account as private. |
coauthor_producers[].is_verified | boolean | Whether Instagram marks the account as verified. |
coauthor_producers[].profile_pic_id | string | Identifier of the Instagram profile image. |
coauthor_producers[].profile_pic_url | string | Profile image URL returned for the account. |
tagged_users | array | null | Accounts tagged in the media, when returned. |
tagged_users[] | object | One account tag on the media. |
tagged_users[].user | object | Profile information for the tagged account. |
tagged_users[].user.id | string | Instagram account identifier returned as text. |
tagged_users[].user.username | string | Instagram username reported for the account. |
tagged_users[].user.full_name | string | Display name reported for the Instagram account. |
tagged_users[].user.is_private | boolean | Whether Instagram marks the account as private. |
tagged_users[].user.is_verified | boolean | Whether Instagram marks the account as verified. |
tagged_users[].user.profile_pic_id | string | Identifier of the Instagram profile image. |
tagged_users[].user.profile_pic_url | string | Profile image URL returned for the account. |
Places and AI attribution8 fields
data.data.items[]
| Field | Type | Description |
|---|---|---|
location | object | null | Public place tag returned for the post, when present. |
location.id | string | Identifier of the place tag, returned as text. |
location.name | string | Display name of the tagged place. |
location.short_name | string | Short display name of the tagged place. |
location.city | string | City reported for the tagged place. |
ai_label_info | object | null | AI attribution display information returned for the media. |
ai_label_info.attribution_label_text | string | null | Displayed AI attribution label, when provided. |
ai_label_info.subtitle_text | string | Subtitle text returned with the AI attribution label. |
Image versions16 fields
data.data.items[]
| Field | Type | Description |
|---|---|---|
thumbnail_url | string | Thumbnail URL returned for the media. |
image_versions | object | Image versions available for this media. |
image_versions.items | array | Image candidates returned for this media. |
image_versions.items[] | object | One candidate image returned for the media. |
image_versions.items[].url | string | URL returned for this image version. |
image_versions.items[].width | integer | Reported width of this image version. |
image_versions.items[].height | integer | Reported height of this image version. |
image_versions.additional_items | object | null | Additional named image variants for this media. |
image_versions.additional_items.first_frame | object | Image version reported for the video first frame. |
image_versions.additional_items.first_frame.url | string | URL returned for this image version. |
image_versions.additional_items.first_frame.width | integer | Reported width of this image version. |
image_versions.additional_items.first_frame.height | integer | Reported height of this image version. |
image_versions.additional_items.igtv_first_frame | object | First-frame image version labeled IGTV in the response. |
image_versions.additional_items.igtv_first_frame.url | string | URL returned for this image version. |
image_versions.additional_items.igtv_first_frame.width | integer | Reported width of this image version. |
image_versions.additional_items.igtv_first_frame.height | integer | Reported height of this image version. |
Video and subtitles14 fields
data.data.items[]
| Field | Type | Description |
|---|---|---|
has_audio | boolean | null | Whether the media is reported as having audio. |
video_url | string | Video playback URL returned for the media. |
video_duration | number | null | Reported video duration as a number, which can be null. |
video_codec | string | null | Video codec label returned for the media. |
video_versions | array | null | Video versions returned for the media. |
video_versions[] | object | One available video version in the result. |
video_versions[].id | string | Identifier of the video version, returned as text. |
video_versions[].type | integer | Type code reported for this video version. |
video_versions[].url | string | URL returned for this video version. |
video_versions[].width | integer | Reported width of this video version. |
video_versions[].height | integer | Reported height of this video version. |
video_subtitles_enabled | boolean | null | Whether subtitles are reported as enabled for this video. |
video_subtitles_locale | string | null | Locale reported for the video's subtitles. |
video_subtitles_uri | string | null | Subtitle URI returned for this video, when provided. |
Carousel media16 fields
data.data.items[]
| Field | Type | Description |
|---|---|---|
carousel_media_count | integer | null | Reported number of media entries in the carousel. |
carousel_media | array | null | Media entries returned for a carousel post. |
carousel_media[] | object | One media entry in the carousel. |
carousel_media[].id | string | Identifier of the carousel media entry, returned as text. |
carousel_media[].carousel_parent_id | string | Parent carousel identifier reported for the entry. |
carousel_media[].media_type | integer | Reported media type code of the carousel entry. |
carousel_media[].is_video | boolean | Whether Instagram marks the carousel entry as video. |
carousel_media[].original_width | integer | Reported original width of the carousel entry. |
carousel_media[].original_height | integer | Reported original height of the carousel entry. |
carousel_media[].thumbnail_url | string | Thumbnail URL returned for the carousel entry. |
carousel_media[].image_versions | object | Image versions returned for the carousel entry. |
carousel_media[].image_versions.items | array | Image candidates returned for the carousel entry. |
carousel_media[].image_versions.items[] | object | One image candidate for this carousel entry. |
carousel_media[].image_versions.items[].url | string | URL returned for this image version. |
carousel_media[].image_versions.items[].width | integer | Reported width of this image version. |
carousel_media[].image_versions.items[].height | integer | Reported height of this image version. |
Original audio18 fields
data.data.items[].clips_metadata
Clip metadata returned with some media results.
| Field | Type | Description |
|---|---|---|
audio_type | string | Audio type label reported for this clip. |
audio_canonical_id | string | Audio identifier returned in the clip information. |
original_sound_info | object | null | Original audio information returned for the clip. |
original_sound_info.audio_id | string | Identifier of the original audio, returned as text. |
original_sound_info.original_audio_title | string | Display title of the original audio. |
original_sound_info.original_media_id | string | Identifier of the original media reported with this audio. |
original_sound_info.duration_in_ms | integer | Original audio duration in milliseconds. |
original_sound_info.is_explicit | boolean | Whether the original audio has an explicit-content label. |
original_sound_info.time_created | integer | Original audio creation time as a Unix timestamp in seconds. |
original_sound_info.progressive_download_url | string | Audio media URL returned for the original sound. |
original_sound_info.ig_artist | object | Instagram artist profile returned for the original audio. |
original_sound_info.ig_artist.id | string | Instagram account identifier returned as text. |
original_sound_info.ig_artist.username | string | Instagram username reported for the account. |
original_sound_info.ig_artist.full_name | string | Display name reported for the Instagram account. |
original_sound_info.ig_artist.is_private | boolean | Whether Instagram marks the account as private. |
original_sound_info.ig_artist.is_verified | boolean | Whether Instagram marks the account as verified. |
original_sound_info.ig_artist.profile_pic_id | string | Identifier of the Instagram profile image. |
original_sound_info.ig_artist.profile_pic_url | string | Profile image URL returned for the account. |
Catalog music29 fields
data.data.items[].clips_metadata
| Field | Type | Description |
|---|---|---|
music_info | object | null | Catalog music information returned for the clip. |
music_info.music_asset_info | object | Reported catalog music asset information. |
music_info.music_asset_info.id | string | Identifier of the catalog music asset. |
music_info.music_asset_info.audio_id | string | Audio identifier for the catalog music asset. |
music_info.music_asset_info.artist_id | string | null | Artist identifier for the catalog music, when provided. |
music_info.music_asset_info.title | string | Title reported for the catalog music. |
music_info.music_asset_info.subtitle | string | Subtitle returned with the catalog music information. |
music_info.music_asset_info.display_artist | string | Display name of the catalog music artist. |
music_info.music_asset_info.ig_username | string | null | Instagram username reported for the music artist. |
music_info.music_asset_info.duration_in_ms | integer | Catalog music asset duration in milliseconds. |
music_info.music_asset_info.has_lyrics | boolean | Whether lyrics are reported for this music asset. |
music_info.music_asset_info.is_explicit | boolean | Whether the catalog music has an explicit-content label. |
music_info.music_asset_info.cover_artwork_uri | string | Cover artwork URI for the catalog music. |
music_info.music_asset_info.cover_artwork_thumbnail_uri | string | Cover artwork thumbnail URI for the catalog music. |
music_info.music_asset_info.progressive_download_url | string | Audio media URL returned for the catalog music. |
music_info.music_asset_info.fast_start_progressive_download_url | string | Audio URL reported for fast-start playback of the catalog music. |
music_info.music_asset_info.highlight_start_times_in_ms | array | Highlight start offsets returned for the music asset. |
music_info.music_asset_info.highlight_start_times_in_ms[] | integer | One highlight start offset in milliseconds. |
music_info.music_consumption_info | object | Details about the portion of catalog music used in the clip. |
music_info.music_consumption_info.audio_asset_start_time_in_ms | integer | null | Start offset in the music asset, in milliseconds. |
music_info.music_consumption_info.overlap_duration_in_ms | integer | null | Reported duration of music overlap with the clip, in milliseconds. |
music_info.music_consumption_info.ig_artist | object | null | Instagram artist profile returned with the catalog music use. |
music_info.music_consumption_info.ig_artist.id | string | Instagram account identifier returned as text. |
music_info.music_consumption_info.ig_artist.username | string | Instagram username reported for the account. |
music_info.music_consumption_info.ig_artist.full_name | string | Display name reported for the Instagram account. |
music_info.music_consumption_info.ig_artist.is_private | boolean | Whether Instagram marks the account as private. |
music_info.music_consumption_info.ig_artist.is_verified | boolean | Whether Instagram marks the account as verified. |
music_info.music_consumption_info.ig_artist.profile_pic_id | string | Identifier of the Instagram profile image. |
music_info.music_consumption_info.ig_artist.profile_pic_url | string | Profile image URL returned for the account. |
Response Example
Loading the response example...