Instagram to MP4 API

One authenticated POST converts a public Instagram video or reel URL into a retained MP4 file link — with cover image, creator, and engagement metrics as clean JSON.

  • One REST Endpoint
  • Every Video Link Shape
  • File With Full Context
  • Reels And IGTV Included
  • Idempotent Billable Writes
  • Predictable Error Codes

Request examples

curl -X POST "https://api.agentbody.io/v1/instagram/video/download" \
  -H "Authorization: Bearer <YOUR_AGENTBODY_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{"url":"YOUR_URL"}'

Response examples

Documented responses from the OpenAPI specification.

Retained Instagram media link and normalized public post metadata.

{
  "author_name": "Example Author",
  "author_username": "example",
  "comment_count": 310,
  "duration_seconds": 29.5,
  "like_count": 18420,
  "media_type": "video",
  "play_count": 512334,
  "post_url": "https://www.instagram.com/reel/DWocNOhgmgg/",
  "shortcode": "DWocNOhgmgg",
  "text": "Example caption",
  "thumbnail_url": "https://example.com/cover.jpg",
  "video_content_type": "video/mp4",
  "video_url": "https://api.apify.com/v2/key-value-stores/example/records/DWocNOhgmgg.mp4"
}

Features

Use the Instagram to MP4 API to power downloaders, repurposing pipelines, and content tools — video URL in, retained MP4 link with full post context out.

One REST Endpoint

Call POST /v1/instagram/video/download with a bearer API key and the video URL. The API saves the MP4 and returns a retained file link — no browser automation, no scraping stack, no unofficial client SDK to maintain.

Every Video Link Shape

Reel links, /p/ post links, /tv/ links, and app share links all resolve through the same request. Integrations accept whatever users paste without a normalization step.

File With Full Context

Every response pairs the video_url with the thumbnail_url, shortcode, caption, author name and username, duration, and play, like, and comment counts — a complete record for downloaders and archives.

Reels And IGTV Included

Instagram reels, standard video posts, and longer IGTV-style clips resolve identically. One integration covers every kind of Instagram video your users paste.

Idempotent Billable Writes

Video saves are metered. Send an Idempotency-Key header on retries so an interrupted response does not double-bill the same video — repeated identical requests with one key return the original result.

Predictable Error Codes

Documented status codes: 400 invalid request, 401 missing or bad key, 409 idempotency conflict, 502/503/504 temporary upstream issues — each maps to a distinct fix or retry action.

How to use

Follow these six steps to call the Instagram to MP4 API: create a key, pass a video URL, and process the returned MP4 link.

01

Create An API Key

Create an AgentBody account and generate an API key in the console. Keep the key in your server environment or an approved secret store and send it as a bearer token. Never place a live key in browser code or client bundles.

02

Choose A Public Video

Pick the public Instagram video or reel to convert and copy its URL. Links from private accounts and deleted posts will not resolve — prepare alternates when your workflow needs coverage.

03

Build The Request

Send POST /v1/instagram/video/download with the required url and an Idempotency-Key header. The generated examples show the exact request in curl, JavaScript, Python, Java, and Go.

04

Keep The Key Server-Side

Call the endpoint from your backend, a serverless function, or a scheduled job — anywhere the API key stays out of the browser. If you expose conversions to end users, proxy through your own endpoint.

05

Process The Output

Read the returned video_url, thumbnail_url, caption, creator, and engagement fields. Store the MP4 link with its metadata — the schema is stable across requests.

06

Handle Errors Correctly

Fix 400 by correcting the request, 401 by configuring a valid key, and follow the documented Idempotency-Key behavior on 409. Retry 502/503/504 with backoff under the same key.

Frequently asked questions

What is the Instagram to MP4 API?

An authenticated POST endpoint, /v1/instagram/video/download, that saves a public Instagram video or reel as a retained MP4 file link and returns it with the cover image URL, caption, creator, duration, and play, like, and comment counts as clean JSON.

Is there a free Instagram to MP4 API?

You can start with a free AgentBody account, and every call runs on your account's credits — free to try before committing to volume. Usage-based pricing is governed by the gateway rather than fixed numbers on this page.

Can it convert Instagram reels to MP4?

Yes — reels resolve through the same request as standard video posts. Submit the reel's URL and the response returns the MP4 link with the reel's cover image and engagement; one integration covers both.

What does the response include?

video_url (the retained MP4 link), thumbnail_url, shortcode, post_url, text (the caption), author_name, author_username, media_type, duration_seconds, and play_count, like_count, and comment_count.

Does it work with IGTV links?

Yes — /tv/ links resolve the same way as reels and standard posts. One request shape covers every video type your users submit.

How do I handle API errors?

Correct the request shape on 400, fix your bearer key on 401, and follow the documented Idempotency-Key behavior on 409. Treat 502, 503, and 504 as temporary upstream failures and retry with backoff. Log the status and error code before retrying so your pipeline distinguishes bad requests from transient issues.