Die TruckSlot-API erlaubt es Betreibern von Raststätten, Autohöfen und Rastparks, ihren Belegungszähler automatisch zu posten. Jeder Post aktualisiert den Status des Parkplatzes in der TruckSlot-App — Fahrer sehen sofort, ob der Parkplatz frei, teilweise belegt oder voll ist.
POST onlyAPI-KeyJSONRate-Limit 5 min
Jeder Standort erhält einen persönlichen API-Key. Der Key ist fest mit genau einem Parkplatz verknüpft — ein Key kann ausschließlich für den eigenen Standort posten.
Key anfordern: hermes@cstrsk.de mit Standortname und Autobahn.
Bearbeitung in der Regel innerhalb von 24 Stunden. Kostenlos.
Sendet den aktuellen Zählerstand (belegte Stellplätze) des Parkplatzes. Der Status wird automatisch berechnet.
POST https://cstrsk.de/TruckSlot/api.php
Content-Type: application/json
{
"api_key": "DEIN_API_KEY",
"spot_id": "a8-3",
"counter": 42
}
| Feld | Typ | Pflicht | Beschreibung |
|---|---|---|---|
api_key | string | ja | Persönlicher API-Key (wird zugeteilt) |
spot_id | string | ja | ID des Parkplatzes (wird mit dem Key mitgeteilt) |
counter | integer | ja | Aktuell belegte Stellplätze (Zählerstand) |
| Belegung | Status | Farbe |
|---|---|---|
| 0–30 % der Kapazität | FREE | 🟢 Frei |
| 31–85 % der Kapazität | FEW | 🟡 Wenige Plätze |
| 86–100 % der Kapazität | FULL | 🔴 Voll |
curl -X POST https://cstrsk.de/TruckSlot/api.php \
-H "Content-Type: application/json" \
-d '{"api_key":"DEIN_KEY","spot_id":"a8-3","counter":42}'
import requests
r = requests.post("https://cstrsk.de/TruckSlot/api.php", json={
"api_key": "DEIN_KEY",
"spot_id": "a8-3",
"counter": 42
})
print(r.json())
$ch = curl_init("https://cstrsk.de/TruckSlot/api.php");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"api_key" => "DEIN_KEY",
"spot_id" => "a8-3",
"counter" => 42
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
{
"ok": true,
"spot_id": "a8-3",
"source": "counter",
"counter": 42,
"capacity": 100,
"new_status": "FEW",
"submissions": 1
}
| Feld | Beschreibung |
|---|---|
ok | true bei Erfolg |
source | immer "counter" (Zähler-Quelle) |
counter | Gemeldeter Zählerstand (Echo) |
capacity | Hinterlegte Gesamtkapazität |
new_status | Berechneter Status: FREE / FEW / FULL |
| HTTP | Fehler | Bedeutung |
|---|---|---|
| 400 | missing_fields | api_key, spot_id oder counter fehlt |
| 403 | invalid_api_key | API-Key unbekannt oder ungültig |
| 403 | key_spot_mismatch | Key gehört zu einem anderen Parkplatz |
| 404 | spot_not_found | Parkplatz-ID existiert nicht |
| 429 | rate_limit | Zu viele Posts (max. 1 pro 5 Minuten) |
{
"ok": false,
"error": "invalid_api_key"
}