> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/datasets/create-and-upload/adding-data/image-metadata.md).

# Image Metadata

Attach custom key-value metadata to images so you can search, filter, and organize your dataset.

Metadata lets you attach custom key-value pairs to images in your Roboflow workspace. Use metadata to store structured information alongside your images - such as capture conditions, device identifiers, quality scores, or any domain-specific attributes - and then search, filter, and organize your data around those attributes.

## Overview

Each image can hold any number of metadata entries. An entry is a **key** (a name like `camera_id`) paired with a **value** (a string, number, or boolean).

| Value type | Examples                                    |
| ---------- | ------------------------------------------- |
| String     | `location: "warehouse-3"`, `shift: "night"` |
| Number     | `temperature: 72.5`, `quality_score: 95`    |
| Boolean    | `reviewed: true`, `is_night: false`         |

### Use cases

* **Capture context** - record camera ID, GPS coordinates, weather, lighting conditions
* **Quality tracking** - attach confidence scores, review status, annotator IDs
* **Data slicing** - filter your dataset by any attribute to build targeted training sets
* **External system linking** - store identifiers that connect images back to your internal tools

## Adding Metadata

You can add metadata to images through the web UI, the Python SDK, the CLI, the HTTP API, or automatically via [S3 Bucket Mirror](https://docs.roboflow.com/datasets/create-and-upload/adding-data/datasources.md).

{% hint style="info" %}
If your images live in cloud storage like AWS S3, use [Datasources](https://docs.roboflow.com/datasets/create-and-upload/adding-data/datasources.md) and Bucket Mirror so image files and metadata sidecars stay in sync. Signed URL or manual uploads do not provide the same ongoing metadata sync behavior.
{% endhint %}

### Web Application

{% stepper %}
{% step %}

#### Open an image

Open any image in your project.
{% endstep %}

{% step %}

#### Enter key and value

In the metadata section, enter a **key** in the first input and a **value** in the second input.
{% endstep %}

{% step %}

#### Add

Press **Enter** to save or click on Add
{% endstep %}
{% endstepper %}

Values are automatically parsed by type:

| Value entered    | Stored as                  |
| ---------------- | -------------------------- |
| `front`          | `"front"` (string)         |
| `95`             | `95` (number)              |
| `3.14`           | `3.14` (number)            |
| `true` / `false` | `true` / `false` (boolean) |

<figure><img src="https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-81508e07bb2a1aca8c5c8d7b66268c3ac88a35c6%2Fimage%20(439).png?alt=media" alt=""><figcaption><p>Annotation Tool's metadata editor</p></figcaption></figure>

### Python SDK

Pass a `metadata` dictionary when uploading an image:

```python
import roboflow

rf = roboflow.Roboflow(api_key="YOUR_API_KEY")
project = rf.workspace("your-workspace").project("your-project")

project.upload(
    image_path="image.jpg",
    metadata={
        "camera_id": "cam001",
        "location": "warehouse-3",
        "temperature": 72.5,
        "is_night": False
    }
)
```

### CLI

Use the `roboflow image metadata` command to update metadata and tags on existing images:

```bash
# Set metadata on a single image
roboflow image metadata <image_id> -m '{"camera_id": "cam001", "location": "warehouse-3"}'

# Add tags to an image
roboflow image metadata <image_id> --tags "reviewed,v2"

# Remove metadata keys
roboflow image metadata <image_id> --remove-metadata "old_key,deprecated_field"

# Remove tags
roboflow image metadata <image_id> --remove-tags "draft"

# Combine: set metadata, add tags, and remove tags in one call
roboflow image metadata <image_id> -m '{"quality_score": 95}' --tags "reviewed" --remove-tags "pending"

# Batch update multiple images (async)
roboflow image metadata img1,img2,img3 -m '{"batch": "june-2026"}' --tags "processed" --poll
```

A single image ID updates synchronously. Multiple comma-separated IDs (up to 1,000) use the batch async endpoint. Add `--poll` to wait for the batch to finish; without it the command returns a `taskId` you can check later with `roboflow asynctasks get <task-id>`.

| Flag                   | Description                                 |
| ---------------------- | ------------------------------------------- |
| `-m`, `--metadata`     | JSON string of key-value pairs to set       |
| `--remove-metadata`    | Comma-separated metadata keys to remove     |
| `--tags`               | Comma-separated tags to add                 |
| `--remove-tags`        | Comma-separated tags to remove              |
| `--poll` / `--no-poll` | Wait for batch completion (batch mode only) |
| `--timeout`            | Polling timeout in seconds (default: 1800)  |

### HTTP API

To add metadata as you upload an image, send a `metadata` field with a JSON object string in the multipart form, or as a query parameter.

{% openapi src="/files/s1lcjY8hbVRPyxw8CtS5" path="/dataset/{project}/upload" method="post" %}
[manage-images.yaml](https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-e79147570726f4d6b42c79beb72e2651a92dfd6d%2Fmanage-images.yaml?alt=media)
{% endopenapi %}

To change metadata and tags on an image that is already in your workspace, update one image right away:

{% openapi src="/files/s1lcjY8hbVRPyxw8CtS5" path="/{workspace}/images/{imageId}/metadata" method="post" %}
[manage-images.yaml](https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-e79147570726f4d6b42c79beb72e2651a92dfd6d%2Fmanage-images.yaml?alt=media)
{% endopenapi %}

Or update up to 1,000 images in the background, then poll the returned task URL with the [Async Tasks API](https://docs.roboflow.com/reference/platform/rest-api/async-tasks):

{% openapi src="/files/s1lcjY8hbVRPyxw8CtS5" path="/{workspace}/images/metadata" method="post" %}
[manage-images.yaml](https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-e79147570726f4d6b42c79beb72e2651a92dfd6d%2Fmanage-images.yaml?alt=media)
{% endopenapi %}

### S3 Bucket Mirror

When using [Datasources](https://docs.roboflow.com/datasets/create-and-upload/adding-data/datasources.md) to sync images from an S3 bucket, metadata is imported via JSON sidecar files placed alongside each image. See [Datasources](https://docs.roboflow.com/datasets/create-and-upload/adding-data/datasources.md) for sidecar file format, constraints, and update strategies.

### MCP Server

Connect your AI agent to the [MCP Server](https://docs.roboflow.com/agents/mcp-server) and it can tag images and set metadata on them with these tools:

<table data-search="false"><thead><tr><th width="290">Tool</th><th>Description</th></tr></thead><tbody><tr><td><code>images_update_metadata</code></td><td>Update metadata and tags on a single image.</td></tr><tr><td><code>images_batch_update_metadata</code></td><td>Batch-update metadata and tags on multiple images.</td></tr><tr><td><code>images_search</code></td><td>Find the images you want to update, by tag, class, or metadata.</td></tr></tbody></table>

## Capture Time

When you upload images to the [Asset Library](https://docs.roboflow.com/platform/workspaces/asset-library) with the [Roboflow Agent](https://docs.roboflow.com/agents/roboflow-agent#add-media), Roboflow saves when each image was taken as metadata. The time comes from the photo's EXIF data (JPEG and HEIC). If an image has no EXIF time, Roboflow uses the file's last-modified date.

<table data-search="false"><thead><tr><th width="220">Key</th><th>Value</th></tr></thead><tbody><tr><td><code>captured_at</code></td><td>The capture time as an ISO 8601 date and time in UTC (ex: <code>2026-11-12T13:15:42.000Z</code>).</td></tr><tr><td><code>captured_at_unix</code></td><td>The same time in Unix seconds (ex: <code>1794489342</code>). Use it to search by date range.</td></tr><tr><td><code>captured_at_source</code></td><td><code>exif</code> if the time came from the photo, or <code>file_modified</code> if it came from the file's last-modified date.</td></tr></tbody></table>

<figure><img src="https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-f4ec85a769378294042f6043404259039e45c167%2Fimage-metadata-capture-time.webp?alt=media" alt="Image details in the Asset Library showing captured_at, captured_at_unix, and captured_at_source metadata"><figcaption><p>Capture time metadata on an image in the Asset Library</p></figcaption></figure>

If a photo's EXIF time has no time zone, Roboflow reads it in the time zone of the browser that uploaded it.

Uploading an image that is already in your Workspace keeps its existing capture time. If you set `captured_at` yourself, Roboflow keeps your value.

Images uploaded to a Project (from the chat or a Project's upload page), through the API, or from a [Datasource](https://docs.roboflow.com/datasets/create-and-upload/adding-data/datasources.md) don't get a capture time. Images from a zip file you drop in the chat get one only from their EXIF data.

## Searching by Metadata

Metadata is indexed and searchable in the [Asset Library](https://docs.roboflow.com/platform/workspaces/asset-library). Use the search bar to filter images by metadata values:

```
metadata:camera_id="cam001"
metadata:quality_score>80
metadata:reviewed=true
```

To find images taken in a date range, filter on `captured_at_unix` with the start and end of the range in Unix seconds. This finds images taken on November 12, 2026 (UTC):

```
metadata:captured_at_unix>=1794441600 AND metadata:captured_at_unix<1794528000
```

<figure><img src="https://2252499186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNVfRxNsvCh4GOyqrjmzX%2Fuploads%2Fgit-blob-f9cd2adde8b5c395ccd6d6f02f939a8333c858f9%2Fimage-metadata-capture-time-search.webp?alt=media" alt="Asset Library search filtered to images captured on one day"><figcaption><p>Searching the Asset Library by capture time</p></figcaption></figure>

You can combine metadata filters with other search filters:

```
metadata:location="warehouse-3" AND class:forklift
```

The Asset Library also provides autocomplete for metadata keys and values based on what exists in your workspace.

## Key Naming Rules

Metadata keys must follow these rules:

| Rule                 | Detail                                                                 |
| -------------------- | ---------------------------------------------------------------------- |
| Allowed characters   | Letters (`a-z`, `A-Z`), numbers (`0-9`), underscores (`_`), dots (`.`) |
| First character      | Must be a letter, number, or underscore                                |
| Forbidden characters | Forward slashes (`/`) are not allowed                                  |

Valid keys: `camera_id`, `capture.temperature`, `_internal_ref`, `v2_score`

Invalid keys: `camera/id` (contains `/`), `.starts_with_dot` (starts with `.`), `has spaces` (contains spaces)

## Metadata vs. Tags

Both metadata and [tags](https://docs.roboflow.com/datasets/manage/manage-datasets/add-tags-to-images.md) help you organize images, but they serve different purposes:

|               | Tags                                 | Metadata                                   |
| ------------- | ------------------------------------ | ------------------------------------------ |
| **Structure** | Simple labels                        | Key-value pairs                            |
| **Values**    | No value, just a name                | String, number, or boolean                 |
| **Best for**  | Categorization, workflow status      | Structured attributes, measurements        |
| **Example**   | `reviewed`, `v2`, `needs-annotation` | `temperature: 72.5`, `camera_id: "cam001"` |

You can use both on the same image. For example, tag an image as `reviewed` and also store `reviewer: "alice"` and `confidence: 0.95` as metadata.
