Output formats (Content API)
1. JSON and JSON-LD response formats
The Content API returns data primarily in JSON format. You can optionally receive responses in JSON-LD format, which models data using the schema.org vocabulary, by setting the appropriate HTTP header.
To request JSON-LD output, set the Accept header to application/ld+json. The Content API will return structured data compatible with schema.org types when available.
- curl
- Go
curl "https://tourism.api.opendatahub.com/v1/Hotel/123" \
-H "Accept: application/ld+json" \
-H "Authorization: Bearer $TOKEN"
req, _ := http.NewRequest("GET", "https://tourism.api.opendatahub.com/v1/Hotel/123", nil)
req.Header.Set("Accept", "application/ld+json")
req.Header.Set("Authorization", "Bearer "+token)
JSON-LD format is not supported for all data types. Currently, the Content API supports JSON-LD for the following types:
- Hotel
- Restaurant
- Event
- TouristAttraction
- Recipe
- SkiResort
- Place
For unsupported types, the API returns standard JSON regardless of the Accept header.
2. Response structure and metadata
All Content API responses include metadata that describes the result set, along with the actual data in the Items array.
2.1. Search and list response metadata
When using endpoints like /v1/Filter or /v1/Find, the response includes pagination and summary metadata:
| Field | Type | Description |
|---|---|---|
TotalResults | integer | Total number of results matching the query |
TotalPages | integer | Total number of pages available |
CurrentPage | integer | Current page number in the result set |
Seed | string | Random seed used for consistent pagination |
Items | array | Array of result objects |
Example response:
{
"TotalResults": 10564,
"TotalPages": 705,
"CurrentPage": 1,
"OnlineResults": -1,
"Seed": "43",
"Items": [
{
"Id": "AF3EA703C8563631497597C0ADAF75B6",
"AccoDetail.en.Name": "Appartement Drei Zinnen/Three Peaks",
"_Meta.Type": "accommodation",
"Self": "https://tourism.api.opendatahub.com/v1/Accommodation/AF3EA703C8563631497597C0ADAF75B6"
}
]
}
The Seed parameter ensures consistent sorting across paginated requests. If you retrieve the first page with Seed: "43", use that same seed value when requesting subsequent pages to avoid duplicate or missing results.
2.2. Individual result fields
Each item in the Items array contains core fields:
| Field | Description |
|---|---|
Id | Unique identifier for the resource |
Type or _Meta.Type | Content type of the resource |
Title or language-specific title field | Display name of the resource |
Link or Self | Direct URL to retrieve the full resource |