# Data formats (https://eulabel.eu/docs/documentation/integrations/data-formats)

> Fetch the complete documentation index at: https://eulabel.eu/docs/llms.txt
> Use this file to discover all available pages before exploring further.
> Full content: https://eulabel.eu/docs/llms-full.txt
> Append .md to any page URL for markdown, or send Accept: text/markdown.



A published passport is public at one URL, as JSON or as JSON-LD (linked data that search engines and other machines can read). Your `Accept` header picks the format, and no API key is needed.

**Video: JSON and JSON-LD from the same URL** (https://pub-7ea90ccdf0f545b3ad4613d72e450782.r2.dev/json-ld.mp4). In a terminal: JSON and JSON-LD returned from the same URL.

| You want | Request | Returns |
| --- | --- | --- |
| Passport as JSON | `GET https://eulabel.eu/p/api/passport/{productId}` | `application/json` |
| Passport as JSON-LD | The same URL with `Accept: application/ld+json` | `application/ld+json` |
| Passport with restricted fields | The same URL with `Authorization: Bearer <token>` | The fields [your token](https://eulabel.eu/docs/knowledge-base/guides/restricted-access) allows |
| Links for a product | The Digital Link. See [Linkset](https://eulabel.eu/docs/documentation/integrations/linkset). | `application/linkset+json` |
| Your own data, drafts included | `GET https://api.eulabel.eu/v1/products/{id}/passport` with an API key | `application/json` |

The URL returns `404` until the passport is published, and again after it is withdrawn. Responses carry `Vary: Authorization, Accept`, so a cache keeps each version apart.

> **Warning**
> `Accept: application/ld+json` on the Digital Link returns the linkset as JSON-LD, not the passport. It also does nothing on `api.eulabel.eu`, which always returns JSON. For the passport, call the URL above.

## Read the JSON-LD
#### cURL


```bash
curl https://eulabel.eu/p/api/passport/8f9dbe9a-2b25-4a30-9fa6-abf8507adfb3 \
  -H "Accept: application/ld+json"
```

#### JavaScript


```javascript
const url = 'https://eulabel.eu/p/api/passport/8f9dbe9a-2b25-4a30-9fa6-abf8507adfb3';
const res = await fetch(url, { headers: { Accept: 'application/ld+json' } });
if (!res.ok) throw new Error(`Not available: ${res.status}`);

const jsonLd = await res.json();
console.log(jsonLd['@type'], jsonLd.gtin14);
```

#### Python


```python
import requests

url = "https://eulabel.eu/p/api/passport/8f9dbe9a-2b25-4a30-9fa6-abf8507adfb3"
res = requests.get(url, headers={"Accept": "application/ld+json"})
res.raise_for_status()

json_ld = res.json()
print(json_ld["@type"], json_ld["gtin14"])
```

Response for the wine from the [quickstart](https://eulabel.eu/docs/documentation/get-started/quickstart):

```json
{
  "@context": ["https://schema.org", { "gs1": "https://gs1.org/voc/" }],
  "@type": "Product",
  "@id": "https://eulabel.eu/01/05609793419652",
  "name": "Quinta Demo Tinto 2024",
  "brand": { "@type": "Brand", "name": "Quinta Demo" },
  "gtin14": "05609793419652",
  "category": "wine",
  "hasIngredientList": "Grapes, Preservative: sulphites",
  "nutrition": {
    "@type": "NutritionInformation",
    "servingSize": "100 mL",
    "calories": "83 kcal",
    "fatContent": "0 g",
    "saturatedFatContent": "0 g",
    "carbohydrateContent": "2.6 g",
    "sugarContent": "0.6 g",
    "proteinContent": "0 g",
    "sodiumContent": "0 g"
  },
  "allergenInfo": "Sulphites",
  "countryOfOrigin": { "@type": "Country", "name": "Portugal", "identifier": "PT" },
  "manufacturer": { "@type": "Organization", "name": "Quinta Demo, Lda." }
}
```

The same JSON-LD is embedded in the passport page, in a `<script type="application/ld+json">` tag.

## Read the JSON
The same call without the `Accept` header:

```json
{
  "productId": "8f9dbe9a-2b25-4a30-9fa6-abf8507adfb3",
  "audience": "public",
  "profileVersion": "wine/2026.10",
  "restricted": { "legitimateInterest": 0, "authorityOnly": 0 },
  "passport": { "productType": "wine", "ingredients": ["Grapes", "Preservative: sulphites"] },
  "product": {
    "internalId": "8f9dbe9a-2b25-4a30-9fa6-abf8507adfb3",
    "gtin": "05609793419652",
    "name": "Quinta Demo Tinto 2024",
    "category": "wine",
    "brand": "Quinta Demo",
    "links": []
  },
  "publishedAt": "2026-11-01T00:38:24.312Z"
}
```

`passport` is shortened here. `restricted` counts the fields withheld from you, and it is zero for wine because wine has no restricted data.

## OpenAPI contract
The REST API is described at `https://api.eulabel.eu/openapi.yaml`. For AI agents, read `https://api.eulabel.eu/llms.txt` and `https://eulabel.eu/docs/llms.txt`.

