canonical: https://jentic.com/apis/creativecommons.tankerkoenig.de/tankerkoenig

# Creativecommons Tankerkoenig De Tankerkoenig API

Jentic publishes the only available OpenAPI specification for Tankerkoenig API, keeping it validated and agent-ready. Tankerkoenig serves real-time gasoline and diesel prices for filling stations across Germany, sourced from the official Marktransparenzstelle für Kraftstoffe and released under a Creative Commons licence usable for commercial purposes. The API exposes a small set of read endpoints to search stations by location or postal code, fetch detail by station ID, and pull aggregate price statistics, plus a single write endpoint for filing data complaints.

## For AI agents

Look up live German fuel prices and the gas stations that offer them by coordinates, postal code, or station ID. Use it for trip planning, fuel cost estimation, or price comparison agents in Germany.

## Scope

Does not handle routing, geocoding from place names, or fuel data outside Germany - use for live German station prices only.

## Capabilities

- Search nearby filling stations within a radius around a latitude and longitude pair
- Look up the current E5, E10, and diesel prices for a list of station IDs in one call
- Find filling stations and their fuel prices within a specific German postal code area
- Retrieve aggregate fuel price statistics across the German station network
- Submit a price-data complaint when a returned price for a station looks incorrect

## Use cases

### Cheapest fuel near a location

Find the lowest current price for E5, E10, or diesel within a configurable radius around a user's coordinates by calling the station search endpoint. The endpoint returns each station's brand, address, opening status, and live prices in one response, which is enough for an assistant to recommend a station without further calls.

Example prompt: Call GET `/stations/search` with lat=52.52, lng=13.40, rad=5, type=diesel, sort=price and return the top three stations with their addresses and current diesel prices.

### Postal-code price comparison

Compare fuel prices across all stations within a given German postal code by calling the postal-code endpoint, which returns each station with its address and current prices. Useful for local fuel comparison sites, fleet managers planning refuels in a specific district, or chat assistants answering 'where is fuel cheapest in 10115 today'.

Example prompt: Call GET `/stations/postalcode` with postalcode=10115 and return a table of station name, street, and E5/E10/diesel prices sorted by E10 ascending.

### Trip fuel cost estimation

Build an estimate of fuel costs along a planned route by passing the IDs of stations near each waypoint to the bulk lookup endpoint. The single call returns live prices for all requested stations, so the agent can sum the cheapest plausible refuel at each leg without making one HTTP request per station.

Example prompt: Call GET `/stations/ids` with a comma-separated list of 8 station IDs along an A9 route and return the cheapest diesel price for each leg.

### Agent-driven local fuel assistant

Through Jentic, an agent can answer free-form fuel questions for German users by routing them to the correct Tankerkoenig endpoint without the developer wiring each call by hand. Search for 'find a gas station' or 'fuel prices near me', load the matching operation, and execute it with the user's coordinates while Jentic injects the API key from the vault.

Example prompt: Through Jentic, run search('find cheapest diesel near coordinates'), load the Tankerkoenig stations search operation, and execute it with the user's lat/lng to recommend a station.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/stations/search` | Search nearby gas stations by coordinates and radius |
| GET | `/stations/postalcode` | Search stations within a German postal code |
| GET | `/stations/ids` | Bulk lookup of stations and prices by ID |
| GET | `/stats` | Aggregate fuel price statistics |
| POST | `/complaint` | Submit a price-data complaint |

## Key resources

- **Stations** — Search and detail endpoints for German filling stations: `/stations/search` by radius, `/stations/postalcode` by postcode, and `/stations/ids` for bulk lookup by station ID.
- **Stats** — Aggregate fuel price statistics across the network exposed at /stats.
- **Complaint** — Single POST /complaint endpoint to report incorrect price data back to Tankerkoenig.

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 51 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 100 / 100
  - Developer Experience & Jentic Compatibility: 69 / 100
  - AI-Readiness & Agent Experience: 55 / 100
  - Agent Usability: 94 / 100
  - Security: 15 / 100
  - AI Discoverability: 100 / 100
- **View full report:** https://jentic.com/apis/creativecommons.tankerkoenig.de/tankerkoenig/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring Tankerkoenig by hand means passing the apikey as a query parameter and assembling the search, postal-code, and station-id lookups yourself against the German fuel-price surface. Through Jentic you install once, import Tankerkoenig from the API Directory, store the apikey once, and your agent calls it.
- **Permission scoping:** Tankerkoenig takes coordinates, postal codes, and station ids as query inputs rather than as URL resource ids, so scope the agent to the operations it needs, such as searching stations or reading prices. Submitting a price complaint stays out unless you include that operation.
- **Credential handling:** Your Tankerkoenig apikey is stored once, encrypted, by your own Jentic One instance and injected as the apikey query parameter at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'find a gas station near coordinates' or 'cheapest diesel in a postal code', and Jentic returns the matching Tankerkoenig operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Apify** — General scraping platform that can be used to collect fuel price data when no native API is available.
- **TomTom Routing** — Routing API that pairs with fuel station lookups for trip planning across Germany.
- **OpenCage Geocoding** — Geocoder for converting place names or addresses into the coordinates Tankerkoenig requires.

## FAQ

### Why is there no official OpenAPI spec for Tankerkoenig API?

Tankerkoenig does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Tankerkoenig API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Tankerkoenig API use?

The API uses an API key passed as the apikey query parameter on every request. The key is a UUID issued by Tankerkoenig after a free request form. Through Jentic, the key is stored in the encrypted vault and injected at execution time so the agent never sees the raw value.

### Can I search for gas stations by coordinates with the Tankerkoenig API?

Yes. Call GET `/stations/search` with lat, lng, and rad query parameters and the response includes nearby stations with their address, opening status, and current E5, E10, and diesel prices.

### What are the rate limits for the Tankerkoenig API?

Tankerkoenig publishes fair-use rules on its terms page rather than fixed numeric limits in the spec. Polling individual stations more often than once every five minutes is discouraged. For dashboards or fleet tools, prefer `/stations/ids` for bulk lookups instead of one request per station.

### Is the Tankerkoenig API free?

Yes. The data is published under a Creative Commons licence and the API is free to use, including for commercial projects, provided attribution requirements in the licence are met.

### How do I find the cheapest diesel near a user with Tankerkoenig through Jentic?

Install Jentic with pip install jentic, then run an async search for 'find cheapest diesel near coordinates'. Jentic returns the GET `/stations/search` operation; load its schema and execute with the user's lat, lng, rad, and type=diesel. Jentic attaches the apikey from the vault automatically.

### Can I limit what my agent is allowed to do with the Tankerkoenig API?

Yes. Because you run Jentic One yourself, your own rules decide which Tankerkoenig operations and credentials the agent may use. You can allow only the read operations it needs, such as searching stations by coordinates (GET `/stations/search`), looking up a postal code (GET `/stations/postalcode`), bulk price lookups by station ID (GET `/stations/ids`), or reading aggregate statistics (GET /stats), while keeping the write operation that files a price complaint (POST /complaint) out of the agent's reach unless you explicitly include it. Since the API takes coordinates, postal codes, and station IDs as query inputs rather than URL resource IDs, scoping is done at the operation level for the exact endpoints you approve.
