Instagram Hashtag
Extract recent and top posts from an Instagram hashtag page.
Use the JS token
Instagram scrapers work best with your JavaScript token.
API usage
Add &scraper=instagram-hashtag to a Crawling API request. URL-encode the target URL in the url parameter.
curl 'https://api.crawlbase.com/?token=YOUR_TOKEN' \
--data-urlencode 'url=https://www.instagram.com/explore/tags/love/' \
--data-urlencode 'scraper=instagram-hashtag' -Gfrom crawlbase import CrawlingAPI
api = CrawlingAPI({'token': 'YOUR_TOKEN'})
res = api.get(
'https://www.instagram.com/explore/tags/love/',
{'scraper': 'instagram-hashtag'}
)
import json
data = json.loads(res['body'])const { CrawlingAPI } = require('crawlbase');
const api = new CrawlingAPI({ token: 'YOUR_TOKEN' });
const res = await api.get(
'https://www.instagram.com/explore/tags/love/',
{ scraper: 'instagram-hashtag' }
);
const data = JSON.parse(res.body);require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')
res = api.get('https://www.instagram.com/explore/tags/love/', scraper: 'instagram-hashtag')
data = JSON.parse(res.body)Example input URL
The URL passed in the url parameter (URL-decoded for readability):
https://www.instagram.com/explore/tags/love/Response shape
JSON response body. Field types may be null when the source page omits the value.
Hashtag (without the #).
Total posts using this hashtag, when shown.
Top-ranked posts under the tag.
Recent posts under the tag.
Post shortcode.
Thumbnail URL.
Likes.
Comments.
Permalink.
Sample response
{
"hashtag": "love",
"post_count": 2100000000,
"top_posts": [
{
"id": "C7xY...",
"thumbnail_url": "https://scontent.cdninstagram.com/...jpg",
"like_count": 847000,
"comment_count": 2102,
"url": "https://www.instagram.com/p/C7xY..."
}
]
}
