---
title: "Download result"
description: "Stream the SimReady USD (or MJCF) for a completed conversion as a ZIP."
---

import { Tabs, TabItem, Aside } from '@astrojs/starlight/components';

Download the result of a completed conversion as a ZIP archive.

| | |
|---|---|
| **Method** | `GET` |
| **Path**   | `/api/conversions/:id/result` |
| **Returns** | streaming `application/zip` |

## Query parameters

| Param    | Values                  | Default | Notes                                                                  |
| -------- | ----------------------- | ------- | ---------------------------------------------------------------------- |
| `format` | `usd` · `mjcf` · `all`  | `all`   | `usd` = USD + textures only. `mjcf` = MuJoCo XML package. `all` = both. |

## Examples

<Tabs syncKey="lang">
  <TabItem label="curl">
  ```bash
  curl -L "https://api.rigyd.com/api/conversions/abc123.../result?format=usd" \
    -H "Authorization: Bearer rgyd_live_..." \
    -o simready.zip
  ```
  </TabItem>
  <TabItem label="JavaScript">
  ```js
  import fs from 'node:fs';
  import { Readable } from 'node:stream';

  const res = await fetch(
    `https://api.rigyd.com/api/conversions/${jobId}/result?format=usd`,
    { headers: { Authorization: `Bearer ${process.env.RIGYD_API_KEY}` } },
  );
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
  await new Promise((resolve, reject) => {
    Readable.fromWeb(res.body)
      .pipe(fs.createWriteStream('simready.zip'))
      .on('finish', resolve).on('error', reject);
  });
  ```
  </TabItem>
  <TabItem label="Python">
  ```python
  import os, requests

  with requests.get(
      f"https://api.rigyd.com/api/conversions/{job_id}/result",
      headers={"Authorization": f"Bearer {os.environ['RIGYD_API_KEY']}"},
      params={"format": "usd"},
      stream=True,
  ) as res:
      res.raise_for_status()
      with open("simready.zip", "wb") as out:
          for chunk in res.iter_content(chunk_size=1024 * 1024):
              out.write(chunk)
  ```
  </TabItem>
</Tabs>

## ZIP contents

| `format` | Contents                                              |
| -------- | ----------------------------------------------------- |
| `usd`    | `*.usd` + `*.png` / `*.jpg` textures referenced by it |
| `mjcf`   | MuJoCo `*.xml` + meshes + textures                    |
| `all`    | Both, in separate sub-directories                     |

## Errors specific to this endpoint

| Status | Body                                                          | When |
| ------ | ------------------------------------------------------------- | ---- |
| `400`  | `{ "error": "Invalid format. Expected one of: usd, mjcf, all" }` | Bad `format` value |
| `404`  | `{ "error": "Conversion job not found" }`                     | Bad `id` or not your job |
| `404`  | `{ "error": "MJCF package is not available for this conversion" }` | `format=mjcf` but the pipeline did not produce an MJCF package |
| `409`  | `{ "error": "Job not yet completed", "status": "running" }`   | Job is still in flight |
| `502`  | upstream fetch failure                                        | Underlying media store unreachable |

<Aside type="tip">
  Result downloads are unauthenticated *after* the redirect — the URL is signed and short-lived. Don't cache them long-term; re-call this endpoint when you need the result again.
</Aside>