Skip to main content
Your users paste an Instagram reel link and your Node backend needs the video. Instagram’s own API only covers accounts that connect to your app, and anonymous requests from servers hit a login wall. This sends the public reel link to Importly and saves the finished MP4. It runs on Node 18 or later with no dependencies. The Python version does the same with 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 from GET /import/status:
Set 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 webhookUrl and 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: true to 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.