Skip to content
Auto

Submit a Song Job

POST /api/v1/tiktok/song1 credit per request

Look up a TikTok song / clip by its clipId. The result is the TikTok music_info JSON, close to as returned by TikTok’s own web app.

Method Path Returns
POST /api/v1/tiktok/song Submit a song lookup
GET /api/v1/tiktok/song/{requestId} Poll a submitted song job
Name Type Required Description
clipId string Yes The TikTok clip / music id (this is the clipId, not a songId). Max 64 chars
Field Type Description
requestId string Opaque ID for this request. Keep it to poll GET /api/v1/tiktok/song/{requestId} later
clipId string Resolved TikTok clip id
status string queued | processing | success | not-found | blocked | timed-out | cancelled
coalesced boolean true if this request attached to an already-in-flight job for the same clip
cached boolean true if served from a fresh, previously-scraped result
result object | null The TikTok music_info JSON. null until the job resolves
finishReason string | null Present once the job reaches a terminal status

Responses come back 200 with a terminal result if the job resolves within the hold window. Otherwise 202 — poll GET /api/v1/tiktok/song/{requestId}, or resubmit the same target (it coalesces onto the still-in-flight job, at no extra charge).

Terminal window
curl -X POST "https://api.megomi.com/api/v1/tiktok/song" \
-H "x-api-key: YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{"clipId": "7123456789012345678"}'
{
"requestId": "req_9f1kQ3zP7mLxA2dR",
"clipId": "7123456789012345678",
"status": "success",
"coalesced": false,
"cached": false,
"result": { "music_info": { "id": "7123...", "title": "Original Sound", "authorName": "creator" } },
"finishReason": null
}

If your submit came back 202, fetch the result later with the requestId:

GET/api/v1/tiktok/song/{requestId}

Returns the current state of the request. A 404 means the requestId doesn’t belong to your key. A blocked job returns 403, same shape as the submit response above.

Field Type Description
requestId string The request you polled
clipId string Resolved TikTok clip id
status string Current job status
requestCount number How many times this job has been requested
result object | null The TikTok music_info JSON, null until resolved
finishReason string | null Present once terminal
createdAt string ISO-8601 timestamp
finishedAt string | null ISO-8601 timestamp, once terminal
Terminal window
curl "https://api.megomi.com/api/v1/tiktok/song/req_9f1kQ3zP7mLxA2dR" \
-H "x-api-key: YOUR_API_KEY"