Instagram audio downloader API
Extract audio from a public Instagram Reel or video with one POST. The response returns a permanent MP3 download URL and normalized track metadata.
- One POST, One Audio File
- Permanent Download URLs
- All Public Post Types
- Normalized Track Metadata
- Idempotency Key Support
- Server-Side Key Required
Request examples
curl -X POST "https://api.agentbody.io/v1/instagram/audio/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 audio file URL and normalized public track metadata.
{
"artist": "Example Artist",
"audio_type": "licensed",
"audio_url": "https://api.apify.com/v2/key-value-stores/example/records/audio_DcSAqhCTTrX.m4a",
"cover_url": "https://example.com/cover.jpg",
"duration_ms": 175453,
"file_size_bytes": 1833377,
"is_trending": true,
"post_url": "https://www.instagram.com/reel/DcSAqhCTTrX/",
"shortcode": "DcSAqhCTTrX",
"title": "Example Track"
}Features
The instagram.audio_download operation extracts the audio track from one public Instagram post. Your server holds the API key; the endpoint returns a permanent download URL plus normalized metadata in a single call.
One POST, One Audio File
Send POST /v1/instagram/audio/download with a public Instagram URL. A successful 200 returns shortcode, post_url, audio_url, title, artist, duration_ms, file_size_bytes, cover_url, audio_type, and is_trending — everything a downloader pipeline needs in one response.
Permanent Download URLs
The audio_url points to a fully saved file, not an expiring CDN redirect. It downloads from any server, any IP, at any time, so you can hand it to a queue worker, a media server, or straight to your end user without re-running the extraction.
All Public Post Types
The url parameter accepts Reels, standard video posts, and IGTV links. The API resolves the post's audio track automatically; private, deleted, or restricted posts return a 400 or 502 error instead of a file.
Normalized Track Metadata
Every response includes the track title, artist name, duration in milliseconds, file size in bytes, cover image URL, audio classification (licensed, original, or none), and a trending flag — consistent across all posts regardless of how the creator uploaded them.
Idempotency Key Support
Pass an Idempotency-Key header to safely retry failed requests without duplicate charges. The gateway deduplicates by key, so a network retry never triggers a second extraction for the same post.
Server-Side Key Required
The endpoint requires an AgentBody API key held on your server. Never expose the key in client-side code; route all calls through your backend to keep the key secure and your usage tracked.
How to use
Integrate Instagram audio extraction in three steps with the API.
Get Your API Key
Create a free AgentBody account and generate an API key from the dashboard. The key authenticates every request and tracks usage against your balance.
POST The Post URL
Send a POST request to /v1/instagram/audio/download with the public Instagram post URL in the request body. Include an Idempotency-Key header for safe retries.
Receive The Download Link
A successful 200 response returns the permanent audio_url plus track metadata. Download the MP3 directly from the link, or hand it to your media pipeline for storage and distribution.
Frequently asked questions
How does the Instagram audio downloader API work?
Send a POST request to /v1/instagram/audio/download with a public Instagram post URL. The API extracts the audio track, saves it as an MP3 file, and returns a permanent download URL along with normalized metadata including title, artist, duration, and file size.
What Instagram URL formats are supported?
The API accepts Reels URLs (instagram.com/reel/{shortcode}), standard video post URLs (instagram.com/p/{shortcode}), IGTV URLs (instagram.com/tv/{shortcode}), and share links. The post must be publicly accessible; private or restricted posts return an error.
What is the response format?
A successful 200 response returns a JSON object with: shortcode, post_url, audio_url (permanent MP3 download link), title, artist, duration_ms, file_size_bytes, cover_url, audio_type (licensed/original/none), and is_trending (boolean).
Are there rate limits or usage caps?
Each successful extraction draws a fixed amount from your AgentBody balance at the gateway-governed price. There is no separate rate limit beyond your account balance; failed requests (400, 502, etc.) are not billed. Use the Idempotency-Key header to prevent duplicate charges on retries.
Can I extract audio from private Instagram accounts?
No. The API can only process publicly available posts. Private accounts, deleted posts, and age-restricted content are rejected by Instagram's platform and return a 400 or 502 error.
Is it legal to use this API for downloading Instagram audio?
Use the API only for publicly available content that you own, have permission to save, or have another lawful basis to download. Respect copyright law and Instagram's terms of service. The API cannot access private or restricted content at all.