Support needed? Reach out! ๐Ÿ“ง

How to Scrape Instagram Keyword Search Results

This tutorial shows how to use Instagram Keyword Search Results API to scrape and crawl structured Instagram data in real-time.
Run targeted Instagram keyword searches through our API and get back ranked posts, matching profiles, and related hashtags, useful for social listening and niche research.

Access Instagram Data in 3 Steps

Start crawling Instagram keyword search data. Follow these steps to extract social media data in minutes.

1

Create Your Account

Go to our registration page and make an account. It's free, no credit card, and you get credits right away to play around with.

2

Verify Your Email Address

You'll get a verification email, click the link in it. Once that's done, you can grab your API token from the dashboard.

3

Make Your First API Call

Copy the code snippet below, swap in your API key, and run it. You'll get Instagram data back as JSON within a few seconds.

Code Sample

Here's a JavaScript example to get you going. Swap out the token and you're good, works the same way in any language that can make HTTP requests. Start collecting keyword search data via our REST API!

javascript-logo JavaScript
Instagram Search
1 const root = 'https://ensembledata.com/apis'
2 const endpoint = '/instagram/search'
3 const params = {
4   "text""Cristiano Ronaldo",
5   "token""YOUR-TOKEN-HERE"
6 }
7  
8 const queryString = new URLSearchParams(params).toString();
9 const url = `${root}${endpoint}?${queryString}`;
10  
11 await fetch(url)
12   .then(response => response.json())
13   .then(data => console.log(data))
14   .catch(error => console.error(error));
15  

Parameters

text (string) Text to search. REQUIRED
token (string) Private token assigned to each client to access the APIs. REQUIRED

Example Response

Explore the fields returned by this endpoint. Click a row to expand nested objects and arrays, hover a value to copy it, or use "Expand all" to see everything at once.

JSON
Instagram Search
dataobject3 fields
hashtagsarray1 item ยท schema from #0 1 item
positionnumber4
hashtagobject3 fields
namestring"rome"
media_countnumber30539687
idnumber17841563032102304
placesarray1 item ยท schema from #0 1 item
positionnumber54
placeobject3 fields
locationobject3 fields
pkstring"31499759"
namestring"Rome, Italy"
facebook_places_idnumber115353315143936
subtitlestring""
titlestring"Rome, Italy"
usersarray1 item ยท schema from #0 1 item
positionnumber0
userobject15 fields
usernamestring"romeosantos"
is_verifiedbooleantrue
full_namestring"Romeo Santos"
search_social_contextnullnull
unseen_countnullnull
pkstring"53686324"
live_broadcast_visibilitynullnull
live_broadcast_idnullnull
latest_besties_reel_medianullnull
latest_reel_medianumber0
group_metadatanullnull
seennullnull
profile_pic_urlstring"https://scontent.cdninstagram.com/v/t51.2885-19/315235947_447016054171โ€ฆ"
is_unpublishednullnull
idnullnull

Response Codes

Status codes this endpoint can return, so you can handle errors before they surprise you in production.

200SuccessSuccessful Response
422Client ErrorValidation Error
491Client ErrorToken not found
492Client ErrorEmail not verified
493Client ErrorSubscription expired
495Client ErrorAll daily units used
500Server ErrorSomething went wrong

API Pricing

4 units Cost per successful call to this endpoint.

Fetch Instagram Data at Scale

Fetch Instagram search results at scale and feed them into your social listening or trend tracking workflows.

deco-icon

Ranked Results

Get ranked posts and accounts for any Instagram search term.

deco-icon

Creator Search

Find niche creators currently ranking for your target keywords.

deco-icon

Topic Discovery

Surface trending topics your target audience is discussing now.