Overview

Tankerkoenig offers an API that provides real-time fuel price data for petrol stations across Germany. Established in 2014, the service aggregates data from the official German market transparency unit for fuels (Markttransparenzstelle für Kraftstoffe, MTS-K), making it a reliable source for current fuel costs. Developers can access prices for various fuel types, including Super E5, Super E10, and Diesel, enabling the creation of applications that help users identify the cheapest fuel options in their vicinity.

The API is designed for developers who need to integrate up-to-the-minute fuel price information into mobile apps, web services, or fleet management systems. Use cases range from simple price lookups based on location to complex routing algorithms that factor in fuel costs. For instance, a logistics company could optimize delivery routes by incorporating real-time fuel prices to minimize operational expenses, or a consumer-facing application could display nearby stations with the most competitive prices.

Tankerkoenig's data covers a substantial network of fuel stations, ensuring broad geographical coverage within Germany. The API supports various query types, such as fetching prices for specific stations by ID, listing stations within a defined radius of coordinates, or checking the current status (open/closed) of a station. This flexibility allows developers to build tailored solutions that meet specific user needs, whether it's a quick price check before a journey or a comprehensive comparison tool for daily commuters. The API's documentation includes example code snippets in popular programming languages like PHP, Python, Java, and Node.js, facilitating quicker integration for developers. The data license permits commercial use under specific conditions, clarified on the Tankerkoenig pricing and data license page.

For projects requiring frequent data access, Tankerkoenig provides paid tiers beyond its free offering of 50 requests per day. These tiers offer increased request limits and support, catering to applications with higher traffic demands. The service emphasizes data accuracy, reflecting price changes as they are reported to the official transparency unit. This commitment to timely updates ensures that applications built with the Tankerkoenig API provide relevant information to end-users, distinguishing it as a practical choice for fuel price data integration in Germany.

Key features

  • Real-time Fuel Prices: Access current prices for Super E5, Super E10, and Diesel across Germany based on official government data.
  • Station Locator: Query fuel stations by geographic coordinates (latitude, longitude) within a specified radius or by specific station ID.
  • Station Status: Determine if a fuel station is currently open or closed, which is critical for navigation and planning.
  • Price History: While the primary focus is real-time, the API provides mechanisms to track price changes, allowing for trend analysis over short periods.
  • Comprehensive Coverage: Data includes a wide network of German fuel stations, ensuring broad utility for nationwide applications.
  • Multiple Query Parameters: Supports filtering stations by fuel type, brand, or location, enabling highly specific data retrieval.
  • Developer-Friendly Documentation: Provides clear API reference and example code snippets for common programming languages.

Pricing

Tankerkoenig offers a free tier for basic usage and tiered subscriptions for higher request volumes. Pricing is effective as of May 2026.

Plan Requests per Day Monthly Price (EUR) Features
Free 50 0 Basic API access, real-time prices
Starter 5,000 2.50 Increased request limit, commercial use
Pro 25,000 10.00 Higher request limit, priority support
Enterprise Custom Contact for quote Tailored solutions, dedicated support

For detailed terms and conditions, refer to the Tankerkoenig API pricing page.

Common integrations

  • Mobile Navigation Apps: Integrate fuel prices directly into mapping and navigation applications to guide users to the cheapest stations along their route.
  • Fleet Management Systems: Optimize fuel stops for commercial fleets by incorporating real-time pricing data to reduce operational costs.
  • Automotive Infotainment Systems: Display current fuel prices on in-car dashboards, providing drivers with immediate access to cost information.
  • Smart Home Assistants: Develop voice-activated queries for local fuel prices, enabling users to check costs before leaving home.
  • Travel Planning Websites: Enhance trip planning tools by offering fuel cost estimates based on destination and current market prices.
  • Data Analytics Platforms: Collect and analyze fuel price trends over time for market research or economic forecasting.

Alternatives

  • Clever-Tanken: A popular German fuel price comparison service with a strong user base.
  • ADAC Spritpreise: The German automobile club provides current fuel prices and comparison tools.
  • Mehr-Tanken: Another established platform for comparing fuel prices across Germany.

Getting started

To begin using the Tankerkoenig API, you first need to obtain an API key from the Tankerkoenig documentation site. Once you have your key, you can make HTTP requests to retrieve fuel station data and prices. The following Python example demonstrates how to fetch fuel prices for a specific station using its ID.

import requests

API_KEY = "YOUR_API_KEY_HERE"
STATION_ID = "576d334e-6e27-463e-bb36-b6b63d04f32e" # Example ID for a station in Berlin

# Get prices for a specific station
url = f"https://creativecommons.tankerkoenig.de/json/prices.php?ids={STATION_ID}&apikey={API_KEY}"
response = requests.get(url)

if response.status_code == 200:
    data = response.json()
    print(f"Fuel prices for station ID {STATION_ID}:")
    station_prices = data['prices'][STATION_ID]
    if station_prices['status'] == 'open':
        print(f"  Super E5: {station_prices['e5']} EUR")
        print(f"  Super E10: {station_prices['e10']} EUR")
        print(f"  Diesel: {station_prices['diesel']} EUR")
    else:
        print("  Station is currently closed.")
else:
    print(f"Error fetching data: {response.status_code} - {response.text}")

# Example of finding stations near coordinates
LAT = 52.5200
LNG = 13.4050
RAD = 5 # Radius in kilometers
TYPE = "e5" # Fuel type to filter by

stations_url = f"https://creativecommons.tankerkoenig.de/json/list.php?lat={LAT}&lng={LNG}&rad={RAD}&type={TYPE}&apikey={API_KEY}"
stations_response = requests.get(stations_url)

if stations_response.status_code == 200:
    stations_data = stations_response.json()
    if stations_data['ok'] and stations_data['stations']:
        print(f"\nStations offering {TYPE} near {LAT}, {LNG} (radius {RAD}km):")
        for station in stations_data['stations']:
            print(f"  - {station['brand']} {station['name']} ({station['street']} {station['houseNumber']}, {station['postCode']} {station['city']}) - Price: {station['price']} EUR")
    else:
        print("\nNo stations found or error in station list data.")
else:
    print(f"Error fetching stations: {stations_response.status_code} - {stations_response.text}")

This Python code snippet first retrieves the current fuel prices for a specific station using its unique ID. It then demonstrates how to list stations within a 5 km radius of given coordinates (Berlin city center) that offer 'e5' fuel. Replace YOUR_API_KEY_HERE with your actual API key for the code to function correctly. The API also supports filtering for specific fuel types and brands, offering flexibility in data retrieval. For more advanced queries and parameters, consult the comprehensive Tankerkoenig API technical documentation.