App Logo
instagram.com

Get Instagram DM attachment

Download the media attached to an Instagram DM message (photo, video, clip/reel share, voice note) by thread_id plus message id. Returns filename, mimeType, size and the bytes as base64, plus the direct media URL. Omit the message id to take the most recent media in the thread.

Input

threadId required

Instagram DM thread id (thread_id from instagram.com/get_inbox).

maxBytes optional

Refuse to base64-encode anything larger than this. Default 8000000 (8 MB) — videos can be far bigger, and the URL is still returned so it can be fetched directly.

messageId optional

Message/item id to download. Omit to take the most recent message in the thread that carries media.

Output

itemType required

Instagram's item_type, e.g. media, clip, voice_media, animated_media, media_share.

mediaUrl required
threadId required
messageId required
size optional

Byte size of the downloaded media.

base64 optional

Media bytes, base64-encoded. Null when the media exceeded maxBytes — mediaUrl is still usable.

filename optional
mimeType optional
pickedLatest optional

True when no messageId was given and the newest media item was used.

skippedEncoding optional

True when the bytes were not encoded because they exceeded maxBytes.

FAQ

Download the media attached to an Instagram DM message (photo, video, clip/reel share, voice note) by thread_id plus message id. Returns filename, mimeType, size and the bytes as base64, plus the direct media URL. Omit the message id to take the most recent media in the thread.
Required: threadId. Optional: maxBytes, messageId.
It returns size, base64, filename, itemType, mediaUrl, mimeType, threadId, messageId, pickedLatest, skippedEncoding.
Yes. It acts as you on instagram.com: on your own Chrome it reuses your session, and on a Reduck-hosted browser it loads the instagram.com cookies saved by the Reduck extension.
It only reads. It looks things up on instagram.com and changes nothing there.
Ask an AI agent connected to Reduck to run reduck/instagram.com/get_dm_attachment, or run it from a terminal with the Reduck CLI: npx @reduck-ai/cli@latest run --script reduck/instagram.com/get_dm_attachment
It is part of Reduck's official curated catalogue.

Start building not clicking