Skip to main content

Documentation Index

Fetch the complete documentation index at: https://nozle.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks through a complete integration calling all three endpoints. Use it as a starting point and adapt to your specific use case.

Prerequisites

Contact us at rohan.iyer@nozlerouting.com to request a key. Keys are issued per partner and can be rate-limited or revoked independently.

Complete Example

The example below computes a route from San Francisco to Los Angeles, enriches a single station with route-relative distance information, and computes the optimal fueling plan.
import requests

BASE = 'https://api.nozlerouting.com'
HEADERS = {'X-API-Key': 'YOUR_API_KEY'}

# 1. Compute a route
route = requests.post(f'{BASE}/v1/routes', headers=HEADERS, json={
    'origin': 'San Francisco, CA',
    'destination': 'Los Angeles, CA',
}).json()['route']

# 2. Enrich your stations with route-relative positions
stations = [{
    'id': 'STATION_001',
    'name': 'Pilot Lost Hills',
    'address': '14808 Warren St, Lost Hills, CA',
    'location': {'lat': 35.6151, 'lng': -119.6588},
    'price_per_gallon': 4.39,
    'fuel_type': 'diesel',
}]
enriched = requests.post(
    f'{BASE}/v1/stations/enrich-distances',
    headers=HEADERS,
    json={'route': route, 'stations': stations}
).json()['stations']

# 3. Optimize
result = requests.post(f'{BASE}/v1/optimize', headers=HEADERS, json={
    'route': route,
    'stations': enriched,
    'vehicle': {
        'mpg': 6.5,
        'tank_capacity_gallons': 240.0,
        'current_fuel_gallons': 30.0,
    },
}).json()

print(f"Recommended stops: {len(result['stops'])}")
print(f"Net cost: ${result['summary']['baseline_comparison']['optimizer_net_fuel_cost']:.2f}")

Response

The /v1/optimize response includes:
  • stops — ordered list of recommended fueling stops with gallons to purchase and cost at each
  • summary — total cost, fuel consumed, trip time, and baseline comparison
  • summary.baseline_comparison — savings vs. naive 25%-threshold refueling

Next Steps

API Reference

Detailed reference for each endpoint

Integration Patterns

Common integration architectures for different use cases

Authentication

Managing API keys and request authentication

Try the Demo

See the pipeline in action with synthetic data