TollCalc integreren in uw eigen applicatie

TollCalc kan op drie manieren worden geïntegreerd in uw software of AI-workflows:

Methode Geschikt voor
REST API Server-naar-server-integratie, eigen backends
MCP (Model Context Protocol) AI-assistenten (Claude, Cursor, GPT en meer)
Python-pakket tollcalc Scripts, data science, Jupyter Notebooks

REST API

Volledige API-documentatie (OpenAPI 3.0) beschikbaar op:

tollcalc.eu/en/api.html

Snel starten

curl -X POST https://app.tollcalc.eu/api/calculate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer UW_API_TOKEN" \
  -d '{
    "origin": "Munich, Germany",
    "destination": "Vienna, Austria",
    "vehicle": {
      "weight": 40,
      "axles": 5,
      "emission_class": "euro6",
      "co2_class": "class_1"
    }
  }'

Parameters

Parameter Type Beschrijving
origin string Startpunt: adres of "lat;lon"
destination string Eindpunt: adres of "lat;lon"
via string[] Optionele tussenstops (max. 15)
vehicle.weight number Totale massa in tonnen (bijv. 40)
vehicle.axles integer Aantal assen: 2, 3, 4 of 5
vehicle.emission_class string Euro-norm: euro0euro6
vehicle.co2_class string CO₂-klasse: class_1 (standaard diesel) tot class_5 (nul-emissie)

Authenticatie

API-tokens zijn beschikbaar na registratie op app.tollcalc.eu. Zonder token zijn 10 gratis verzoeken per sessie toegestaan.


MCP – Integratie in AI-assistenten

TollCalc ondersteunt het Model Context Protocol (MCP) en kan direct worden verbonden met AI-tools zoals Claude Desktop, Cursor of een andere MCP-compatibele assistent.

Endpoint

POST https://app.tollcalc.eu/mcp

Beschikbare tools

Tool Beschrijving
calculate_toll Berekent tolkosten voor een vrachtwagenroute
get_quota Controleer het resterende quotum voor de huidige sessie

Configuratie in Claude Desktop

Voeg het volgende toe aan uw Claude Desktop-configuratie (claude_desktop_config.json):

Optie A – OAuth (aanbevolen): Alleen de URL, geen token nodig.

{
  "mcpServers": {
    "tollcalc": {
      "url": "https://app.tollcalc.eu/mcp"
    }
  }
}

Optie B – API-sleutel (voor automatisering): Token handmatig instellen, bijv. voor server-naar-server-integraties.

{
  "mcpServers": {
    "tollcalc": {
      "url": "https://app.tollcalc.eu/mcp",
      "headers": {
        "Authorization": "Bearer UW_API_TOKEN"
      }
    }
  }
}

Zonder configuratie zijn 10 gratis verzoeken per MCP-sessie (= per gesprek) beschikbaar — geen account vereist. Na 10 verzoeken opent Claude Desktop automatisch een browserlogin (OAuth 2.0). Na het inloggen geldt het quotum van het gekozen abonnement. API-sleutels voor optie B kunt u aanmaken op app.tollcalc.eu.

Detailniveaus

De tool calculate_toll ondersteunt drie detailniveaus via de parameter detail:

Waarde Inhoud
compact (standaard) Totaal tol, tol-km, tolvrije km, uitsplitsing per land
detailed Zoals compact, plus kosten per segment (zonder geometrie)
full Zoals detailed, plus coördinaten en debug-informatie

Antwoordvelden

Alle detailniveaus bevatten de volgende velden:

Veld Type Beschrijving
origin string Opgelost vertrekpunt
destination string Opgelost bestemmingspunt
total_toll_eur number Totale tol in EUR
total_distance_km number Totale routeafstand in km
toll_km number Tolplichtige km
toll_free_km number Tolvrije km
countries array Uitsplitsing per land (country, country_name, total_km, toll_km, toll_eur)
info_url string Link om deze berekening te bekijken in de TollCalc webapplicatie — inclusief de geplande route op een interactieve kaart; te delen met collega's of te openen in de browser

Met detail=detailed bevat countries ook segments (weg, type, km, toll_eur per segment). Met detail=full bevatten segmenten coördinaten, source_url, matched_geofence en geometrie.


Python-pakket tollcalc

Het Python-pakket tollcalc omhult de REST API voor gebruik vanuit Python-scripts of Jupyter Notebooks.

Installatie

pip install tollcalc

Gebruik

from tollcalc import TollCalc

client = TollCalc(api_key="UW_API_TOKEN")

result = client.calculate(
    origin="Munich, Germany",
    destination="Vienna, Austria",
    weight=40,
    axles=5,
    emission_class="euro6",
    co2_class="class_1",
)

print(f"Totaal tol:  {result.total_toll_eur:.2f} EUR")
print(f"Afstand:     {result.total_distance_km:.1f} km")

for country in result.countries:
    print(f"  {country.country_name}: {country.toll_eur:.2f} EUR ({country.toll_km:.0f} tol-km)")

Pakketdocumentatie

Volledige documentatie en voorbeelden op PyPI: pypi.org/project/tollcalc


Prijzen & quota

Plan Verzoeken/maand Prijs
Free (zonder token) 10 per MCP-sessie (= per gesprek) gratis
Starter tot 500 vanaf €9/maand
Professional tot 5.000 vanaf €49/maand
Enterprise onbeperkt op aanvraag

Alle plannen en actuele prijzen: tollcalc.eu/en/#pricing

Voor integratievragen: support@tollcalc.eu