> ## Documentation Index
> Fetch the complete documentation index at: https://api-reference.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Export Dataset

> Exports all DatasetItems and associated Annotations of a Dataset for use with model training.

> [!NOTE]
>
> **[Click for Python SDK](https://docs.nucleus.scale.com/en/latest/api/nucleus/index.html#nucleus.Dataset.items_and_annotations)**
>
> ```
> Dataset.items_and_annotations() -> List[
>     Dict[str, Union[
>         DatasetItem,
>         Dict[str, List[Annotation]]]
>     ]
> ]
> ```

This endpoint exports all DatasetItems and associated Annotations of a Dataset for use with model training.

In order to speed up the export, the following Annotation attributes are not included in the payload:

* Annotation IDs
* Annotation-level metadata
* Reference IDs for annotations (since they are pulled down for the DatasetItem already)

This endpoint will time out for very large datasets or slices (>200k items) for now, but an async endpoint is coming soon.


## OpenAPI

````yaml openapi/nucleus.json GET /dataset/{dataset_id}/exportForTraining
openapi: 3.1.0
info:
  title: Nucleus API
  version: '1.1'
servers:
  - url: https://api.scale.com/v1/nucleus
security:
  - sec0: []
paths:
  /dataset/{dataset_id}/exportForTraining:
    get:
      summary: Export Dataset
      description: >-
        This endpoint exports all DatasetItems and associated Annotations of a
        Dataset for use with model training.


        In order to speed up the export, the following Annotation attributes are
        not included in the payload:

        * Annotation IDs

        * Annotation-level metadata

        * Reference IDs for annotations (since they are pulled down for the
        DatasetItem already)


        This endpoint will time out for very large datasets or slices (>200k
        items) for now, but an async endpoint is coming soon.
      operationId: export-dataset
      parameters:
        - name: dataset_id
          in: path
          description: The Scale-generated ID of the Dataset.
          schema:
            type: string
          required: true
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    - item:
                        original_image_url: https://your-bucket/example.png
                        dataset_item_id: di_zwyt15cag2301b902cw0
                        reference_id: image_ref_300000
                        metadata:
                          License Plate: ZPH-J27
                          Recording Date: '2019-09-15'
                          Recording Time: '14:24:21'
                          weather: sunny
                          camera: back
                      annotations:
                        box:
                          - label: car
                            type: box
                            geometry:
                              x: 648.1969604492188
                              'y': 264.34417724609375
                              width: 70.560546875
                              height: 50.55670166015625
                          - label: car
                            type: box
                            geometry:
                              x: 720.8001098632812
                              'y': 246.6089324951172
                              width: 139.6986083984375
                              height: 114.38755798339844
              schema:
                type: array
                items:
                  type: object
                  properties:
                    item:
                      type: object
                      properties:
                        original_image_url:
                          type: string
                          example: https://your-bucket/example.png
                        dataset_item_id:
                          type: string
                          example: di_zwyt15cag2301b902cw0
                        reference_id:
                          type: string
                          example: image_ref_300000
                        metadata:
                          type: object
                          properties:
                            License Plate:
                              type: string
                              example: ZPH-J27
                            Recording Date:
                              type: string
                              example: '2019-09-15'
                            Recording Time:
                              type: string
                              example: '14:24:21'
                            weather:
                              type: string
                              example: sunny
                            camera:
                              type: string
                              example: back
                    annotations:
                      type: object
                      properties:
                        box:
                          type: array
                          items:
                            type: object
                            properties:
                              label:
                                type: string
                                example: car
                              type:
                                type: string
                                example: box
                              geometry:
                                type: object
                                properties:
                                  x:
                                    type: number
                                    example: 648.1969604492188
                                    default: 0
                                  'y':
                                    type: number
                                    example: 264.34417724609375
                                    default: 0
                                  width:
                                    type: number
                                    example: 70.560546875
                                    default: 0
                                  height:
                                    type: number
                                    example: 50.55670166015625
                                    default: 0
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: {}
              schema:
                type: object
                properties: {}
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````