What You'll Learn
- • Setting up your development environment
- • Installing the required HTTP client
- • Authenticating with the ScrapeCreators API
- • Making requests to Instagram
- • Handling responses and errors
- • Best practices for production use
Tutorial · Instagram
⚡️ Node.js Step-by-stepExtract transcript data from Instagram. Real code, real responses, real production patterns — paste it into your project and ship.
Learn how to scrape Instagram transcripts using Node.js. This comprehensive guide will walk you through the entire process, from setup to implementation.
First, you'll need a ScrapeCreators API key to authenticate your requests.
Sign up at app.scrapecreators.com to get your free API key with 100 requests.
Make sure you have the following installed:
Axios is a promise-based HTTP client for Node.js
npm install axiosNow let's make a request to the Instagram API using Node.js. Replace YOUR_API_KEY with your actual API key.
import axios from 'axios';
const API_KEY = 'YOUR_API_KEY';
async function scrape() {
try {
const response = await axios.get(`https://api.scrapecreators.com/v2/instagram/media/transcript?allow_long_transcription=example_value&url=example_value&cache_max_age=7d`, {
headers: {
'x-api-key': API_KEY,
'Content-Type': 'application/json'
}
});
console.log('Response:', response.data);
return response.data;
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
// Usage
scrape();This endpoint accepts the following parameters:
allow_long_transcriptionOptional(boolean)Paid opt-in, enabled only by the literal query value 'true' (allow_long_transcription=true). Defaults to false when omitted; other values do not enable paid mode. By default, successful AI transcription of videos up to 120 seconds (two minutes, inclusive) costs a flat 1 credit per request. Over 120 seconds, videos cannot be AI-transcribed by default. Set allow_long_transcription=true to opt into paid AI with no fixed duration cap: ALL successful AI transcriptions in this mode cost 10 credits per started minute, including short videos: 10 * ceil(duration_seconds / 60). For example, 177 seconds costs 30 credits and an opted-in 60 seconds costs 10 credits. Empty AI results and errors cost 0 credits for AI transcription. This flag does not force AI and does not enable transcription or AI fallback by itself. Keep get_transcript=true or use_ai_as_fallback=true where required by the endpoint. Returned native captions still cost 1 credit on dedicated transcript routes, even for long videos with this flag; on detail routes they leave the base price unchanged. These routes remain synchronous. Allow at least 30 seconds on your client. Paid long transcription can exceed resource limits or timeouts, so successful transcription of long videos is not guaranteed.
urlRequired(string)Instagram post or reel URL
cache_max_ageOptional(select)If we have a response in the cache that is this many days old or newer, return the cached response (0 credits, with "cached": true and a "cached_at" timestamp). Otherwise, scrape a live result (By default, successful AI up to 120 seconds costs a flat 1 credit per request; over 120 seconds requires allow_long_transcription=true, which bills ALL successful AI at 10 credits per started minute, including short videos; empty AI results and errors cost 0 credits). [See the Caching page for details.](https://docs.scrapecreators.com/caching)
Example: 7d
Execute your script to test the API connection. You should see a JSON response with Instagram transcripts data.
✅ Success: You should receive a structured JSON response containing the requested data.
Here's an example of the JSON response you'll receive:
{
"success": true,
"credits_remaining": 1000000,
"transcripts": [
{
"id": "3597267389859272809",
"shortcode": "DHsD6HGqJhp",
"text": "Let's fry up the perfect bunzel. Beautiful. Everybody, shh. The perfect bunzel. Let me show you my bunzel. When it comes down to bunzel, we make it the crispiest, get the crunch. Heaven."
}
]
}Check that your response includes the expected fields:
success(boolean)credits_remaining(number)transcripts(object)Implement comprehensive error handling and retry logic for failed requests. Log errors properly for debugging.
Cache responses when possible to reduce API calls and improve performance. Consider data freshness requirements.
Never expose your API key in client-side code. Use environment variables and secure key management practices.
When scraping multiple transcripts, consider batching requests to maximize throughput while staying within rate limits.
Use asynchronous processing in Node.js to handle multiple requests concurrently and improve overall performance.
Analyze Instagram transcripts to understand market trends, competitor analysis, and audience insights.
Track performance metrics, engagement rates, and content trends across Instagram transcripts.
Identify potential customers and business opportunities throughInstagram data analysis.
Check your API key is correct and properly formatted in the x-api-key header.
You ran out of credits and need to buy more.
The resource might not exist or be private.
Temporary server issue. Implement retry logic with exponential backoff.
ScrapeCreators offers 100 free API calls to get started. After that, pricing starts at $10 for 5k requests with volume discounts available.
Scraping publicly available data is fair game, and we only collect public data. So anything that you can see in an incognito browser is what we collect.
There is no rate limit! So you can scrape as fast as you want!
All API responses are returned in JSON format, making it easy to integrate with any programming language or application.
Yes! This tutorial focuses on core Node.js HTTP concepts that work with any framework. The API calls remain the same regardless of your specific Node.js setup.
For large datasets, implement pagination, use streaming responses where available, and consider storing data in a database for efficient querying.
Ready to ship?
100 free API calls. No credit card. Same endpoint, same response shape.
Same endpoint, different language