Email me if you need anything: [email protected]
https://youtu.be/ttUEPdwMnk8?si=iYHZfkB2vVxilf7O
Example:
async function scrapeTiktokProfile(handle) {
try {
const res = await axios({
method: "POST",
url: "<https://api.scrapecreators.com/tiktok/profile>",
headers: {
'x-api-key': process.env.API_TOKEN
},
data: {
handle
},
});
return res.data;
} catch (e) {
console.log("error", e.message);
}
}
async function scrapeTiktokUserVideos(sec_uid, handle = null) {
try {
const res = await axios({
method: "POST",
url: "<https://api.scrapecreators.com/tiktok/profile-videos>",
headers: {
'x-api-key': process.env.API_TOKEN
},
data: {
sec_uid,
handle, // sec_uid is preferred (can get that from scraping the users profile)
amount: 10
},
});
return res.data;
} catch (e) {
console.log("error", e.message);
}
}
This takes about 30 seconds because its cursor based pagination, so have to get the cursor each time to get the next batch of results.