GET
/tiktok
Streams all video entries from a TikTok profile as NDJSON using yt-dlp flat-playlist.
Query Parameters
urequiredTikTok username, @username, or full profile URLlimitoptionalMax number of videos to return. Fetches the most recent N videos. Omit to get all.Example Requests
GET /tiktok?u=charlidamelio GET /tiktok?u=@charlidamelio GET /tiktok?u=https://www.tiktok.com/@charlidamelio GET /tiktok?u=charlidamelio&limit=30
Response
Returns application/x-ndjson. Each line is a self-contained JSON object representing one video entry, emitted as yt-dlp discovers it.
{"id":"7123456789","title":"some video","webpage_url":"https://www.tiktok.com/@user/video/7123456789","thumbnail":"https://...","duration":15,"uploader":"charlidamelio",...}
{"id":"7123456788","title":"another video","webpage_url":"https://...","thumbnail":"https://...","duration":30,...}
...Error Responses
400Missing ?u= parameterConsuming the Stream
Read the response body as a stream and parse each line as JSON:
const res = await fetch('/tiktok?u=charlidamelio');
const reader = res.body.getReader();
const decoder = new TextDecoder();
let buf = '';
while (true) {
const { done, value } = await reader.read();
if (done) break;
buf += decoder.decode(value, { stream: true });
const lines = buf.split('\n');
buf = lines.pop();
for (const line of lines) {
if (line) console.log(JSON.parse(line));
}
}Streaming is ideal for large profiles. Start processing videos as they arrive without loading the entire profile into memory.