Download file
Stream a video, photo or audio file through the API. Use it for large files (Facebook HD videos are often 50–100 MB) or when your servers can’t reach the platform’s CDN.
Endpoint
GET
/s/instagram/downloadSend your API key in the X-API-Key header. instagram is the usual service slug; use the one shown on your subscription if it differs.
Query parameters
| Name | Description |
|---|---|
urlrequired | A media URL from a previous answer (media[].url or a variant URL). Links to any other site are refused.Example: https://scontent-lhr8-1.cdninstagram.com/o1/v/t16/f2/m86/video.mp4?oh=… |
filenameoptional | Name to save the file as. The extension is added from the file type if missing.Example: reel |
Example request
# -o writes the file as it arrives; -C - resumes a broken download.
curl -C - -o video.mp4 '/s/instagram/download?url=https%3A%2F%2Fscontent-lhr8-1.cdninstagram.com%2Fo1%2Fv%2Ft16%2Ff2%2Fm86%2Fvideo.mp4%3Foh%3D%E2%80%A6&filename=reel' \
-H 'X-API-Key: YOUR_API_KEY'Response
The body is the file itself, not JSON. Errors still come back as JSON with a message.
HTTP/1.1 200 OK
Content-Type: video/mp4
Content-Length: 73400320
Content-Disposition: attachment; filename=facebook-video.mp4
Accept-Ranges: bytesNotes
- The file is streamed as it arrives, so you can start writing it to disk (or playing it) right away. Read it in chunks rather than loading it into memory.
- Range requests work: send Range: bytes=START- to resume a broken download, or let a video player seek.
- A 404 means the media link expired. Call the post endpoint again for fresh links.
- Each download counts as one request on your plan, whatever the file size.