Skip to main content

Instagram user search API

GET /search/username/{query} · GetSocialAPI

Search users by name/login; the standard way to resolve username to pk. Upstream: users/search/?q=.

Request​

ParameterInRequiredDescription
querypathyesSearch query
countquerynoResults per page, 1-50 (default 10); the service may return one extra exact-match entry beyond it

Response​

Response example — click to expand (collapsed: one array item shown per array)
{
"num_results": 3,
"users": [
{
"fbid_v2": 17841401651560072,
"pk": 4663052,
"pk_id": "4663052",
"is_verified_search_boosted": false,
"third_party_downloads_enabled": 1,
"strong_id__": "4663052",
"id": "4663052",
"full_name": "Pavel Durov",
"is_private": false,
"is_verified": true,
"profile_pic_id": "1473324025592774142_4663052",
"profile_pic_url": "https://scontent-mad1-1.cdninstagram.com/v/t51.2885-19/17265790_427045080983585_8337130549214707712_a.jpg?stp=dst-jpg_e0_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby40NTMuYzIifQ&_nc_ht=scontent-mad1-1.cdninstagram.com&_nc_cat=105&_nc_oc=Q6cZ2gHlzromGWa2G3xk7ZnOBIOkO75Y8ex6QvHc23cXJc7RkhWXxHsLSPVYbH5NzF-qxsU&_nc_ohc=z5Q9aGTM1yQQ7kNvwENrnHm&_nc_gid=U2VQPHj0wju2OkA5IEDpTg&edm=AM7KJZYBAAAA&ccb=7-5&ig_cache_key=GH50BwEh6FouZYQBAAAAAAAQcLNzYUULAAAB1501500j-ccb7-5&oh=00_AQMnZgHubtn7dc0RaA5UKV3qy2B5tnmcb65_XZhvWJOenw&oe=6AD8231F&_nc_sid=8ec269",
"username": "durov",
"account_badges": [],
"friendship_status": {
"following": false,
"is_bestie": false,
"is_feed_favorite": false,
"is_private": false,
"is_restricted": false,
"incoming_request": false,
"outgoing_request": false
},
"has_anonymous_profile_picture": false,
"has_opt_eligible_shop": false,
"is_ring_creator": false,
"latest_reel_media": 0,
"should_show_category": true,
"show_ring_award": false,
"show_text_post_app_badge": false,
"unseen_count": 0,
"aigm_account_label_info": {
"is_enabled": false,
"is_auto_detected": false,
"is_manually_enabled": false
}
}
],
"has_more": false,
"rank_token": "1792166250898|ac84ef7f355bdbb62edd039e1019b60d9aa14543c6f19bffa06c326d0b3f4f38",
"clear_client_cache": false,
"status": "ok"
}

The result object contains users at the root — iterate result["users"] directly. num_results matches the list length, has_more signals whether Instagram has more matches, and rank_token identifies the search session.

note

The exact match is usually first — verify by comparing the username field.