extract_media_from_post
Extract all media content from a post or thread. Returns images, videos, external links, and quote posts. Optionally includes media from entire thread.
Authentication
Enhanced - This tool works without authentication but provides better results when authenticated.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
uri | string | Yes | - | AT-URI of the post to extract media from. |
includeThread | boolean | No | false | Whether to extract media from the entire thread. |
includeEmbeds | boolean | No | true | Whether to include embedded media (images, videos). |
includeExternalLinks | boolean | No | true | Whether to include external links and previews. |
Response
typescript
{
success: boolean;
media: {
images: Array<{
uri: string;
alt?: string;
aspectRatio?: { width: number; height: number };
blob?: any;
}>;
videos: Array<{
uri: string;
alt?: string;
aspectRatio?: { width: number; height: number };
blob?: any;
}>;
externalLinks: Array<{
uri: string;
title?: string;
description?: string;
thumb?: string;
}>;
quotePosts: Array<{
uri: string;
cid: string;
}>;
};
threadMedia?: Array<any>;
}Examples
Extract Media from Single Post
json
{
"uri": "at://did:plc:abc123/app.bsky.feed.post/xyz1",
"includeThread": false,
"includeEmbeds": true,
"includeExternalLinks": true
}Extract Media from Entire Thread
json
{
"uri": "at://did:plc:abc123/app.bsky.feed.post/xyz1",
"includeThread": true
}Extract Images Only
json
{
"uri": "at://did:plc:abc123/app.bsky.feed.post/xyz1",
"includeEmbeds": true,
"includeExternalLinks": false
}Error Handling
Common errors:
InvalidRequest: Invalid URI or parametersInvalidAtUri: URI is not a valid AT-URIPostNotFound: Post does not exist or has been deletedPostBlocked: Post is from a blocked userRateLimitExceeded: Too many requests in a short period
Best Practices
- Check Media Availability: Verify media exists before attempting to download
- Include Thread: Set
includeThread: truefor comprehensive media extraction - Filter by Type: Use
includeEmbedsandincludeExternalLinksto filter media types - Handle Alt Text: Always use provided alt text for accessibility
- Respect Aspect Ratios: Maintain aspect ratios when displaying images
- Cache Media: Store extracted media to avoid repeated API calls
- Check Blob References: Verify blob references are valid before downloading
Media Types
Images
- Embedded images from posts
- Includes alt text (if provided)
- Aspect ratio information
- Blob reference for downloading
Videos
- Embedded videos from posts
- Includes alt text (if provided)
- Aspect ratio information
- Blob reference for downloading
External Links
- Link previews with metadata
- Title and description
- Thumbnail image (if available)
- Original URL
Quote Posts
- Posts quoted/embedded in the original post
- URI and CID for fetching full post data
- Can contain their own media
Thread Media Extraction
When includeThread: true:
- Extracts media from all posts in the thread
- Includes parent posts and replies
- Returns array of media grouped by post
- Useful for archiving or analyzing thread content
AT-URI Format
AT-URIs must follow this format:
at://did:plc:USER_DID/app.bsky.feed.post/POST_IDExample:
at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3k7qe4smwe22tUse Cases
- Content Archiving: Save all media from important posts
- Media Analysis: Analyze media usage patterns
- Content Curation: Extract media for sharing or reuse
- Accessibility Auditing: Check alt text coverage
- Thread Documentation: Archive complete thread media
- Link Extraction: Collect external resources from posts
Rate Limiting
This tool is subject to AT Protocol API rate limits:
- 3,000 requests per hour for authenticated users
- 300 requests per hour for unauthenticated users
- Thread extraction may require multiple API calls
Related Tools
- get_thread - Get complete thread structure
- get_post_context - Get post with full context
- analyze_image - Analyze image metadata
- upload_image - Upload images
- upload_video - Upload videos