> For the complete documentation index, see [llms.txt](https://docs.datasaur.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasaur.ai/advanced/extensions/metadata.md).

# Metadata

The **Metadata** extension allows you to view metadata attached to cells or lines in a project. Metadata can be embedded in input formats that support `metadata`, such as [JSON Advanced](/compatibility-and-updates/supported-formats.md#json_advanced), [Datasaur Schema](/compatibility-and-updates/supported-formats.md#datasaur-schema-format), or by using the [Import File Transformer](/workspace-management/file-transformer/import-transformer.md).

Metadata is supported in:

* **Span labeling projects**: Metadata is attached per line.

  <figure><img src="/files/3cW5vuaj9MqZLeOH77LD" alt=""><figcaption></figcaption></figure>
* **Row labeling projects**: Metadata is attached per cell.

  <figure><img src="/files/0edqlYQtqV8IKrOqxEQl" alt=""><figcaption></figcaption></figure>

## Structure

The structure for <mark style="color:red;">`CellMetadata`</mark> is defined as follows:

<pre class="language-json"><code class="lang-json">CellMetadata {
<strong>    key: string;
</strong>    value: string;
    type?: string;
    pinned?: boolean;
    config?: {
        backgroundColor: string;
        color: string;
        borderColor: string;
    }
}
</code></pre>

**Metadata object structure**:

* **key**: Identifier for the metadata item, represented as a string. Example: `"author"` .
* **value**: Content or data of the metadata item, represented as a string. Example: `"John Doe"` .
* **type** (optional): [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) used to display the metadata.
  * **Default**: `text/plain`
  * **Supported types**:
    * `text/plain`**:** Displays metadata as plain text.
    * `text/html`: Displays metadata as HTML content.
    * `image/*`**:** Displays metadata as an image. Supported image formats depend on [browser support](https://en.wikipedia.org/wiki/Comparison_of_browser_engines_\(graphics_support\)).
    * `audio/*`**:** Displays metadata as an audio player. Supported audio formats depend on [browser support](https://en.wikipedia.org/wiki/HTML5_audio#Supported_audio_coding_formats).
* **pinned** (optional): If `true`, the metadata appears at the top of the cell. Otherwise, it is available in the Metadata extension panel.
* **config** (optional): Customizes the appearance of `text/plain` metadata. All color fields support standard HTML color names and color codes.
  * **color:** Determines the text color of the metadata.
  * **backgroundColor:** Determines the background color of the metadata.
  * **borderColor:** Determines the border color of the metadata.

## Sample files

Below are sample files for span labeling and row labeling projects that include metadata.

{% file src="/files/JCAwZPTSMLA8a1dqXBmZ" %}

{% file src="/files/Bs72ZclTPFs3wngJ6uo0" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datasaur.ai/advanced/extensions/metadata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
