# Catalog

> Download your full catalog, with your prices, as Excel or JSON.

```http
GET https://api.prod.myvink.be/catalog/{format}
```

Returns your full catalog with your own prices as one file. Vink generates the file a few times a day, so the response is fast and always complete.

You need a catalog key, see [Getting started](/getting-started/).

## Parameters

| Parameter | In | Values | Required |
|---|---|---|---|
| `format` | path | `xlsx`, `json` | yes |
| `locale` | query | `nl`, `fr`, `en`, `de` | no. Without it you get the first language of your catalog |
| `If-None-Match` | header | the `ETag` of your last download | no |

| `format` | Content type | File |
|---|---|---|
| `xlsx` | `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` | Excel workbook, one row per article |
| `json` | `application/json` | Array with one object per article |

The `Content-Disposition` header suggests a file name, for example `vink-catalogus-005211-fr.json`.

## Examples

JSON in French:

```sh
curl -sS -H "Authorization: Bearer $VINK_API_KEY" \
  -o catalog.json \
  "https://api.prod.myvink.be/catalog/json?locale=fr"
```

Excel in Dutch:

```sh
curl -sS -H "Authorization: Bearer $VINK_API_KEY" \
  -o catalog.xlsx \
  "https://api.prod.myvink.be/catalog/xlsx?locale=nl"
```

## Download only when something changed

Every response has an `ETag`. Store it with the file and send it back in `If-None-Match`. When the catalog has not changed, you get `304 Not Modified` without a body.

```sh
curl -sS -H "Authorization: Bearer $VINK_API_KEY" \
  -H 'If-None-Match: "500000-18a2b3c4d5e6f700"' \
  -D headers.txt -o catalog.json \
  https://api.prod.myvink.be/catalog/json
```

`Last-Modified` tells you when the file was generated. `Cache-Control` is always `private, no-cache`.

## How often to fetch

The file changes a few times a day. Fetching once an hour, with `If-None-Match`, is plenty. A `304` also counts toward the [rate limits](/rate-limits/).

## Errors

| HTTP | Code | Meaning |
|---|---|---|
| 400 | `INVALID_FORMAT` | Unknown format |
| 400 | `INVALID_LOCALE` | Unknown locale |
| 400 | `AMBIGUOUS_KEY` | Two different API keys |
| 401 | `UNAUTHORIZED` | The API key is missing, unknown, paused, or not a catalog key. |
| 404 | `CATALOG_NOT_READY` | Your catalog has not been generated yet. Try again later. |
| 429 | `RATE_LIMITED` | Too many requests from your IP address or with your API key. |
| 502 | `UPSTREAM_ERROR` | A Vink system behind the API did not answer. Try again later. |

[Errors](/errors/) explains what to do for each code. The full request and response definitions are in the [API reference](/reference/).
