# Get an optimization

Returns an optimization job's status, and once it succeeds, the download link and the optimization score of the optimized file.

`GET https://realpng.com/api/v1/optimize/{id}`

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string, uuid | Yes |  |

## Responses

### 200

The job. A failed job carries the error. video_too_long: the video runs past seconds, 3 minutes or 5,400 frames.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string, uuid | Yes |  |
| `status` | `queued`, `running`, `succeeded`, `failed` | Yes |  |
| `media` | `image`, `video` | Yes |  |
| `file_url` | string, uri | No | Once succeeded, the optimized PNG or MP4. No key needed. |
| `image_url` | string, uri | No | Once an image succeeded, the same file as file_url. No key needed. |
| `video` | object | No | Once a video succeeded |
| `expires_at` | string, date-time | No |  |
| `optimization_score` | object | No | Once succeeded |
| `error` | object | No | Once failed. Branch on code |

### 401

invalid_key: the key is missing, malformed, unknown or revoked

### 402

plan_required: the plan has no API access. payment_failed: the last payment failed, update the card to resume.

### 404

not_found: no optimization with that id on this account, or it expired. unknown_job: the optimization expired.

### 429

rate_limited: over the plan's requests a minute, with Retry-After in seconds.

### default

A problem, with a stable code

Every error has a `code` and a `message`, listed on [Errors](/docs/errors).
