# Using Reference Data

The [Reference Data API](/catalog/reference-data/reference-data/openapispecification) gives the master data shared by Trace One applications: allergens, nutrients, countries, units of measure, reference lists and more. Specifications reference these values by ID; read them here to show their names.

Base URL: `https://apis.traceone.com/reference-data/v2`

## Reference lists and functional lists

Reference data comes in two kinds.

### Reference lists

Generic lists of values, such as preservation methods or storage conditions. They are used for dropdowns and form fields. A retailer may customise some of them.

Read them with `/lists/{listName}`. The API reference lists the available names, for example `preservation-method`, `storage-condition-temperature`, `trade-item-status`, `languages`.

### Functional lists

Master data with a meaning defined by Trace One, used for formulation, labelling and compliance. Customers do not configure them. Each has its own resource:

| Data | Resource |
|  --- | --- |
| Allergens | `/allergens` |
| Nutrients | `/nutrients` |
| Countries and country divisions | `/countries`, `/country-divisions` |
| Fishing zones and fishing gears | `/fishing-zones`, `/fishing-gears` |
| Harmonized (HS) codes | `/harmonized-codes` |
| Markets | `/markets` |
| Raw material classifications and parts | `/raw-material-classifications`, `/raw-material-parts` |
| Substances and substance functions | `/substances`, `/substance-functions` |
| Units of measure | `/units-of-measure`, `/unit-of-measure-groups` |


## Read all items of a reference list

```http
GET https://apis.traceone.com/reference-data/v2/lists/preservation-method?languageCode=en-US
Authorization: Bearer YOUR_TOKEN
```

Optional query parameters:

- `languageCode` — language of the labels, for example `en-US`, `fr-FR`
- `companyId` — for lists with values specific to a company


## Read one item

```http
GET https://apis.traceone.com/reference-data/v2/lists/languages/123e4567-e89b-12d3-a456-426614174000
Authorization: Bearer YOUR_TOKEN
```

The answer is `404 Not Found` when the item does not exist in the list, or has no translation in the requested language.

## Read many items by ID

Some functional lists take a `POST` with a list of IDs, for example allergens:

```http
POST https://apis.traceone.com/reference-data/v2/allergens
Content-Type: application/json

{
  "allergenIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  ]
}
```

## Languages

Use `languageCode` to get the labels in another language:

```http
GET https://apis.traceone.com/reference-data/v2/lists/trade-item-status?languageCode=fr-FR
```

Without it, labels are in English (`en-US`).

## Cache reference data

Reference data changes rarely. Cache it on your side, for example for a day, instead of reading it for every specification you process.

For the full list of operations, see the [Reference Data API reference](/catalog/reference-data/reference-data/openapispecification). Every call needs a token: see [Authentication](/getting-started/authentication).