EU Trade Explorer Theme API
The theme builder: an organisation's two brand colours in, chart palettes for day, night and print and the interface colours of day and night out. Registered users only.
The theme builder: an organisation's two brand colours in, chart palettes for day, night and print and the interface colours of day and night out. Registered users only.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/tradedashboard-eu:tradedashboard-eu-theme-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: EU Trade Explorer Theme API
description: 'HTTP REST API for the EU Trade Explorer, serving Eurostat Comext (customs trade) and
PRODCOM (industrial production) statistics for the Combined Nomenclature. > Bridge to the tradedashboard.eu EU Trade Explorer — access the same data via REST endpoints or, for LLM agents, via the MCP bridge at mcp.tradedashboard.eu. ## Typical Workflow
1. **Resolve the product**: If you don''t already know the right Combined Nomenclature (CN) customs code, use `/api/reference/search` with a keyword (e.g. "glass jars") and `/api/reference/validate-customs-code/{customs_code}` for a candidate code. Note that CN nomenclature is often coarser than a colloquial product name: there is no code for "glass jars" alone, only a heading (7010) that bundles jars with bottles and closures; check `has_subcodes` and the returned hierarchy before assuming a code is a clean match. 2. **Choose your path**:
- **Short path**: Call `/api/descriptive/overview` for the headline totals. For a quick analysis, that plus `/api/descriptive/partner-detail` and `/api/concentration/concentration` is often enough. - **Long path**: There are ~25 analytical endpoints you can call iteratively depending on your angle: drill into `/api/descriptive/reporter-detail`, `/api/concentration/specialisation`, `/api/vulnerability/net-import-reliance`, etc. as needed. ## Request Model
Every analytical endpoint takes the same `DashboardQuery` JSON body:
- `customs_code`: Combined Nomenclature code(s) -- one code or a list; each code is one basket over the full requested period
- `baskets`: the explicit form of the customs-code selection (a list of baskets, each a list of `(customs_code, optional from/to month)` pieces summed into one line) -- use it to clip a code to specific months or to chain successor codes; exactly one of `customs_code` and `baskets`
- `reporter`: Declaring entity (EU Member State, etc.)
- `partner_set`: Named partner preset or custom list
- `period_start`, `period_end`: Analysis window (YYYY-MM format)
- `frequency`: ''month'', ''quarter'', or ''year''
- Plus endpoint-specific query parameters (`entity_level`, `flow`, `partner`, detection thresholds, ...)
## Streaming Responses
The analytical endpoints under `/api/descriptive`, `/api/concentration`, `/api/volatility`, `/api/vulnerability`, `/api/autonomy` and `/api/production` do not return a single JSON object. They stream newline-delimited JSON (`application/jsonl`): zero or more `{"type": "progress", "message": ...}` lines while Eurostat data loads, then exactly one terminal frame — either `{"type": "result", "data": ...}` or `{"type": "error", "detail": ..., "status": ...}`. Many endpoints also accept a `compact=true` query parameter to condense long numeric time series into summary statistics (first/last/min/max/mean/pct_change) instead of full series. Use this when you just want main trends; omit it when identifying shocks and outliers. ## Authentication & Access
Everything under `/api/reference` and `/api/auth` is public and unlimited. The analytical endpoints (`/api/descriptive`, `/api/concentration`,
`/api/volatility`, `/api/vulnerability`, `/api/autonomy`, `/api/production`)
require registration: anonymous calls for non-demonstration customs codes
get HTTP 401 with a registration invitation. The only anonymous exception:
queries made entirely of the dashboard''s welcome-page demonstration
customs codes, which stay fully browsable without an account, on every
analytical endpoint. Registering is free and currently unlimited — register once, then
use one of:
- A signed-in session cookie (from the dashboard UI)
- A personal API key sent as `Authorization: Bearer ...` or `X-API-Key`
- OAuth 2.1 authentication (for programmatic/headless clients)
See `/.well-known/oauth-authorization-server` for OAuth setup details.'
version: 1.0.0
tags:
- name: Theme
description: 'The theme builder: an organisation''s two brand colours in, chart palettes for day, night and print and the interface colours of day and night out. Registered users only.'
paths:
/api/theme:
get:
tags:
- Theme
summary: Get Theme
description: 'Build from Base (darker, primary) and Accent (lighter, secondary),
each six hex digits with or without ``#``. A 422 explains colours that are
too close or a theme that misses a contrast rule.'
operationId: get_theme_api_theme_get
security:
- personalKey: []
- apiKey: []
- session: []
parameters:
- name: primary
in: query
required: true
schema:
type: string
pattern: ^#[0-9A-F]{6}$
description: 'The darker brand colour: chart slot 1 and the colour of selected and active states.'
title: Primary
description: 'The darker brand colour: chart slot 1 and the colour of selected and active states.'
- name: secondary
in: query
required: true
schema:
type: string
pattern: ^#[0-9A-F]{6}$
description: 'The lighter accent colour: chart slot 2.'
title: Secondary
description: 'The lighter accent colour: chart slot 2.'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ThemeResponse'
'422':
description: 'A malformed request: one sentence naming the fields, never their values.'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorBody'
'401':
description: No valid web session or personal API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorBody'
'403':
description: OAuth/MCP cannot modify theme and reporting preferences.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorBody'
/api/theme/custom/{theme_id}.css:
get:
tags:
- Theme
summary: Get Custom Theme Css
description: 'The owned custom theme''s screen tokens for one mode (first paint and
every later selection or mode change).'
operationId: get_custom_theme_css_api_theme_custom__theme_id__css_get
security:
- personalKey: []
- apiKey: []
- session: []
parameters:
- name: theme_id
in: path
required: true
schema:
type: string
title: Theme Id
- name: mode
in: query
required: true
schema:
$ref: '#/components/schemas/ThemeMode'
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: 'A malformed request: one sentence naming the fields, never their values.'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorBody'
'401':
description: No valid web session or personal API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorBody'
'403':
description: OAuth/MCP cannot modify theme and reporting preferences.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorBody'
/api/theme/custom/{theme_id}:
get:
tags:
- Theme
summary: Get Custom Theme
description: The full day/night/print theme of an owned saved colour pair.
operationId: get_custom_theme_api_theme_custom__theme_id__get
security:
- personalKey: []
- apiKey: []
- session: []
parameters:
- name: theme_id
in: path
required: true
schema:
type: string
title: Theme Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ThemeResponse'
'422':
description: 'A malformed request: one sentence naming the fields, never their values.'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorBody'
'401':
description: No valid web session or personal API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorBody'
'403':
description: OAuth/MCP cannot modify theme and reporting preferences.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorBody'
components:
schemas:
SemanticRole:
type: string
enum:
- red
- ochre
- green
- cool
title: SemanticRole
description: 'The four jobs the site gives chart colours by name: red (errors,
price maps, the diverging maps'' negative pole), ochre (warnings), green
(success, value maps), cool (the healthy end of the phase gradient, the
diverging maps'' positive pole, quantity maps).'
Palette:
properties:
slots:
items:
$ref: '#/components/schemas/Slot'
type: array
title: Slots
description: 'The eight series colours in series order: the bottom segment of a stacked bar first, the grey (''rest of the world'') last.'
gradient:
items:
type: string
pattern: ^#[0-9A-F]{6}$
description: 'An sRGB colour, #RRGGBB.'
type: array
title: Gradient
description: The five stops of the continuous health scale, healthy (cool) to worst (red).
phases:
additionalProperties:
type: string
pattern: ^#[0-9A-F]{6}$
description: 'An sRGB colour, #RRGGBB.'
propertyNames:
$ref: '#/components/schemas/Phase'
type: object
title: Phases
description: The colour of each shock phase.
additionalProperties: false
type: object
required:
- slots
- gradient
- phases
title: Palette
description: A chart palette with the scales derived from it.
ThemeResponse:
properties:
anchors:
$ref: '#/components/schemas/ThemeAnchors'
day:
$ref: '#/components/schemas/Palette'
description: The screen palette.
night:
$ref: '#/components/schemas/Palette'
description: The neon palette for the night mode, on black.
print_palette:
$ref: '#/components/schemas/Palette'
description: 'The export palette: the day palette darkened for paper (exports add dashes and hatching).'
day_tokens:
$ref: '#/components/schemas/Tokens'
night_tokens:
$ref: '#/components/schemas/Tokens'
additionalProperties: false
type: object
required:
- anchors
- day
- night
- print_palette
- day_tokens
- night_tokens
title: ThemeResponse
description: GET /api/theme — a complete theme built from two brand colours.
ThemeAnchors:
properties:
primary_input:
type: string
pattern: ^#[0-9A-F]{6}$
title: Primary Input
description: 'An sRGB colour, #RRGGBB.'
secondary_input:
type: string
pattern: ^#[0-9A-F]{6}$
title: Secondary Input
description: 'An sRGB colour, #RRGGBB.'
primary_chart:
type: string
pattern: ^#[0-9A-F]{6}$
title: Primary Chart
description: 'Chart slot 1: the primary as entered, unless it needed a minimum of colour or visibility on white.'
secondary_chart:
type: string
pattern: ^#[0-9A-F]{6}$
title: Secondary Chart
description: Chart slot 2, by the same rule.
separation:
additionalProperties:
type: number
propertyNames:
$ref: '#/components/schemas/Vision'
type: object
title: Separation
description: CIEDE2000 distance between the two chart colours, per vision type.
additionalProperties: false
type: object
required:
- primary_input
- secondary_input
- primary_chart
- secondary_chart
- separation
title: ThemeAnchors
description: The two brand colours at each stage.
ErrorBody:
additionalProperties: false
description: 'The dashboard''s error envelope: a refused request is answered with one
human-readable sentence (``HTTPException.detail`` is a string, always;
maintenance/checks/error_details.py). The OAuth protocol endpoints answer
in the RFCs'' own format instead (``OAuthErrorBody``).'
properties:
detail:
description: What was refused and why, as one sentence.
title: Detail
type: string
required:
- detail
title: ErrorBody
type: object
Slot:
properties:
role:
$ref: '#/components/schemas/SlotRole'
description: What the slot is.
semantic:
anyOf:
- $ref: '#/components/schemas/SemanticRole'
- type: 'null'
description: The job the site gives this colour by name, if any (a brand colour may take one).
colour:
type: string
pattern: ^#[0-9A-F]{6}$
title: Colour
description: 'An sRGB colour, #RRGGBB.'
additionalProperties: false
type: object
required:
- role
- semantic
- colour
title: Slot
description: One chart colour.
SlotRole:
type: string
enum:
- primary
- secondary
- red
- ochre
- green
- cool
- free_1
- free_2
- free_3
- grey
title: SlotRole
description: 'What a chart slot is. The two brand colours, the derived colours
(one per semantic role a brand colour did not take, then free ones),
and the grey that is always "rest of the world".'
Vision:
type: string
enum:
- normal
- deutan
- protan
- tritan
title: Vision
description: 'The viewers a palette is measured for: normal colour vision and the
three dichromacies (Machado et al. 2009, full severity).'
Tokens:
properties:
bg:
type: string
pattern: ^#[0-9A-F]{6}$
title: Bg
description: The page.
surface:
type: string
pattern: ^#[0-9A-F]{6}$
title: Surface
description: Content grounds (chart cards, tables, forms).
rule:
type: string
pattern: ^#[0-9A-F]{6}$
title: Rule
description: Faint ruling lines.
edge:
type: string
pattern: ^#[0-9A-F]{6}$
title: Edge
description: Control edges, at least 3:1 on page and surface.
text:
type: string
pattern: ^#[0-9A-F]{6}$
title: Text
description: 'An sRGB colour, #RRGGBB.'
text_muted:
type: string
pattern: ^#[0-9A-F]{6}$
title: Text Muted
description: 'An sRGB colour, #RRGGBB.'
text_inverse:
type: string
pattern: ^#[0-9A-F]{6}$
title: Text Inverse
description: Ink on filled controls.
accent:
type: string
pattern: ^#[0-9A-F]{6}$
title: Accent
description: Selected and active states.
accent_hover:
type: string
pattern: ^#[0-9A-F]{6}$
title: Accent Hover
description: 'An sRGB colour, #RRGGBB.'
accent_light:
anyOf:
- type: string
pattern: ^#[0-9A-F]{6}$
description: 'An sRGB colour, #RRGGBB.'
- type: 'null'
title: Accent Light
description: The tier-2 state tint; none at night (no fill).
secondary:
type: string
pattern: ^#[0-9A-F]{6}$
title: Secondary
description: The secondary brand colour, readable as text.
file:
type: string
pattern: ^#[0-9A-F]{6}$
title: File
description: The commit (apply) fill.
file_hover:
type: string
pattern: ^#[0-9A-F]{6}$
title: File Hover
description: 'An sRGB colour, #RRGGBB.'
file_text:
type: string
pattern: ^#[0-9A-F]{6}$
title: File Text
description: 'An sRGB colour, #RRGGBB.'
error:
type: string
pattern: ^#[0-9A-F]{6}$
title: Error
description: 'An sRGB colour, #RRGGBB.'
error_hover:
type: string
pattern: ^#[0-9A-F]{6}$
title: Error Hover
description: 'An sRGB colour, #RRGGBB.'
error_bg:
type: string
pattern: ^#[0-9A-F]{6}$
title: Error Bg
description: 'An sRGB colour, #RRGGBB.'
error_border:
type: string
pattern: ^#[0-9A-F]{6}$
title: Error Border
description: 'An sRGB colour, #RRGGBB.'
warning:
type: string
pattern: ^#[0-9A-F]{6}$
title: Warning
description: 'An sRGB colour, #RRGGBB.'
warning_bg:
type: string
pattern: ^#[0-9A-F]{6}$
title: Warning Bg
description: 'An sRGB colour, #RRGGBB.'
success:
type: string
pattern: ^#[0-9A-F]{6}$
title: Success
description: 'An sRGB colour, #RRGGBB.'
map_sea:
type: string
pattern: ^#[0-9A-F]{6}$
title: Map Sea
description: Water on choropleth maps.
additionalProperties: false
type: object
required:
- bg
- surface
- rule
- edge
- text
- text_muted
- text_inverse
- accent
- accent_hover
- accent_light
- secondary
- file
- file_hover
- file_text
- error
- error_hover
- error_bg
- error_border
- warning
- warning_bg
- success
- map_sea
title: Tokens
description: The interface colours of one mode (the ``--clr-*`` custom properties).
ThemeMode:
type: string
enum:
- day
- night
title: ThemeMode
description: The two screen modes. Print is an export derivative, not a mode.
Phase:
type: string
enum:
- baseline
- active
- full_recovery
- return_to_baseline
- partial_recovery
- price_drop
- shock
- decline
- price_spike
- price_volatility
- depressed
- volume_volatility
- volatile_trade
- sporadic
- post_shock
- disruption
- exit
- price_exit
title: Phase
description: 'The shock-analysis phases that carry a colour (mirrors
``PHASE_SCORES`` in ``src/lib/palette.ts``).'
securitySchemes:
bearer:
type: http
description: A personal API key (`eut_...`) or an OAuth 2.1 access token (see `/.well-known/oauth-authorization-server`).
scheme: bearer
apiKey:
type: apiKey
description: A personal API key (`eut_...`).
in: header
name: X-API-Key
session:
type: apiKey
description: The dashboard's sign-in session, set by `POST /api/auth/login`.
in: cookie
name: td_session
personalKey:
type: http
description: A personal API key (`eut_...`) sent as a bearer token. OAuth access tokens are refused here.
scheme: bearer