requests.
The code
download-reel.mjs
/reel/ and /p/ links both work, with or without the ?igsh=… share parameter, so you can pass on whatever your users paste.
What comes back
The finished job fromGET /import/status:
includeVideo: false in the request body for the audio only. All options are in Downloads.
Errors to handle
Importly fetches what’s public: private accounts, close-friends stories and anything behind a login fail and aren’t charged. Only download reels your users have the right to use. See Supported sites and 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. - On serverless hosts with short time limits, start the import in one function and handle the webhook in another. See Vercel function limits for the pattern.
- Copy the file somewhere permanent, or set
store: trueto have it land in your own bucket (recipe).
Downloads cost $0.002 per MB, with a $0.01 minimum, so a minute-long reel is usually a few cents. Try it free, no card required. See Pricing & credits.