# export

`imerit_ango.sdk.SDK.`

## export(project\_id, options, zip\_file\_path)

Export data from your project.

### Parameters

* **project\_id:** string
  * The unique identifier for the project. You can find the project ID in [the user interface](/sdk/sdk-documentation.md#project-ids) or retrieve it using the [`list_projects`](/sdk/sdk-documentation/project-level-sdk-functions/list_projects.md) function.
* **options:** ExportOptions, *default ExportOptions()*

  * An instance of the `ExportOptions` class, which defines the configurations for the export operation.
  * **ExportOptions** class

    * **stage:** List\[str], *default \['Complete']*
      * A list of stage IDs to include in the export. Use the [`get_project`](/sdk/sdk-documentation/project-level-sdk-functions/get_project.md) function to retrieve IDs.
      * Example: `["Complete", "a0000b0a-1111-0a00-a1a1-a111111111aa"]`
      * **Note:** Use an empty list to get all stages such as `stage = []`
      * **Warning:** The IDs of the ***Complete***, ***Start*** and initial ***Label*** stages are identical to their names: **"Complete"**, **"Start"** and **"Label"**, respectively.
    * **batches:** List\[str], *default None*
      * Filter export by specific batch IDs. Use the [`get_batches`](/sdk/sdk-documentation/project-level-sdk-functions/get_batches.md) function to retrieve IDs.
    * **task\_type:** TaskTypes, *default None*
      * Type of the exported data.
      * Options:
        * <kbd>TaskTypes.BENCHMARK</kbd>
        * <kbd>TaskTypes.CONSENSUS</kbd>
        * <kbd>TaskTypes.DEFAULT</kbd>&#x20;

    <pre class="language-python"><code class="lang-python"><strong>from imerit_ango.models.enums import TaskTypes
    </strong></code></pre>

    * **export\_format:** ExportFormats, *default ExportFormats.JSON*
      * The format used for the exported output data.
      * **Options:**
        * <kbd>ExportFormats.JSON</kbd>
        * <kbd>ExportFormats.NDJSON</kbd>&#x20;

    <pre class="language-python"><code class="lang-python"><strong>from imerit_ango.models.enums import ExportFormats
    </strong></code></pre>

    * **export\_type:** ExportTypes, *default ExportTypes.TASK*
      * Type of export.
      * **Options:**
        * <kbd>ExportTypes.TASK</kbd>
        * <kbd>ExportTypes.ISSUE</kbd>

    <pre class="language-python"><code class="lang-python"><strong>from imerit_ango.models.enums import ExportTypes
    </strong></code></pre>

    * **include\_key\_frames\_only:** bool, *default False*
      * If True, only exports key frames (for video assets).
    * **send\_email:** bool, *default False*
      * If True, sends a notification email when export completes.
    * **include\_metadata:** bool, *default True*
      * If True, includes metadata with assets.
    * **include\_history:** bool, *default True*
      * If True, includes annotation history.
    * **notify:** bool, *default False*
      * If False, suppresses system notifications.
    * **updated\_at:** TimeFilter, *default None*
      * Filter assets by update timestamp. **Updated At** attribute displays the date and time when the task was last updated, this includes the most recent submission, save, or skip.
    * **created\_at:** TimeFilter, *default None*
      * Filter assets by creation timestamp. **Created At** attribute shows the date and time when the asset was imported into Ango Hub.

  ```python
  from imerit_ango.models.export_options import ExportOptions
  ```

  * **TimeFilter** class
    * **from\_date:** datetime, *default None*
      * Start date for filtering.
    * **to\_date:** datetime, *default None*
      * End date for filtering.

  ```python
  from imerit_ango.models.export_options import TimeFilter
  ```
* **zip\_file\_path**: string, optional, *default None*
  * If specified, exports are downloaded directly as a .zip file instead of being returned as a Python object. This avoids server-side unzipping and speeds up export.
  * **Example:** `"/Users/username/Downloads/my_export.zip"`

Returns:

* **output:** list
  * A dictionary containing the result of the operation.
  * Including a `status` field indicating whether the request was successful and a `data` field containing the response payload with updated resources produced by the operation.

{% hint style="warning" %}
The project must contain annotated assets, and the selected filters should include them; otherwise, the export will return empty.
{% endhint %}

{% hint style="info" %}
Large export operations may require significant processing time depending on project size, annotation density, and export configuration.

Using filters such as batches or stages can significantly improve export performance.
{% endhint %}

### Example

Export all assets in the Complete stage:

{% tabs %}
{% tab title="python" %}

```python
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

export_data = ango_sdk.export(project_id=project_id)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X GET "https://imeritapi.ango.ai/v2/export \
  ?sendEmail=false \
  &includeMetadata=true \
  &includeHistory=true \
  &doNotNotify=true \
  &format=json \
  &type=task \
  &includeOnlyKeyFrames=false \
  &includeIdleBlurDurations=false \
  &stage=[\"Complete\"] \
  &project=$PROJECT_ID" \
  -H "apikey: $ANGO_API_KEY"
```

{% endtab %}
{% endtabs %}

Export assets filtered by created and updated time:

{% tabs %}
{% tab title="python" %}

```python
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from datetime import datetime, timedelta
from imerit_ango.models.enums import ExportFormats
from imerit_ango.models.export_options import ExportOptions, TimeFilter

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

export_options = ExportOptions(
    export_format=ExportFormats.JSON,
    updated_at=TimeFilter(from_date=datetime.now() - timedelta(days=7), to_date=datetime.now()),
    created_at=TimeFilter(from_date=datetime.now() - timedelta(days=30), to_date=datetime.now()),
    stage=["Complete"]
)

export_data = ango_sdk.export(project_id=project_id, options=export_options)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X GET "https://imeritapi.ango.ai/v2/export \
  ?sendEmail=false \
  &includeMetadata=true \
  &includeHistory=true \
  &doNotNotify=true \
  &format=json \
  &type=task \
  &includeOnlyKeyFrames=false \
  &includeIdleBlurDurations=false \
  &stage=[\"Complete\"] \
  &updatedAt={\"$gt\":\"2020-08-19T07:37:15.000000Z\",\"$lt\":\"2020-08-26T07:37:15.000000Z\"} \
  &createdAt={\"$gt\":\"2020-07-27T07:37:15.000000Z\",\"$lt\":\"2020-08-26T07:37:15.000000Z\"} \
  &project=$PROJECT_ID" \
  -H "apikey: $ANGO_API_KEY"
```

{% endtab %}
{% endtabs %}

Export assets in NDJSON format:

{% tabs %}
{% tab title="python" %}

```python
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from imerit_ango.models.enums import ExportFormats
from imerit_ango.models.export_options import ExportOptions

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

export_options = ExportOptions(export_format=ExportFormats.NDJSON, stage=["Complete"])
export_generator, num_assets = ango_sdk.export(project_id=project_id, options=export_options)

print(f"Number of exported assets: {num_assets}")

for asset in export_generator:
    print(asset.get("externalId", ""))
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X GET \
  "https://imeritapi.ango.ai/v2/export \
    ?sendEmail=false \
    &includeMetadata=true \
    &includeHistory=true \
    &doNotNotify=true \
    &format=ndjson \
    &type=task \
    &includeOnlyKeyFrames=false \
    &includeIdleBlurDurations=false \
    &stage=[\"Complete\"] \
    &project=$PROJECT_ID" \
  -H "apikey: $ANGO_API_KEY"
```

{% endtab %}
{% endtabs %}

Export benchmark tasks:

{% tabs %}
{% tab title="python" %}

```python
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from imerit_ango.models.enums import TaskTypes
from imerit_ango.models.export_options import ExportOptions

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

export_options = ExportOptions(task_type=TaskTypes.BENCHMARK)
benchmark_export = ango_sdk.export(project_id=project_id, options=export_options)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X GET \
  "https://imeritapi.ango.ai/v2/export \
    ?sendEmail=false \
    &includeMetadata=true \
    &includeHistory=true \
    &doNotNotify=true \
    &format=json \
    &type=task \
    &includeOnlyKeyFrames=false \
    &includeIdleBlurDurations=false \
    &taskTypes=[\"benchmark\"] \
    &project=$PROJECT_ID" \
  -H "apikey: $ANGO_API_KEY"
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**See also**

[get\_assets](/sdk/sdk-documentation/project-level-sdk-functions/get_assets.md), [get\_tasks](/sdk/sdk-documentation/project-level-sdk-functions/get_tasks.md)
{% endhint %}


---

# Agent Instructions: 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.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/export.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.
