POST /api/v1/tiktok/song — 1 credit per request
Look up a TikTok song / clip by its clipId. Send it in the JSON body, or as the clipId query parameter to get the extended response (see below).
Endpoint
Section titled “Endpoint”| Method | Path | Returns |
|---|---|---|
| POST | /api/v1/tiktok/song |
Song details |
Request & Response
Section titled “Request & Response”Request body
Section titled “Request body”| Name | Type | Required | Description |
|---|---|---|---|
clipId |
string | Yes | The TikTok clip / music id (this is the clipId, not a songId). Up to 2048 characters. A sound URL (https://www.tiktok.com/music/<slug>-<id>) or a sound share link also works. Pass it in the body or as the clipId query parameter, not both |
Response body
Section titled “Response body”| Field | Type | Description |
|---|---|---|
requestId |
string | Opaque ID for this request. Keep it if you plan to resubmit later |
clipId |
string | Resolved TikTok clip id |
status |
string | "success" — the only value a 200 response carries |
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. Free if your key already paid for this target in the last 10 minutes; charged otherwise |
result |
object | clipId, title, authorName, album, durationSeconds, isOriginal, videoCount, coverUrl; each present only when TikTok reported it |
finishReason |
string | target-found on a freshly fetched answer; absent on a cached one |
Extended response (?clipId=)
Section titled “Extended response (?clipId=)”Sending the clip id as a query parameter (no body) keeps every field above and adds:
| Field | Type | Description |
|---|---|---|
success |
boolean | Always true on a 200 |
credits_charged |
number | Credits this request cost; 0 for a song your key already paid for |
credits_remaining |
number | Your balance after this request |
cached_at |
string | When a cached answer was fetched. Cached answers only |
music_info |
object | The song in TikTok’s snake_case names |
rec_list, similar_music |
array | Always [] |
similar_music_ids |
null | Always null |
status_code, status_msg |
number, string | 0 and "" |
The submit waits for its job to finish, up to 45 seconds, and answers as soon as a result is ready. Only a 200 is ever charged. Otherwise you get 404 (song doesn’t exist), 403 (blocked by TikTok), or 503 (no data fetched in time) — none of which are charged. Resubmitting the same target either way attaches to the still-in-flight job or returns the by-then-resolved result inline, at no extra charge.
curl -X POST "https://api.megomi.my.id/api/v1/tiktok/song?clipId=6717159721276540930" \ -H "x-api-key: YOUR_API_KEY"const params = new URLSearchParams({ clipId: "6717159721276540930" });const res = await fetch(`https://api.megomi.my.id/api/v1/tiktok/song?${params}`, { method: "POST", headers: { "x-api-key": process.env.MEGOMI_API_KEY },});const data = await res.json();import requests
res = requests.post( "https://api.megomi.my.id/api/v1/tiktok/song", params={"clipId": "6717159721276540930"}, headers={"x-api-key": "YOUR_API_KEY"},)print(res.json())<?php$url = "https://api.megomi.my.id/api/v1/tiktok/song?" . http_build_query(["clipId" => "6717159721276540930"]);$ch = curl_init($url);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-api-key: YOUR_API_KEY"]);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);echo curl_exec($ch);q := url.Values{}q.Set("clipId", "6717159721276540930")req, _ := http.NewRequest("POST", "https://api.megomi.my.id/api/v1/tiktok/song?"+q.Encode(), nil)req.Header.Set("x-api-key", "YOUR_API_KEY")resp, _ := http.DefaultClient.Do(req){ "requestId": "req_9f1kQ3zP7mLxA2dR", "clipId": "6717159721276540930", "status": "success", "coalesced": false, "cached": false, "result": { "clipId": "6717159721276540930", "title": "Different (Acoustic)", "authorName": "Micah Tyler", "album": "Different", "durationSeconds": 60, "isOriginal": false, "videoCount": 358, "coverUrl": "https://p16-sg.tiktokcdn.com/aweme/720x720/tos-alisg-v-2774/okeuMAAZnBBv88JZBjFEgjDOtWCZQ4AEEwfoQb.jpeg" }, "finishReason": "target-found", "success": true, "credits_charged": 1, "credits_remaining": 999, "music_info": { "id": 6717159721276540930, "id_str": "6717159721276540930", "mid": "6717159721276540930", "title": "Different (Acoustic)", "author": "Micah Tyler", "album": "Different", "duration": 60, "is_original_sound": false, "user_count": 358, "cover_large": { "url_list": [ "https://p16-sg.tiktokcdn.com/aweme/720x720/tos-alisg-v-2774/okeuMAAZnBBv88JZBjFEgjDOtWCZQ4AEEwfoQb.jpeg" ] }, "cover_medium": { "url_list": [ "https://p16-sg.tiktokcdn.com/aweme/200x200/tos-alisg-v-2774/okeuMAAZnBBv88JZBjFEgjDOtWCZQ4AEEwfoQb.jpeg" ] }, "cover_thumb": { "url_list": [ "https://p16-sg.tiktokcdn.com/aweme/100x100/tos-alisg-v-2774/okeuMAAZnBBv88JZBjFEgjDOtWCZQ4AEEwfoQb.jpeg" ] }, "play_url": { "url_list": [ "https://sf77-ies-music-sg.tiktokcdn.com/obj/tos-alisg-ve-2774/oIBIZNfxOX2Nzi1WRH4ABroDirMAuIjwsGVov9" ] } }, "rec_list": [], "similar_music": [], "similar_music_ids": null, "status_code": 0, "status_msg": ""}{ "status": 400, "title": "Bad Request", "detail": "clipId is required" }{ "status": 401, "title": "Unauthorized", "detail": "invalid API key" }{ "status": 402, "title": "Payment Required", "detail": "insufficient credit balance", "required": 1, "balance": 0}{ "status": 403, "title": "Forbidden", "detail": "TikTok answered this song lookup with a captcha challenge; you were not charged. Retry in a few minutes", "requestId": "req_2wYh8LmN5vRtCx1s", "clipId": "6717159721276540930", "finishReason": "captcha-challenge"}{ "status": 404, "title": "Not Found", "detail": "TikTok reports this song does not exist or is not available (deleted, private, or never existed); you were not charged. This answer is cached for an hour", "requestId": "req_5mPq1XwK8jVcT4nR", "finishReason": "tiktok-status-10203"}{ "status": 503, "title": "Service Unavailable", "detail": "no data fetched within 45s; you were not charged. The lookup is still running: submitting the same request again shortly may return it from cache, and is never charged twice", "requestId": "req_1qLr6PxV8nWtE3sJ", "finishReason": "no-data-fetched"}