Skip to main content

Search Instagram posts

Search Instagram by keyword or hashtag. The query is passed to Instagram's native search, which is relevance-ranked.

GET /v1/instagram/search
No boolean operators

Instagram's search is a relevance engine, not a boolean index. Operators like AND / OR / NOT are not supported — they'd be treated as literal words. Just pass natural keywords (e.g. dentist teeth whitening) or a hashtag.

Query parameters

ParameterTypeDefaultDescription
querystringRequired. A keyword or hashtag, e.g. #dentist or dentist teeth whitening.
max_pagesinteger1Number of Instagram pages to fetch. Maximum 100.

Pagination follows Instagram: one page ≈ 18 posts (whatever the grid returns). Fetching max_pages pages returns those pages' posts, deduplicated across pages, in Instagram's relevance order. Fewer pages may come back if Instagram has no more results.

Examples

Hashtag:

curl -G "$LISTENX_BASE/v1/instagram/search" \
-H "X-API-Key: $LISTENX_KEY" \
--data-urlencode 'query=#dentist'

Multi-word keyword, three pages (~54 posts):

curl -G "$LISTENX_BASE/v1/instagram/search" \
-H "X-API-Key: $LISTENX_KEY" \
--data-urlencode 'query=dentist teeth whitening' \
--data-urlencode 'max_pages=3'

Response

{
"query": "#dentist",
"pages_requested": 3,
"pages_fetched": 3,
"returned": 42,
"results": [
{
"id": "3617860230227174032",
"shortcode": "DI1OLYNtCKQ",
"url": "https://www.instagram.com/p/DI1OLYNtCKQ/",
"type": "reel",
"taken_at": "2025-04-24T13:52:19+00:00",
"caption": "…",
"author": {
"id": "15904929129",
"username": "jasmin_momlife",
"full_name": "Jasmin | Mama Alltag & Family Bloggerin",
"is_verified": false
},
"engagement": {
"like_count": 4045,
"comment_count": 238,
"play_count": 185300,
"view_count": 185300
},
"thumbnail_url": "https://…"
}
],
"billing": {
"endpoint": "instagram.search",
"units": 3,
"unit_price": "0.010000",
"amount": "0.030000",
"balance_after": "97.240000",
"request_id": "…"
}
}

Fields

FieldDescription
pages_requestedThe max_pages you asked for.
pages_fetchedInstagram pages actually fetched (also the number of billed units).
returnedNumber of posts in results (deduplicated across pages).
results[]Lightweight post records, in Instagram's relevance order.

Billing

Search is billed per page fetchedunits = pages_fetched, minimum 1. So max_pages=3 costs up to 3 units (fewer if Instagram runs out of pages sooner). See Billing.

Notes

  • To fetch complete details (all engagement metrics, media URLs, tagged users, music, etc.) for a specific result, call the post endpoint with its shortcode.
  • Instagram's search is a discovery surface; results are not exhaustive and can shift over time. Some multi-word queries return few or no results — try broader terms or a hashtag.