API

Horizon Dispatch API

Plug your VTC’s stats into your website or Discord bot. Read-only, JSON, open CORS — built for widgets, overlays and integrations.

0results

Public keyless API

The simplest option: no key, no boost, for every VTC. Replace ma-vtc with your VTC’s identifier (the address of its page /vtcs/ma-vtc). JSON, read-only, open CORS, 120 requests / minute / IP.

GET https://hdispatch.eu/api/vtc                       list of available endpoints
GET https://hdispatch.eu/api/vtc/ma-vtc/stats          members, online, km (total and month), next event, certification
GET https://hdispatch.eu/api/vtc/ma-vtc/online         online drivers (positions included)
GET https://hdispatch.eu/api/vtc/ma-vtc/jobs?limit=10  latest deliveries (1 to 50, 10 by default)
GET https://hdispatch.eu/api/vtc/ma-vtc/events?limit=5 upcoming public events (1 to 20, 5 by default)
GET https://hdispatch.eu/api/vtc/ma-vtc/members        active members ranked by kilometres (1 to 200, 50 by default), if the VTC makes them public
GET https://hdispatch.eu/api/vtc/ma-vtc/certification  verifiable certification status
fetch('https://hdispatch.eu/api/vtc/ma-vtc/stats')
  .then((r) => r.json())
  .then((d) => console.log(d.members.online + ' en ligne · ' + d.month.km + ' km ce mois-ci'));

Respects the VTC’s settings: names hidden if “show members” is off, revenue missing if revenue isn’t public, API can be fully disabled in Settings → API. Responses are cached from 5 seconds (online) to 5 minutes (certification). Errors: 404 {"error":"not_found"} if the VTC doesn’t exist, is blacklisted or has turned off its API; 429 {"success":false,"message":…} beyond the limit. For detailed data, use the key-based v1 API below.

Widgets for your VTC’s website

Online members, latest jobs, kilometres this month, next event, recruitment, full card or live mini map. Free, in 9 languages, light or dark theme. Ready-to-paste codes are in Dashboard → your VTC → Widgets & badge.

<div class="hd-widget" data-vtc="ma-vtc" data-type="online"></div>
<script src="https://hdispatch.eu/widgets/embed.js" async></script>
data-type
online · jobs · km · event · recruit · card · map
data-theme
dark · light · auto
data-lang
fr en de es it nl pl pt tr
Other
data-accent="ff8800" · data-limit="1..15" · data-header="0" · data-height="360" · data-game="ats" (map)

Without JavaScript, every widget also works as an iframe: https://hdispatch.eu/widgets/vtc/ma-vtc/online?theme=dark. Widgets refresh on their own (30 s for “online”, up to 10 min for “recruitment”) and show an error if the VTC has turned off its API. Certification badge: https://hdispatch.eu/badges/vtc/ma-vtc.svg (or .png), options ?style=flat, ?theme=light, ?lang=en, verifiable at https://hdispatch.eu/verify/ma-vtc.

Quick start

  1. Unlock the API — it’s part of the 5-boost tier (like the VTC website).
  2. Get your public key in Dashboard → Settings → API. It starts with pk_ and is safe to expose.
  3. Call the API with your key in the x-api-key header (or as the ?key= parameter).
curl -H "x-api-key: pk_VOTRE_CLE" https://hdispatch.eu/api/v1/vtc

Authentication & rules

Base URL
https://hdispatch.eu/api/v1
Header
x-api-key: pk_…
Methods
GET (read-only)
Rate limit
120 requests / minute / key
Format
JSON · CORS *
Access
5-boost tier required

GET https://hdispatch.eu/api/v1 returns the list of endpoints. Errors look like {"error":"…"} (see below).

⚠️ Don’t mix up your public key (pk_…, read) with your tracker key (secret, write): the latter must never appear in a web page. A VTC can turn off its API or hide some fields (revenue, members) from its settings.

Endpoints

No results for this search.
GET /api/v1/vtc

VTC info and totals (members, km, creation date…).

Example response
{
  "id": "6600…", "name": "Horizon Dispatch", "slug": "horizon-dispatch",
  "tag": "[HDX]", "description": "…", "game": "ets2", "color": "#cfd4dc",
  "recruitmentOpen": true, "hdPartner": false, "premium": false,
  "memberCount": 42,
  "totals": { "distanceKm": 1284000, "deliveries": 3120, "revenue": 9800000 },
  "createdAt": "2025-01-08T12:00:00.000Z"
}
GET /api/v1/members?limit=1..500

VTC members, sorted by mileage (100 by default).

Example response
{
  "count": 42,
  "members": [
    { "discordId": "1234…", "name": "Marco", "avatar": "…", "role": "driver",
      "traction": false, "joinedAt": "…",
      "stats": { "distanceKm": 84210, "deliveries": 190, "revenue": 512000 } }
  ]
}
GET /api/v1/events

The VTC’s upcoming events, both public and members-only (50 max).

Example response
{
  "count": 2,
  "events": [
    { "id": "…", "title": "Convoi du dimanche", "game": "ets2", "server": "Simulation 1",
      "departureCity": "Paris", "arrivalCity": "Berlin", "plannedKm": 1050,
      "meetupAt": "…", "startAt": "…", "slots": { "total": 20, "taken": 12 },
      "going": 18, "externalUrl": "" }
  ]
}
GET /api/v1/deliveries?limit=1..200

Recent deliveries (50 by default).

Example response
{
  "count": 50,
  "deliveries": [
    { "driverDiscordId": "…", "game": "ets2", "cargo": "Ciment", "from": "Lyon",
      "to": "Milan", "distanceKm": 480, "damagePercent": 0, "truck": "Scania S",
      "at": "…", "income": 42000 }
  ]
}
GET /api/v1/live

Online drivers (presence < 60 s).

Example response
{
  "count": 3,
  "drivers": [
    { "discordId": "…", "name": "Marco", "avatar": "…", "game": "ETS2",
      "onJob": true, "cargo": "Bois", "from": "Oslo", "to": "Stockholm",
      "truck": "Volvo FH", "speed": 88, "distanceLeft": 120, "progressPct": 64 }
  ]
}
GET /api/v1/news?limit=1..100

The VTC’s public, published announcements.

Example response
{
  "count": 5,
  "news": [
    { "id": "…", "title": "Recrutement ouvert !", "content": "…", "coverUrl": "…",
      "pinned": true, "authorName": "Léa", "at": "…", "updatedAt": "…" }
  ]
}
GET /api/v1/partners

Accepted partnerships (partner VTCs).

Example response
{
  "count": 3,
  "partners": [
    { "id": "…", "name": "Nordic Logistics", "slug": "nordic-logistics",
      "tag": "[NL]", "logoUrl": "…", "game": "ets2", "since": "…" }
  ]
}
GET /api/v1/divisions

The VTC’s transport divisions.

Example response
{
  "count": 4,
  "divisions": [
    { "id": "…", "name": "Frigo", "description": "…", "imageUrl": "…",
      "color": "#4ea1ff", "trucks": ["Scania S"], "trailers": ["Krone Cool"],
      "position": 0 }
  ]
}
GET /api/v1/gallery?limit=1..100

The VTC’s public photo galleries (albums published from the dashboard).

Example response
{
  "count": 6,
  "galleries": [
    { "id": "…", "title": "Convoi de Noël", "description": "…",
      "images": ["https://…/1.jpg", "https://…/2.jpg"], "photoCount": 2,
      "authorName": "Léa", "discordUrl": "https://discord.com/channels/…",
      "at": "…" }
  ]
}
GET /api/v1/hd/events?limit=1..100

Horizon Dispatch events (global, all public VTCs).

Example response
{
  "count": 10,
  "events": [
    { "id": "…", "title": "Grand convoi HD", "game": "ets2", "server": "Simulation 1",
      "departureCity": "Madrid", "arrivalCity": "Lisbonne", "plannedKm": 620,
      "meetupAt": "…", "startAt": "…",
      "vtc": { "name": "Horizon Dispatch", "slug": "horizon-dispatch", "tag": "[HDX]", "logoUrl": "…" },
      "externalUrl": "" }
  ]
}

Errors

Code
error
Meaning
401
missing_api_key
No key provided.
403
invalid_api_key
Unknown key.
403
boost_required
The VTC doesn’t have the 5-boost tier.
403
api_disabled
The VTC has turned off its public API.
403
members_hidden
The VTC hides its member list (/members).
429
rate_limited
Rate limit exceeded (see the Retry-After header).
500
server_error
Internal error, try again later.

Horizon Connect (OAuth 2)

Add “Sign in with Horizon Dispatch” to your website. Create the application in Dashboard → your VTC → Ecosystem: the secret is shown only once.

GET  https://hdispatch.eu/connect/authorize?client_id=…&redirect_uri=…&scope=identity%20profile%20vtc&state=…
     (PKCE: add code_challenge, computed with S256)
POST https://hdispatch.eu/connect/token      client_id, client_secret, code, redirect_uri (code_verifier si PKCE)
     → { "access_token": "…", "token_type": "Bearer", "expires_in": 2592000, "scope": "…" }
GET  https://hdispatch.eu/connect/userinfo   Authorization: Bearer <access_token>

The authorization code is valid for 5 minutes and can only be used once; the token, 30 days. Scopes: identity (identifier), profile (profile), vtc (the user’s VTC).

Copy-paste widget

Paste this into your website and replace pk_VOTRE_CLE with your public key:

<div id="hd-stats">Chargement…</div>
<script>
  fetch("https://hdispatch.eu/api/v1/vtc", { headers: { "x-api-key": "pk_VOTRE_CLE" } })
    .then(function (r) { return r.json(); })
    .then(function (v) {
      document.getElementById("hd-stats").innerHTML =
        "<b>" + v.name + "</b> — " + v.memberCount + " membres · " +
        v.totals.distanceKm.toLocaleString() + " km";
    });
</script>
Sign in to get a key