Instagram profile search API
  1. Instagram
  2. Instagram profile search API

Instagram profile search API

Accounts for a name or keyword, from the Instagram pages a web search has indexed (DuckDuckGo's results, not Google's and not Instagram's own ranking),...

GET /v1/instagram/search/profiles

GET /v1/instagram/search/profiles

Accounts for a name or keyword, from the Instagram pages a web search has indexed (DuckDuckGo's results, not Google's and not Instagram's own ranking), best effort and not a complete list. Each result states the account's name and rounded follower, following and post counts (extra.stats_approximate). The first 10 on a page are then read through the Instagram profile endpoint for exact counts, bio, links and picture (enrich, on by default; an account that no longer exists is dropped). The cursor is the next results page and cannot go past 11. When the search provider is busy or asks for human verification on every try the call fails, costs nothing and can be retried. Look an exact username up with profile.

  • Cost: 1 credit
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
querystringyesProfile name, username or keywords. Also accepted as keyword, q.
enrichbooleannoRead the first 10 accounts of a page for exact counts, bio, links and picture (on by default). Off returns only what the search result states, much cheaper and faster. Default true.

Every request also accepts:

  • cursor: the cursor from the previous page (Pagination).
  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

1curl -G "https://api.socialscrape.dev/v1/instagram/search/profiles" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "query=fitness coach"

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_5a0c4a5cf86952b8b193607c",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "profile",13        "platform": "instagram",14        "id": "20655288921",15        "handle": "fitness_._coach",16        "name": "Incredible Fitness  Coach",17        "headline": null,18        "url": "https://www.instagram.com/fitness_._coach/",19        "kind": "unknown",20        "bio": "Lean Muscle🏃‍♂️\nDieting🍓\nGyming🏋️‍♂️🏋️‍♀️\nExercises🏋️‍♂️\n#healthtips #fitness #motivation #gym",21        "avatar_url": "https://scontent-atl3-1.cdninstagram.com/v/t51.2885-19/69639655_532726704200506_7538254279832764416_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_cat=103&ig_cache_key=GOedJgQ6W-cZg_QBAAAAAABUQp1obkULAAAB1501500j-ccb7-5&ccb=7-5&_nc_sid=669407&efg=eyJ2Z...",22        "banner_url": null,23        "verified": false,24        "is_private": false,25        "external_url": null,26        "links": [],27        "location": null,28        "category": null,29        "created_at": null,30        "stats": {31          "followers": 396,32          "following": 657,33          "posts": null,34          "likes": null,35          "views": null36        },37        "extra": {38          "enriched": true,39          "has_reels": false,40          "is_memorialized": false,41          "is_unpublished": false,42          "relay_id": "17841420667631911",43          "search_position": 1,44          "source": "duckduckgo"45        }46      },47      {48        "object": "profile",49        "platform": "instagram",50        "id": null,51        "handle": "thestrongwai",52        "name": "Daniel Wai | Fitness Coach",53        "headline": null,54        "url": "https://www.instagram.com/thestrongwai/",55        "kind": "unknown",56        "bio": null,57        "avatar_url": null,58        "banner_url": null,59        "verified": null,60        "is_private": null,61        "external_url": null,62        "links": null,63        "location": null,64        "category": null,65        "created_at": null,66        "stats": {67          "followers": 109000,68          "following": 715,69          "posts": 510,70          "likes": null,71          "views": null72        },73        "extra": {74          "enrich_error": "upstream_blocked",75          "enriched": false,76          "search_position": 2,77          "source": "duckduckgo",78          "stats_approximate": [79            "followers"80          ]81        }82      }83    ],84    "cursor": "eyJwIjoyLCJmIjp7InEiOiJzaXRlOmluc3RhZ3JhbS5jb20gZml0bmVzcyBjb2FjaCBcIkluc3RhZ3JhbSBwaG90b3MgYW5kIHZpZGVvc1wiIiwicyI6IjEwIiwibmV4dFBhcmFtcyI6IiIsInYiOiJsIiwibyI6Impzb24iLCJkYyI6IjExIiwiYXBpIjoiZC5qcyIsInZxZCI6IjQtMzM2NTg5OTgwODgxOTY3Mzk2MzEx...",85    "has_more": true,86    "parent": null87  },88  "cursor": "eyJwIjoyLCJmIjp7InEiOiJzaXRlOmluc3RhZ3JhbS5jb20gZml0bmVzcyBjb2FjaCBcIkluc3RhZ3JhbSBwaG90b3MgYW5kIHZpZGVvc1wiIiwicyI6IjEwIiwibmV4dFBhcmFtcyI6IiIsInYiOiJsIiwibyI6Impzb24iLCJkYyI6IjExIiwiYXBpIjoiZC5qcyIsInZxZCI6IjQtMzM2NTg5OTgwODgxOTY3Mzk2MzEx...",89  "has_more": true90}

Response#

A list of Profile objects in data.items, with data.cursor and data.has_more.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
not_found404noThe platform says this profile, post or item does not exist.
upstream_blocked503yesThe platform blocked this fetch; retry (a fresh exit is used).

Every request can also fail with the account and platform errors listed on the Errors page.

Example error:

1{2  "ok": false,3  "error": {4    "code": "upstream_blocked",5    "message": "The platform blocked this fetch; retry (a fresh exit is used).",6    "retryable": true7  },8  "credits_charged": 0,9  "request_id": "req_a8b5f98ad767fd15e7703610"10}