What You'll Learn
- • Setting up your development environment
- • Installing the required HTTP client
- • Authenticating with the ScrapeCreators API
- • Making requests to TikTok
- • Handling responses and errors
- • Best practices for production use
Tutorial · TikTok
⚡️ Node.js Step-by-stepExtract replies data from TikTok. Real code, real responses, real production patterns — paste it into your project and ship.
Learn how to scrape TikTok replies 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 1000 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 TikTok 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/v1/tiktok/video/comment/replies?comment_id=7623828115408274207&url=https://www.tiktok.com/@stoolpresidente/video/7623818255903329566&cursor=3`, {
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:
comment_idRequired(string)TikTok comment ID. This is the cid from the comments endpoint.
Example: 7623828115408274207
urlRequired(string)TikTok video URL. This is the url from the comments endpoint.
Example: https://www.tiktok.com/@stoolpresidente/video/7623818255903329566
cursorOptional(number)Cursor to get more replies. Get 'cursor' from previous response.
Example: 3
Execute your script to test the API connection. You should see a JSON response with TikTok replies data.