# Export Slice

[block:callout]
{
  "type": "info",
  "title": "[Click for Python SDK](https://docs.nucleus.scale.com/en/latest/api/nucleus/index.html#nucleus.Slice.items_and_annotation_generator)",
  "body": "```\nSlice.items_and_annotation_generator() -> List[\n    Dict[str, Union[\n        DatasetItem,\n        Dict[str, List[Annotation]]]\n    ]\n]\n```"
}
[/block]

This endpoint exports all DatasetItems and associated Annotations of a Slice for use with model training page-by-page.

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)

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Nucleus API",
    "version": "1.1"
  },
  "servers": [
    {
      "url": "https://api.scale.com/v1/nucleus"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/slice/{slice_id}/exportForTrainingPage": {
      "post": {
        "summary": "Export Slice",
        "description": "",
        "operationId": "export-slice",
        "parameters": [
          {
            "name": "slice_id",
            "in": "path",
            "description": "The Scale-generated ID of the Slice.",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pageToken": {
                    "type": "string",
                    "description": "The `dataset_item_id` after which to start fetching items in the next page. Can be null (fetches the first page of items)."
                  },
                  "pageSize": {
                    "type": "integer",
                    "description": "The size of the fetched page. The maximum is 10000 items.",
                    "default": 10000,
                    "format": "int32"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "60a66ff6bfbc7000736519dd:630d252c24328500a410a5c4"
}
```