Integrate TollCalc into Your Application
TollCalc can be integrated into your software or AI workflows in three ways:
| Method | Best for |
|---|---|
| REST API | Server-to-server integration, custom backends |
| MCP (Model Context Protocol) | AI assistants (Claude, Cursor, GPT, and more) |
Python package tollcalc |
Scripts, data science, Jupyter Notebooks |
REST API
Full API documentation (OpenAPI 3.0) is available at:
Quick Start
curl -X POST https://app.tollcalc.eu/api/calculate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"origin": "Munich, Germany",
"destination": "Vienna, Austria",
"vehicle": {
"weight": 40,
"axles": 5,
"emission_class": "euro6",
"co2_class": "class_1"
}
}'
Parameters
| Parameter | Type | Description |
|---|---|---|
origin |
string | Start point: address or "lat;lon" |
destination |
string | End point: address or "lat;lon" |
via |
string[] | Optional waypoints (max 15) |
vehicle.weight |
number | Gross vehicle mass in tonnes (e.g. 40) |
vehicle.axles |
integer | Number of axles: 2, 3, 4, or 5 |
vehicle.emission_class |
string | Euro standard: euro0–euro6 |
vehicle.co2_class |
string | CO₂ class: class_1 (standard diesel) to class_5 (zero emission) |
Authentication
API tokens are available after registering at app.tollcalc.eu. Without a token, 10 free requests per session are allowed.
MCP – Integration into AI Assistants
TollCalc supports the Model Context Protocol (MCP) and can be connected directly to AI tools such as Claude Desktop, Cursor, or any other MCP-compatible assistant.
Endpoint
POST https://app.tollcalc.eu/mcp
Available Tools
| Tool | Description |
|---|---|
calculate_toll |
Calculate toll costs for a truck route |
get_quota |
Query remaining quota for the current session |
Configuration in Claude Desktop
Add the following to your Claude Desktop configuration (claude_desktop_config.json):
Option A – OAuth (recommended): Just the URL, no token needed.
{
"mcpServers": {
"tollcalc": {
"url": "https://app.tollcalc.eu/mcp"
}
}
}
Option B – API Key (for automation): Set a token manually, e.g. for server-to-server integrations.
{
"mcpServers": {
"tollcalc": {
"url": "https://app.tollcalc.eu/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}
Without any configuration, 10 free requests per MCP session (= per conversation) are available — no account required. After 10 requests, Claude Desktop automatically opens a browser login (OAuth 2.0). After signing in, your plan quota applies. API tokens for Option B can be created at app.tollcalc.eu.
Example Interaction via MCP
Once configured, you can ask the assistant directly:
"What is the toll cost for a 40-tonne truck from Munich to Vienna?"
The assistant will call the calculate_toll tool and return a structured response.
Detail Levels
The calculate_toll tool supports three detail levels via the detail parameter:
| Value | Contents |
|---|---|
compact (default) |
Total toll, toll km, toll-free km, per-country breakdown |
detailed |
Like compact, plus per-segment costs (no geometry) |
full |
Like detailed, plus coordinates and debug information |
Response Fields
All detail levels include the following fields:
| Field | Type | Description |
|---|---|---|
origin |
string | Resolved start location name |
destination |
string | Resolved destination name |
total_toll_eur |
number | Total toll cost in EUR |
total_distance_km |
number | Total route distance in km |
toll_km |
number | Toll-bearing distance in km |
toll_free_km |
number | Toll-free distance in km |
countries |
array | Per-country breakdown (country, country_name, total_km, toll_km, toll_eur) |
info_url |
string | Link to view this calculation in the TollCalc web app — including the planned route on an interactive map; shareable with colleagues or open in browser |
With detail=detailed, countries also includes segments (road, type, km, toll_eur per segment).
With detail=full, segments gain coordinates, source_url, matched_geofence, and geometry.
Server Card
The MCP server description (Server Card) is available at:
GET https://app.tollcalc.eu/.well-known/mcp-server
Python Package tollcalc
The tollcalc Python package wraps the REST API for use from Python scripts or Jupyter Notebooks.
Installation
pip install tollcalc
Usage
from tollcalc import TollCalc
client = TollCalc(api_key="YOUR_API_TOKEN")
result = client.calculate(
origin="Munich, Germany",
destination="Vienna, Austria",
weight=40,
axles=5,
emission_class="euro6",
co2_class="class_1",
)
print(f"Total toll: {result.total_toll_eur:.2f} EUR")
print(f"Distance: {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} toll km)")
Coordinates as Input
result = client.calculate(
origin="48.1374;11.5755", # Munich (lat;lon)
destination="48.2082;16.3738", # Vienna
weight=40,
axles=5,
)
Package Documentation
Full documentation and further examples are available on PyPI: pypi.org/project/tollcalc
Pricing & Quotas
| Plan | Requests/month | Price |
|---|---|---|
| Free (no token) | 10 per MCP session (= per conversation) | free |
| Starter | up to 500 | from €9/month |
| Professional | up to 5,000 | from €49/month |
| Enterprise | unlimited | on request |
All plans and current pricing: tollcalc.eu/en/#pricing
For integration questions, contact support@tollcalc.eu.