The code
download-tiktok.mjs
vm.tiktok.com/... work as they are, so you can pass on whatever your users paste.
What comes back
The finished job fromGET /import/status:
720p means 720 pixels on the short side (720×1280). Set includeVideo: false for the audio only. All options are in Downloads.
Errors to handle
Every error has a
documentationUrl with the fix. See Error handling.
In production
- Don’t make a web request wait on the loop above. Pass
webhookUrland save the file when Importly calls you back (Webhooks), and keep a status check as a fallback. - Copy the file somewhere permanent, or set
store: trueto have every import land in your own bucket (recipe). - For many links at once, see Batch imports.
Downloads cost $0.002 per MB, with a $0.01 minimum, so a short TikTok is usually about a cent. Try it free, no card required. See Pricing & credits.