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

# Download Task Trajectory

> Downloads the trajectory for a completed browsing task.

Downloads the trajectory for a completed browsing task.

## Output Formats

Use the `output_type` query parameter to choose between two formats:

### JSON (default)

Returns a JSON object with base64-encoded images:

```json theme={null}
{
  "task_id": "00000000-0000-0000-0000-000000000000",
  "steps": [
    { "step": 1, "image": "<base64-encoded-webp>" },
    { "step": 2, "image": "<base64-encoded-webp>" }
  ]
}
```

### ZIP

Returns a downloadable ZIP archive containing:

* `trajectory.json`

```json theme={null}
{
  "task_id": "00000000-0000-0000-0000-000000000000",
  "steps": [
    { "step": 1, "image_filename": "step_001.webp" },
    { "step": 2, "image_filename": "step_002.webp" }
  ]
}
```

* `step_001.webp`, `step_002.webp`, ... - Screenshot images in WEBP format

<RequestExample>
  ```bash cURL (JSON) theme={null}
  curl --request GET \
    --url "https://api.yutori.com/v1/browsing/tasks/00000000-0000-0000-0000-000000000000/trajectory" \
    --header "X-API-Key: YOUR_API_KEY"
  ```

  ```bash cURL (ZIP) theme={null}
  curl --request GET \
    --url "https://api.yutori.com/v1/browsing/tasks/00000000-0000-0000-0000-000000000000/trajectory?output_type=zip" \
    --header "X-API-Key: YOUR_API_KEY" \
    --output trajectory.zip
  ```

  ```python Python theme={null}
  import requests

  # JSON format (default)
  response = requests.get(
      "https://api.yutori.com/v1/browsing/tasks/00000000-0000-0000-0000-000000000000/trajectory",
      headers={"X-API-Key": "YOUR_API_KEY"}
  )
  trajectory = response.json()

  # ZIP format
  response = requests.get(
      "https://api.yutori.com/v1/browsing/tasks/00000000-0000-0000-0000-000000000000/trajectory",
      headers={"X-API-Key": "YOUR_API_KEY"},
      params={"output_type": "zip"}
  )
  with open("trajectory.zip", "wb") as f:
      f.write(response.content)
  ```

  ```javascript JavaScript theme={null}
  // JSON format (default)
  const response = await fetch(
    "https://api.yutori.com/v1/browsing/tasks/00000000-0000-0000-0000-000000000000/trajectory",
    {
      method: "GET",
      headers: { "X-API-Key": "YOUR_API_KEY" }
    }
  );
  const trajectory = await response.json();

  // ZIP format
  const zipResponse = await fetch(
    "https://api.yutori.com/v1/browsing/tasks/00000000-0000-0000-0000-000000000000/trajectory?output_type=zip",
    {
      method: "GET",
      headers: { "X-API-Key": "YOUR_API_KEY" }
    }
  );
  const blob = await zipResponse.blob();
  ```
</RequestExample>


## OpenAPI

````yaml GET /v1/browsing/tasks/{id}/trajectory
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.yutori.com
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /v1/browsing/tasks/{id}/trajectory:
    get:
      tags:
        - Browsing
      summary: Download Task Trajectory
      description: Downloads the trajectory for a completed browsing task.
      operationId: get_task_trajectory_v1_browsing_tasks__id__trajectory_get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: Id
        - name: output_type
          in: query
          required: false
          schema:
            enum:
              - json
              - zip
            type: string
            description: 'Output format: ''json'' or ''zip'''
            default: json
            title: Output Type
          description: 'Output format: ''json'' or ''zip'''
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header

````