Actions2
- Page Actions
- Database Actions
Database → Query Media
AI-generatedOverview
This node queries media files from a specified Notion database. It allows users to filter media by type (image, video, audio, file), include metadata such as file size and upload date, limit the number of results, and optionally download the media files as binary data. This is useful for automating the retrieval and processing of media assets stored within Notion databases, for example, to integrate media content into other workflows or systems.
Use Case Examples
- Query all images and videos from a Notion database and include metadata for each media file.
- Retrieve up to 50 audio files from a Notion database without downloading the actual media files.
- Download media files as binary data for further processing or storage.
Properties
| Name | Meaning |
|---|---|
| Database ID | The ID of the Notion database to query media from, required to identify the target database. |
| Options | Additional options to filter and control the query results, including media type filter, whether to include metadata, maximum number of results, and whether to download files as binary data. |
Output
Binary
If 'Download Files' option is enabled, the node outputs the media files as binary data encoded in base64 along with MIME type and file name.
JSON
id- Unique identifier of the media block.type- General media type (image, video, audio, file).blockType- Specific block type in Notion (e.g., image, video, audio, file, pdf).url- URL to access the media file.metadatacreatedTime- Creation timestamp of the media file.lastEditedTime- Last edited timestamp of the media file.createdBy- User ID who created the media file.lastEditedBy- User ID who last edited the media file.caption- Caption text associated with the media file.width- Width of the media block (if applicable).height- Height of the media block (if applicable).
fileName- Name of the media file.
Dependencies
- Requires an API key credential for Notion with upload media access.
Troubleshooting
- Invalid database ID error: Ensure the database ID is correctly formatted as a UUID with hyphens.
- HTTP request failures: Check network connectivity and validity of the Notion API token.
- Download failures: If downloading media files fails, verify the URLs and network access.
- Continue on fail option: If enabled, errors for individual items will be returned in the output instead of stopping execution.
Links
- Notion API - Query Database - Official Notion API documentation for querying databases.
- Notion API - Working with Media - Guidance on handling media files in Notion via the API.