# Introduction
Source: https://docs.footstep.ai/api/ai
Natural language queries and address intelligence
## Natural Language Endpoints
The natural language endpoints accept unstructured input and return structured geospatial results. Send plain text or messy address data, get back clean coordinates, routes, and corrected addresses.
### Endpoints
| Endpoint | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [`POST /v1/ai/query`](/api/endpoint/query) | Natural language to structured geospatial results. Send text like "Walking route from Kings Cross to Tower Bridge" and get back a route. |
| [`POST /v1/ai/parse-address`](/api/endpoint/parse-address) | Correct, standardize, and structure messy addresses. Fixes typos, expands abbreviations, infers missing fields. |
### Route narratives
The standard [route](/api/endpoint/route) and [optimise](/api/endpoint/optimize) endpoints also support natural language summaries. Pass `narrative: true` to get a human-readable description of the route:
```json theme={null}
{
"locations": [...],
"narrative": true
}
```
The response includes a `narrative` field:
```json theme={null}
{
"route": {
"distance_meters": 5765,
"duration_seconds": 812,
"narrative": "A 5.8km drive south through central London, about 14 minutes. Mostly flat with 12m total ascent. No tolls or motorways.",
"terrain": { ... }
}
}
```
### Authentication
All endpoints require an API key via the `x-api-key` header. See the [authentication guide](/authentication) for details.
# Autocomplete
Source: https://docs.footstep.ai/api/endpoint/autocomplete
GET /v1/geocoding/autocomplete
Typeahead search: get suggestions as the user types. Optimised for low-latency responses. Supply `focus.point.lat`+`focus.point.lon` whenever you have spatial context — the user's current location, map viewport, last-known anchor — so suggestions reflect where they are. Add `boundary.country` (comma-separated ISO 3166-1 alpha-3 codes) when the search context is country-bound.
# Batch Geocode
Source: https://docs.footstep.ai/api/endpoint/batch
POST /v1/geocoding/batch
Batch geocode a list of addresses in a single request. Each item can be free text or structured address components. Results are returned per-item with the original index preserved, so failed items don't break the batch. Use this for spreadsheet imports, database enrichment, or any bulk geocoding task.
# Compare Routes
Source: https://docs.footstep.ai/api/endpoint/compare
POST /v1/routing/compare
Calculate routes between the same locations using multiple travel modes and return a side-by-side comparison. Includes distance, duration, and terrain difficulty for each mode, plus a summary showing which is fastest, shortest, and easiest. Useful for deciding how to travel.
# Get Elevation
Source: https://docs.footstep.ai/api/endpoint/elevation
POST /v1/routing/elevation
Query elevation values for coordinates or an encoded polyline. Returns height values with a computed summary including ascent, descent, min/max/avg elevation.
# Find and Route
Source: https://docs.footstep.ai/api/endpoint/find-and-route
POST /v1/routing/find-and-route
Find a place by name or address, then calculate a route to it from your origin. Combines geocoding and routing in a single call. Returns the matched destination, the full route with terrain analytics, and alternative geocoding matches.
# Calculate Isochrone
Source: https://docs.footstep.ai/api/endpoint/isochrone
POST /v1/routing/isochrone
Compute reachability polygons (isochrones) from an origin point. Pass `from` as a place name and the origin is geocoded for you, or pass `locations` if you already have coordinates. Returns one or more contour polygons capped by time or distance.
# Locate on Road
Source: https://docs.footstep.ai/api/endpoint/locate
POST /v1/routing/locate
Check if coordinates are on a routable road and get the nearest snapped position. Returns distance, on-road status, and optionally edge metadata (road class, surface, speed).
# Calculate Matrix
Source: https://docs.footstep.ai/api/endpoint/matrix
POST /v1/routing/matrix
Compute a time and distance matrix between sources and targets. Returns a 2D matrix indexed by [source][target] with distance_meters and duration_seconds for each pair. Null cells indicate unreachable pairs. All distances are in meters regardless of request units.
# Optimise Route
Source: https://docs.footstep.ai/api/endpoint/optimize
POST /v1/routing/optimize
Find the optimal order to visit multiple locations. Returns the optimised route with terrain analytics and savings (distance and time) compared to the original order.
# Parse Address
Source: https://docs.footstep.ai/api/endpoint/parse
GET /v1/geocoding/parse
Break a free-text address into structured components (house number, road, city, state, postcode, country). Use this to normalise messy address data before passing it to structured search, or to understand what parts of an address were recognised.
# Parse Address
Source: https://docs.footstep.ai/api/endpoint/parse-address
POST /v1/ai/parse-address
Parse, correct, and standardize addresses using AI. Fixes typos, expands abbreviations, infers missing components (postcode, region, country), and returns structured address components with a confidence score. Each correction is itemised so you can see exactly what changed.
Send messy, incomplete, or malformed addresses and get back clean, structured, corrected results. Every correction is itemised so you can see exactly what changed and why.
## What it corrects
| Correction type | Example |
| --------------- | ----------------------------------------------------------- |
| `typo` | "Main Stret" to "Main Street" |
| `abbreviation` | "downing st" to "Downing Street", "uk" to "United Kingdom" |
| `inferred` | Missing postcode, region, or country filled in from context |
| `reformatted` | "apt 4b" to "Apt 4B" (capitalization, formatting) |
| `removed` | Duplicate or irrelevant fragments stripped out |
## When to use this vs. `/parse`
The standard [/parse](/api/endpoint/parse) endpoint is a deterministic parser. It breaks an address into components but doesn't correct errors or fill gaps.
`/ai/parse-address` uses AI to understand what the address *should* be. Use it when:
* Your input has typos or misspellings
* Address fields are missing (no postcode, no country)
* You're processing user-submitted data that hasn't been validated
* You need confidence scores for data quality assessment
* You want to standardize formatting across a dataset
## Batch processing
Send up to 100 addresses per request. Each result includes the original index so you can match results back to your input:
```json theme={null}
{
"addresses": [
{ "text": "123 Main Stret, new york" },
{ "text": "10 downing st, london, uk" },
{ "text": "buckingham palace" }
]
}
```
For more than 100 addresses, split into multiple requests.
## Country hints
Pass `country` on individual addresses to improve accuracy, especially for ambiguous inputs:
```json theme={null}
{
"addresses": [
{ "text": "123 Main Street", "country": "USA" },
{ "text": "123 Main Street", "country": "GBR" }
]
}
```
The same input with different country hints can produce different results (different postcodes, regions, formatting conventions).
## Confidence scores
Each result has a `confidence` score from 0 to 1:
| Range | Meaning |
| --------- | ----------------------------------------------------------------------- |
| 0.9 - 1.0 | High confidence. Input was clean or corrections are well-supported. |
| 0.7 - 0.9 | Moderate confidence. Some inference was needed. Review recommended. |
| 0.5 - 0.7 | Low confidence. Significant guessing involved. Manual review suggested. |
| Below 0.5 | Very low confidence. Input may be too ambiguous to correct reliably. |
# Search Places
Source: https://docs.footstep.ai/api/endpoint/places
GET /v1/geocoding/places
Find points of interest (cafes, supermarkets, parks, ATMs, etc.) near a location. Prefer `near.lat`+`near.lon` whenever you already have coordinates — this disambiguates common place names that exist in multiple countries. Use `near` only when you genuinely have just a place name, and qualify it tightly (e.g. 'Kings Cross, London' not 'Kings Cross'; 'Lebanon, NH' not 'Lebanon'). Add `boundary.country` to restrict results when the search context is country-bound. For 'find X near Y' queries, prefer this over a separate `/v1/geocoding/search` call.
# Predict
Source: https://docs.footstep.ai/api/endpoint/predict
POST /v1/predict
Generate spatial probability predictions for behavioural profiles
**Research Preview** — Predictions are generated from behavioural models that have not yet been fully validated against real-world outcomes. Access is granted on request — contact [support@footstep.ai](mailto:support@footstep.ai).
Generate spatial probability distributions for missing person scenarios. Given a last known position, a behavioural profile (age, condition, possible intent), and a search area, `predict` returns a probability-ranked grid covering that area — so search teams can prioritise the highest-likelihood ground.
The search area can be a circle (centre + radius), a polygon (GeoJSON), or a buffered path (LineString + buffer width). Weather and time-of-day are folded in automatically; weather can be overridden with explicit conditions or disabled entirely.
# Query
Source: https://docs.footstep.ai/api/endpoint/query
POST /v1/ai/query
Accept a natural language query and return structured geospatial results. The endpoint classifies intent (route, geocode, isochrone, etc.), extracts locations and parameters, calls the appropriate backend, and returns the full result with a natural language summary. Use context.location to help resolve relative references like 'nearest' or 'nearby'.
Send a natural language query and get back structured geospatial results. The endpoint figures out what you're asking for (directions, a location, reachability, etc.), resolves any text locations to coordinates, calls the appropriate backend, and returns the full result.
## How intent is classified
The endpoint maps queries to the backend that best fits:
| Your query sounds like... | Intent | Backend called |
| ---------------------------------- | ----------------- | ------------------------------------------------ |
| "Directions from A to B" | `route` | [/v1/routing/route](/api/endpoint/route) |
| "Best order to visit these stops" | `optimize` | [/v1/routing/optimize](/api/endpoint/optimize) |
| "How far can I walk in 30 minutes" | `isochrone` | [/v1/routing/isochrone](/api/endpoint/isochrone) |
| "What's the elevation at..." | `elevation` | [/v1/routing/elevation](/api/endpoint/elevation) |
| "Distance between A, B, and C" | `matrix` | [/v1/routing/matrix](/api/endpoint/matrix) |
| "Where is..." / "Find..." | `geocode` | [/v1/geocoding/search](/api/endpoint/search) |
| "What's at these coordinates" | `reverse_geocode` | [/v1/geocoding/reverse](/api/endpoint/reverse) |
## Using context
Pass `context.location` when your query uses relative terms like "nearest", "nearby", or "from here". Without it, the endpoint can't resolve those references.
Pass `context.country` to disambiguate place names. "Springfield" with `country: "GBR"` resolves differently than with `country: "USA"`.
```json theme={null}
{
"query": "Walking directions to the nearest park",
"context": {
"location": { "lat": 51.5322, "lon": -0.1240 },
"country": "GBR"
}
}
```
## Response structure
The response always includes:
| Field | What it contains |
| ------------ | ------------------------------------------------------------------------ |
| `intent` | What the query was classified as (`route`, `geocode`, `isochrone`, etc.) |
| `parameters` | The parameters inferred from the query and passed to the backend |
| `result` | The full backend response (same schema as calling the endpoint directly) |
| `summary` | A natural language summary of the result |
The `result` field contains the exact same response you'd get calling the backend endpoint directly. If the intent is `route`, `result` contains a `RouteResponse`. If `geocode`, it contains a `GeocodingSearchResponse`. No new schemas to learn.
## Error handling
If the query is ambiguous or can't be resolved:
```json theme={null}
{
"error": "ambiguous_query",
"message": "Could not determine a specific intent from your query.",
"suggestions": [
"Try: 'Directions from A to B'",
"Try: 'Where is [place name]?'",
"Try: 'How far can I drive in 30 minutes from [location]?'"
]
}
```
If a location in the query can't be geocoded, the response includes what was resolved and what failed:
```json theme={null}
{
"error": "geocode_failed",
"message": "Could not find a location matching 'the old pub near the river'.",
"partial": {
"intent": "route",
"resolved_locations": [
{ "text": "Kings Cross", "resolved": { "lat": 51.53, "lon": -0.12 } }
],
"unresolved_locations": [
{ "text": "the old pub near the river" }
]
}
}
```
# Reverse Geocode
Source: https://docs.footstep.ai/api/endpoint/reverse
GET /v1/geocoding/reverse
Reverse geocode: convert geographic coordinates into a human-readable address or place name. Returns the nearest matching locations sorted by proximity.
# Calculate Route
Source: https://docs.footstep.ai/api/endpoint/route
POST /v1/routing/route
Calculate a route between two or more locations. Returns turn-by-turn directions with terrain analytics (ascent, descent, grade, difficulty) included by default. All distances are in meters, durations in seconds.
# Search
Source: https://docs.footstep.ai/api/endpoint/search
GET /v1/geocoding/search
Forward geocode: convert a text query (address, place name, landmark) into geographic coordinates. Results are ranked by relevance. Whenever you have any spatial context — the user's visible viewport, last-known location, a prior result — supply `focus.point.lat`+`focus.point.lon` so common place names ('Cambridge', 'Bath', 'Lebanon') resolve to the one the caller means. Add `boundary.country` (comma-separated ISO 3166-1 alpha-3 codes) when the search context is country-bound.
# Search Along Route
Source: https://docs.footstep.ai/api/endpoint/search-along-route
POST /v1/routing/search-along-route
Calculate a route between locations and search for places along the corridor. Results are ranked by how little detour they add. Useful for finding stops (petrol stations, restaurants, charging points) on the way to a destination.
# Snap GPS Trace
Source: https://docs.footstep.ai/api/endpoint/snap
POST /v1/routing/snap
Map-match a GPS trace to the road network. Returns a snapped polyline with confidence score. Optionally includes directions with terrain analytics, road attributes (surface, grade, road class), and per-point match quality.
# Structured Search
Source: https://docs.footstep.ai/api/endpoint/structured-search
GET /v1/geocoding/structured-search
Forward geocode using structured address components instead of free text. More precise than text search when you already have address fields separated (e.g. from a database or form). Provide as many fields as you have. The more you provide, the more accurate the result.
# Introduction
Source: https://docs.footstep.ai/api/geocoding
Geocoding for addresses, places, and coordinates
## Footstep Geocoding API
The Geocoding API converts between text and coordinates. Search for an address and get back coordinates, or send coordinates and get back an address.
### Design philosophy
Every request is one line. Send text, get coordinates:
```bash theme={null}
curl "https://api.footstep.ai/v1/geocoding/search?text=Buckingham+Palace" \
-H "x-api-key: sk_live_your_key_here"
```
Every result includes a confidence score (0-1), so you always know how reliable a match is.
### Response conventions
Every geocoding result uses the same shape:
```json theme={null}
{
"coordinates": { "lat": 51.5014, "lng": -0.1419 },
"label": "Buckingham Palace, London, England, United Kingdom",
"name": "Buckingham Palace",
"country": "United Kingdom",
"country_code": "GBR",
"region": "England",
"locality": "London",
"confidence": 0.95,
"place_type": "venue"
}
```
| Field | What it tells you |
| ------------- | ----------------------------------------------- |
| `coordinates` | WGS 84 latitude and longitude |
| `label` | Pre-formatted display string |
| `confidence` | 0 to 1. How well this result matched your query |
| `place_type` | What type of place this is (see below) |
### Place Types
Filter results by type using the `place_types` parameter:
| Place Type | Description | Example |
| --------------- | ------------------------------------------ | ----------------- |
| `venue` | Named places: businesses, landmarks, parks | Buckingham Palace |
| `address` | Street addresses | 10 Downing Street |
| `street` | Street names without house numbers | Oxford Street |
| `neighbourhood` | Neighbourhoods and suburbs | Shoreditch |
| `locality` | Cities and towns | London |
| `county` | Counties and districts | Greater London |
| `region` | States, provinces, regions | England |
| `country` | Countries | United Kingdom |
### Endpoints
| Endpoint | Description |
| ----------------------------------------------------------- | -------------------------------------------------------------------------- |
| [`GET /search`](/api/endpoint/search) | Text to coordinates. Search for any address, place, or landmark |
| [`GET /structured-search`](/api/endpoint/structured-search) | Text to coordinates. Search by address components (street, city, postcode) |
| [`GET /reverse`](/api/endpoint/reverse) | Coordinates to address. Find what's at a given lat/lng |
| [`GET /autocomplete`](/api/endpoint/autocomplete) | Typeahead suggestions as the user types |
| [`POST /batch`](/api/endpoint/batch) | Geocode up to 1,000 addresses in a single request |
| [`GET /parse`](/api/endpoint/parse) | Break a free-text address into structured components |
### When to use which
| You want to... | Use |
| ----------------------------------------- | ----------------------------------------------------------------------------------- |
| Build a search box with suggestions | [Autocomplete](/api/endpoint/autocomplete) |
| Geocode a known address | [Search](/api/endpoint/search) |
| Geocode address fields from a database | [Structured search](/api/endpoint/structured-search) |
| Find what's at a map pin | [Reverse](/api/endpoint/reverse) |
| Process a spreadsheet of addresses | [Batch](/api/endpoint/batch) |
| Clean messy address data before geocoding | [Parse](/api/endpoint/parse) → [Structured search](/api/endpoint/structured-search) |
### Focus and boundary
Two shared parameters work across search and autocomplete:
**`focus.point`** biases results towards a location without excluding distant matches. Useful when "Springfield" should prefer the one near your user, not the largest one globally.
```
/v1/geocoding/search?text=Springfield&focus.point.lat=39.78&focus.point.lon=-89.65
```
**`boundary.country`** restricts results to one or more countries. Pass ISO 3166-1 alpha-3 codes:
```
/v1/geocoding/search?text=London&boundary.country=GBR
```
### Authentication
All endpoints require an API key passed via the `x-api-key` header. See the [authentication guide](/authentication) for details.
# Introduction
Source: https://docs.footstep.ai/api/predict
Spatial probability predictions powered by Footstep Nova
**Research Preview** — The Predict API is a research preview. Predictions are generated from behavioural models that have not yet been fully validated against real-world outcomes. This endpoint is not intended for use as the sole or primary basis for operational search and rescue decisions. Access is granted on request — contact [support@footstep.ai](mailto:support@footstep.ai) to get started.
## Predict API
The Predict API generates spatial probability distributions for missing person scenarios. Given a search area, subject profile, and environmental conditions, it returns per-hex probabilities across an [H3](https://h3geo.org/) grid — telling you where to look first.
## Models
### Footstep Nova family
Footstep Nova is a family of spatial prediction models purpose-built for missing person scenarios. Nova models combine terrain analysis, land use classification, points of interest, weather conditions, and time-of-day signals to predict the most likely locations for a subject based on their behavioural profile.
Nova supports multiple behavioural profiles. Each model accounts for how different subject types interact with their environment — a despondent individual moves differently to someone with dementia.
#### footstep-nova-1
The first release in the Nova family. Nova 1 delivers profile-aware, weather-aware spatial predictions across flexible search areas.
***
## Key capabilities
* **Profile-aware predictions** — select a behavioural profile that matches your subject. Each profile produces a distinct probability distribution based on how that subject type interacts with the environment.
* **Directional search** — when the initial direction of travel is known, results are automatically focused to a directional cone, reducing noise and prioritising the most relevant area.
* **Weather-aware** — the model factors in temperature, precipitation, and wind conditions. Weather is fetched automatically or can be overridden for historical analysis.
* **Flexible search areas** — define your area as a circle, polygon, or buffered path. The API handles hex grid generation and clipping.
## How to use it
1. Choose a **profile** matching the subject's behavioural category.
2. Define a **search area** — circle (centre + radius), polygon (GeoJSON), or buffered path.
3. Provide **subject parameters** — age, optional direction of travel, and date/time.
4. The API returns a ranked list of hexagons with probabilities. Higher probability hexes should be searched first.
## Endpoint
| Endpoint | Description |
| ------------------------------------------- | ----------------------------------------------------------------- |
| [`POST /v1/predict`](/api/endpoint/predict) | Generate spatial predictions for a given profile and search area. |
## Area types
| Type | Fields | Max size |
| --------- | ------------------------------------------ | ------------ |
| `circle` | `center` (lat/lng) + `radius_m` | 5 km radius |
| `polygon` | GeoJSON `Polygon` geometry | 25 km² |
| `path` | GeoJSON `LineString` geometry + `buffer_m` | 500 m buffer |
## Weather
By default, the API fetches weather conditions automatically based on the search area centre and the provided `datetime`. You can:
* **Override weather** — pass a `weather` object with `temperature_c`, `precipitation_mmh`, `wind_speed_mps`, and `wind_direction_deg`.
* **Disable weather** — set `disableWeather: true` to use neutral defaults.
## Confidence
The response includes a `confidence` level (`high`, `medium`, or `low`) indicating how well the model performs in the region of the search area.
## Access
The Predict API is available on request. Contact [support@footstep.ai](mailto:support@footstep.ai) to enable it on your account.
Once enabled, authentication works the same as all other endpoints — pass your `x-api-key` header. See the [authentication guide](/authentication) for details.
# Introduction
Source: https://docs.footstep.ai/api/routing
Terrain-intelligent routing and spatial analysis API
## Footstep Routing API
The Routing API provides terrain-intelligent routing, elevation queries, and spatial analysis. Every routing response includes terrain analytics by default: ascent, descent, grade profiles, and difficulty classification, without any extra configuration.
### Design philosophy
Every endpoint works with just coordinates. Send locations, get a route with full terrain intelligence:
```json theme={null}
POST /v1/routing/route
{
"locations": [
{ "lat": 51.5322, "lon": -0.1240 },
{ "lat": 51.5055, "lon": -0.0754 }
]
}
```
No transport mode, no options, no configuration required. The defaults give you a car route with terrain analytics, turn-by-turn directions, and an elevation profile.
Power users can tune behaviour with optional parameters: `travel` to change how you travel, `travel_options` for fine-tuning preferences (hill avoidance, walking speed, vehicle dimensions), `elevation_interval` to control elevation sampling density, and `language` for localised navigation instructions.
### Units
Numeric fields are always in SI base units regardless of the `units` request parameter — distances in meters, durations in seconds, elevations in meters, grades as a percentage, speeds in km/h. The `units` request parameter only affects the natural-language `narrative` summary; the response echoes that value back in `narrative_units` for reference.
### Endpoints
All endpoints are `POST` requests under `/v1/routing/`:
| Endpoint | Description |
| -------------------------------------------- | -------------------------------------------------------------------------- |
| [`POST /route`](/api/endpoint/route) | Route between locations with terrain analytics and turn-by-turn directions |
| [`POST /optimize`](/api/endpoint/optimize) | Find the best order to visit multiple stops |
| [`POST /snap`](/api/endpoint/snap) | Map-match GPS traces to the road network |
| [`POST /elevation`](/api/endpoint/elevation) | Elevation queries with computed summary statistics |
| [`POST /isochrone`](/api/endpoint/isochrone) | Time or distance-based reachability polygons |
| [`POST /matrix`](/api/endpoint/matrix) | Time/distance matrices for logistics and dispatching |
| [`POST /locate`](/api/endpoint/locate) | Snap coordinates to the nearest road with metadata |
### Authentication
All endpoints require an API key passed via the `x-api-key` header. See the [authentication guide](/authentication) for details on key format, states, and security practices.
```bash theme={null}
curl -X POST https://api.footstep.ai/v1/routing/route \
-H "x-api-key: sk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{"locations": [{"lat": 51.5322, "lon": -0.1240}, {"lat": 51.5055, "lon": -0.0754}]}'
```
### Travel types
All routing endpoints accept a `travel` parameter:
| Travel | Description |
| ------------ | ------------------------------------------------------------------------------------------------------ |
| `auto` | Car routing (default). Respects one-way streets, turn restrictions, and road hierarchy |
| `pedestrian` | Walking and hiking. Factors in terrain grade, avoids motorways, supports SAC hiking difficulty scale |
| `bicycle` | Cycling. Considers surface type, hill gradients. Supports road, hybrid, cross, and mountain bike types |
| `bus` | Bus routing. Similar to auto with bus-specific road access |
| `truck` | Truck routing. Respects vehicle height, width, weight, and axle load restrictions |
Each travel type has its own `travel_options` for fine-tuning. For example, `pedestrian` supports `use_hills` (0 = avoid hills, 1 = prefer hills), `walking_speed` (0.5-25 km/h), and `max_hiking_difficulty` (0-6, SAC hiking scale). See the [route endpoint](/api/endpoint/route) for the full schema.
### Multi-format support
Every endpoint accepts a `format` parameter:
| Format | Content-Type | Best for |
| -------------------- | ---------------------- | ------------------------------------------------------------------------------- |
| `footstep` (default) | `application/json` | App developers. Compact encoded polyline geometry, flat structure, optimised DX |
| `geojson` | `application/geo+json` | GIS tools. Standard GeoJSON FeatureCollection with decoded coordinates |
GeoJSON responses work directly with Leaflet, Mapbox GL, deck.gl, and QGIS with no transformation needed.
```json theme={null}
{
"locations": [...],
"format": "geojson"
}
```
### Terrain analytics
Routing responses include a `terrain` object at both the route and per-leg level:
```json theme={null}
{
"terrain": {
"total_ascent_meters": 12.4,
"total_descent_meters": 8.1,
"max_elevation_meters": 28,
"min_elevation_meters": 5,
"avg_grade_percent": 1.2,
"max_grade_percent": 4.5,
"elevation_profile": [
{ "distance_meters": 0, "elevation_meters": 22 },
{ "distance_meters": 30, "elevation_meters": 20 }
],
"difficulty": "flat"
}
}
```
The `elevation_profile` is an array of distance/elevation points sampled along the route. Control the sampling interval with the `elevation_interval` parameter (10-200 meters, default 30).
The `difficulty` classification is based on average and maximum grade:
| Difficulty | Average grade | Maximum grade |
| ------------- | ------------- | ------------- |
| `flat` | \< 2% | \< 5% |
| `rolling` | \< 4% | \< 8% |
| `hilly` | \< 6% | \< 15% |
| `mountainous` | >= 6% | >= 15% |
### Route flags
Every route and leg includes a `flags` object indicating infrastructure used:
```json theme={null}
{
"flags": {
"has_toll": false,
"has_highway": true,
"has_ferry": false
}
}
```
Use these to inform users about tolls, filter routes, or display warnings in your UI.
### Route narratives
Pass `narrative: true` to get an AI-generated natural language summary of the route. Useful for accessibility descriptions, trip previews, and chatbot integrations.
```json theme={null}
{
"locations": [
{ "lat": 51.5322, "lon": -0.1240 },
{ "lat": 51.5055, "lon": -0.0754 }
],
"narrative": true
}
```
The response includes a `narrative` field on the route object:
```json theme={null}
{
"route": {
"narrative": "A 5.8km drive south through central London, about 14 minutes. Head south from King's Cross through Clerkenwell, then east along the river to Tower Bridge. Mostly flat with 12m total ascent. No tolls or motorways."
}
}
```
This parameter is available on the [route](/api/endpoint/route) and [optimise](/api/endpoint/optimize) endpoints. Adds \~500ms latency due to AI generation.
# Authentication
Source: https://docs.footstep.ai/authentication
Authenticate requests with your API key
Every request to the Footstep API must include an API key. This page explains how keys work, what happens when authentication fails, and how to keep your keys secure.
## How it works
Pass your API key in the `x-api-key` header on every request. The API validates the key before processing. If it's missing, malformed, or invalid, the request is rejected immediately.
The MCP server also accepts the standard `Authorization: Bearer ` form for compatibility with MCP SDKs whose default is Bearer authentication. Either header is fine; `x-api-key` is the recommended form across all Footstep surfaces.
```bash cURL theme={null}
curl -X POST https://api.footstep.ai/v1/routing/route \
-H "x-api-key: sk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{"locations": [{"lat": 51.5322, "lon": -0.1240}, {"lat": 51.5055, "lon": -0.0754}]}'
```
```javascript JavaScript theme={null}
const response = await fetch("https://api.footstep.ai/v1/routing/route", {
method: "POST",
headers: {
"x-api-key": process.env.FOOTSTEP_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
locations: [
{ lat: 51.5322, lon: -0.1240 },
{ lat: 51.5055, lon: -0.0754 },
],
}),
});
```
```python Python theme={null}
import os
import requests
response = requests.post(
"https://api.footstep.ai/v1/routing/route",
headers={"x-api-key": os.environ["FOOTSTEP_API_KEY"]},
json={
"locations": [
{"lat": 51.5322, "lon": -0.1240},
{"lat": 51.5055, "lon": -0.0754},
]
},
)
```
## Key format
All API keys follow the format `sk_live_*` (e.g. `sk_live_abc123def456`). If the key you're sending doesn't start with `sk_live_`, the API will reject it with a `401`.
Create and manage keys at [console.footstep.ai](https://console.footstep.ai).
## Key states
Keys can be in one of several states. The API checks the key's state and your account balance on every request:
| State | HTTP status | Error message | What to do |
| -------------------- | ----------- | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Active | `200` | - | Key is working normally |
| Insufficient balance | `402` | `Insufficient balance. Please top up your account.` | Top up your account at [console.footstep.ai](https://console.footstep.ai). The key itself is fine — only the balance is blocking the request |
| Suspended | `403` | `API key is suspended` | Contact support. Your key has been temporarily disabled |
| Revoked | `403` | `API key has been revoked` | Generate a new key in the console. Revoked keys cannot be reactivated |
| Not found | `403` | `Invalid API key` | Check for typos. If correct, the key may have been deleted |
| Missing or malformed | `401` | `Missing or invalid API key format` | Ensure you're sending the `x-api-key` header with a valid `sk_live_*` key |
A `401` means the request had no valid key at all. A `402` means the key is valid and active but your account has no credit — top up to resume requests. A `403` means the key was recognised but isn't allowed: it's been suspended, revoked, or doesn't exist.
## Security best practices
API keys are for server-side use only. Never expose them in frontend code, mobile apps, or browser JavaScript. Anyone who has your key can make requests on your behalf.
* **Use environment variables.** Store keys in `FOOTSTEP_API_KEY` or your platform's secret manager, not in source code.
* **Never include keys in query strings.** Query strings appear in server logs, browser history, and CDN caches. Always use the `x-api-key` header.
* **Rotate keys regularly.** Generate a new key in the console, update your services, then revoke the old one.
* **Use separate keys per environment.** Different keys for development, staging, and production make it easier to rotate and audit.
* **Restrict access.** Only share keys with services that need them. If a key is compromised, revoke it immediately and generate a replacement.
# Changelog
Source: https://docs.footstep.ai/changelog
What's new in the Footstep API
## March 2025
### MCP Server
* **Remote MCP server** at `mcp.footstep.ai`. Connect from Claude, Cursor, OpenAI, Gemini, and more with no installation required.
* **13 tools** covering routing, geocoding, elevation, isochrones, matrices, stop optimisation, route comparison, GPS trace snapping, place search, and search along route.
### Routing API
* **Route comparison** (`POST /v1/routing/compare`). Compare 2-4 travel modes between the same locations with a side-by-side summary of distance, duration, and terrain difficulty.
* **Find and route** (`POST /v1/routing/find-and-route`). Geocode a destination and route to it in one call.
* **Search along route** (`POST /v1/routing/search-along-route`). Find places along a route corridor, ranked by how little detour they add.
* **Route narratives**. Pass `narrative: true` to get an AI-generated natural language summary of any route.
### Geocoding API
* **Place search** (`GET /v1/geocoding/places`). Search for places and points of interest near a location by category or keyword.
### AI API
* **Natural language query** (`POST /v1/ai/query`). Ask a geospatial question in plain English and get a structured response.
* **Address correction** (`POST /v1/ai/parse-address`). Correct, standardise, and structure messy address strings.
### Documentation
* Initial public release of the Footstep API documentation.
# Errors
Source: https://docs.footstep.ai/errors
Error codes and how to handle them
When a request fails, the API returns a consistent JSON error body with an HTTP status code. This page covers every error you might encounter, what causes it, and how to handle it.
## Error shape
Every error response has the same structure:
```json theme={null}
{
"error": "error_code",
"message": "Human-readable description"
}
```
The `error` field is a stable, machine-readable code you can match on in your code. The `message` field is a human-readable explanation that may change over time, so don't parse it programmatically.
## Error codes
### Client errors (4xx)
These indicate a problem with the request. Fix the issue before retrying.
| HTTP status | Code | Description | Common cause |
| ----------- | ------------------- | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400` | `bad_request` | Invalid request body or parameters | Malformed JSON, missing required fields, coordinates outside valid range |
| `401` | `unauthorized` | Missing or malformed API key | No `x-api-key` header, or key doesn't match the `sk_live_*` format |
| `402` | `payment_required` | Account balance is empty | Top up at [console.footstep.ai](https://console.footstep.ai). The key is fine — only the balance is blocking the request |
| `403` | `forbidden` | Invalid, suspended, or revoked API key | Key was deleted, suspended by admin, or doesn't exist |
| `404` | `not_found` | Endpoint does not exist | Typo in the URL path, or using an unsupported HTTP method |
| `408` | `request_timeout` | Request took too long to process | Very long routes, complex optimisation problems, or temporary server load |
| `429` | `too_many_requests` | Rate limit exceeded | Per-product per-second cap exceeded for your API key. Back off and retry — the response body's `retryAfter` field gives the milliseconds until the next request will succeed. See per-product caps below. |
### Rate limits per product
Each product has its own per-second budget per API key. Hitting one cap does not affect the others — a customer using the routing API at full speed has full geocoding capacity available in parallel.
| Product | Default cap | Endpoints |
| --------- | -------------- | ------------------------------------------------------------------------------------------------------- |
| Geocoding | **10 req/sec** | `/v1/geocoding/*`, `/v1/routing/find-and-route`, `/v1/routing/search-along-route` |
| Routing | **20 req/sec** | `/v1/routing/route`, `/matrix`, `/isochrone`, `/snap`, `/locate`, `/elevation`, `/optimize`, `/compare` |
| AI | **5 req/sec** | `/v1/ai/*` |
| Predict | **2 req/sec** | `/v1/predict` |
| Telemetry | **50 req/sec** | `/v1/telemetry/*` |
Note that `/v1/routing/find-and-route` and `/v1/routing/search-along-route` count against the **geocoding** cap, not the routing cap, because they internally perform a geocode.
When you exceed a cap, the response is `429 too_many_requests` with a `retryAfter` field giving the milliseconds until your next request will succeed.
### Server errors (5xx)
These indicate a problem on our side. They are usually transient and safe to retry.
| HTTP status | Code | Description | Common cause |
| ----------- | --------------------- | -------------------------------------- | ------------------------------------------------------------ |
| `502` | `bad_gateway` | Upstream service unreachable | The routing engine is starting up or temporarily unreachable |
| `503` | `service_unavailable` | Routing engine temporarily unavailable | Maintenance or deployment in progress |
| `504` | `gateway_timeout` | Upstream service timed out | The routing engine took too long to respond |
## Handling errors in code
Check the HTTP status code first, then read the `error` field for specifics:
```javascript JavaScript theme={null}
const response = await fetch("https://api.footstep.ai/v1/routing/route", {
method: "POST",
headers: {
"x-api-key": process.env.FOOTSTEP_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ locations }),
});
if (!response.ok) {
const { error, message } = await response.json();
switch (error) {
case "bad_request":
// Fix the request, don't retry
console.error("Invalid request:", message);
break;
case "unauthorized":
case "forbidden":
// Check your API key
console.error("Auth failed:", message);
break;
case "too_many_requests":
// Back off and retry
break;
default:
// Server error, retry with backoff
break;
}
}
```
```python Python theme={null}
import os
import requests
response = requests.post(
"https://api.footstep.ai/v1/routing/route",
headers={"x-api-key": os.environ["FOOTSTEP_API_KEY"]},
json={"locations": locations},
)
if not response.ok:
data = response.json()
error = data["error"]
message = data["message"]
if error == "bad_request":
# Fix the request - don't retry
raise ValueError(f"Invalid request: {message}")
elif error in ("unauthorized", "forbidden"):
# Check your API key
raise PermissionError(f"Auth failed: {message}")
elif error == "too_many_requests":
# Back off and retry
pass
else:
# Server error - retry with backoff
pass
```
## Retry strategy
Some errors are transient and safe to retry. Use exponential backoff with jitter to avoid thundering herd problems, where all your retries hit the server at the same time:
```javascript theme={null}
async function fetchWithRetry(url, options, maxRetries = 3) {
const retryable = new Set([408, 429, 502, 503, 504]);
for (let attempt = 0; attempt <= maxRetries; attempt++) {
const response = await fetch(url, options);
if (response.ok || !retryable.has(response.status)) {
return response;
}
if (attempt < maxRetries) {
// Exponential backoff: 1s, 2s, 4s... capped at 30s
const delay = Math.min(1000 * 2 ** attempt, 30000);
// Add random jitter (50-100% of delay) to spread out retries
const jitter = delay * (0.5 + Math.random() * 0.5);
await new Promise((resolve) => setTimeout(resolve, jitter));
}
}
}
```
| Safe to retry | Do not retry |
| ----------------------------- | ----------------------------- |
| `408` `429` `502` `503` `504` | `400` `401` `402` `403` `404` |
## Common mistakes
Make sure you're using the `x-api-key` header (not `Authorization` or `api-key`), and that your key starts with `sk_live_`. Keys passed as query parameters or in the request body are not recognised.
Check that latitude is between -90 and 90, and longitude is between -180 and 180. A common mistake is swapping lat/lon. If your latitude is something like `51.5` but your longitude is `151.2`, the coordinates may point to an area with no road network data.
# Configuration
Source: https://docs.footstep.ai/mcp/configuration
Set up the Footstep MCP server with your client
Connect to the hosted server at `mcp.footstep.ai`. No installation, no Node.js required.
## Claude Desktop
Add to your `claude_desktop_config.json` (Settings > Developer > Edit Config):
```json theme={null}
{
"mcpServers": {
"footstep": {
"url": "https://mcp.footstep.ai",
"headers": {
"x-api-key": "sk_live_your_key_here"
}
}
}
}
```
## Cursor / Claude Code / Cline
Add to your project's `.mcp.json` (or the equivalent MCP config for your client):
```json theme={null}
{
"mcpServers": {
"footstep": {
"url": "https://mcp.footstep.ai",
"headers": {
"x-api-key": "sk_live_your_key_here"
}
}
}
}
```
## OpenAI Agents SDK
```python theme={null}
from agents import Agent
from agents.mcp import MCPServerStreamableHttp
footstep = MCPServerStreamableHttp(
url="https://mcp.footstep.ai",
headers={"x-api-key": "sk_live_your_key_here"},
)
agent = Agent(
name="travel-agent",
instructions="You help plan routes and find locations.",
mcp_servers=[footstep],
)
```
## Google Gemini (via LangChain)
```python theme={null}
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain_google_genai import ChatGoogleGenerativeAI
from langgraph.prebuilt import create_react_agent
client = MultiServerMCPClient({
"footstep": {
"url": "https://mcp.footstep.ai",
"headers": {"x-api-key": "sk_live_your_key_here"},
"transport": "streamable_http",
}
})
tools = await client.get_tools()
model = ChatGoogleGenerativeAI(model="gemini-2.0-flash")
agent = create_react_agent(model, tools)
```
## Vercel AI SDK
```typescript theme={null}
import { experimental_createMCPClient as createMCPClient } from "ai";
const client = await createMCPClient({
transport: {
type: "http",
url: "https://mcp.footstep.ai",
headers: { "x-api-key": "sk_live_your_key_here" },
},
});
const tools = await client.tools();
// Pass tools to any model: OpenAI, Anthropic, Google, etc.
```
## Custom agents
Any MCP client that supports Streamable HTTP transport can connect. Point it at `https://mcp.footstep.ai` and pass your API key in the `x-api-key` header.
The MCP server also accepts the standard `Authorization: Bearer ` form, so MCP SDKs that default to Bearer authentication work without configuration changes. `x-api-key` remains the recommended header.
## Reading responses
Tool results are returned in the MCP `structuredContent` field as parsed JSON — no `JSON.parse` step required. See [response shape](/mcp/response-shape) for the full envelope and the [error code reference](/mcp/response-shape#error-codes).
## Tuning what you get back
Every renderer-aware tool defaults to **rich responses** — geometry, render-ready GeoJSON layers, and full result sets are all included. Token-conscious LLM agents pass `compact: true` to suppress geometry and render envelopes; renderer-aware clients keep the defaults. See [response defaults & controls](/mcp/defaults).
# Response defaults & controls
Source: https://docs.footstep.ai/mcp/defaults
How rich-by-default works and how to tune what each tool returns
Footstep's MCP tools default to **rich responses** — render-ready GeoJSON layers, full hex grids, and elevation summaries are all included unless you opt out. This page describes the philosophy and the flags that tune it.
## Rich-by-default
Every renderer-aware tool returns:
* **Summary fields** — distances, durations, narratives, terrain summaries, turn-by-turn steps (always present)
* **`render` envelope** — framework-agnostic GeoJSON layer descriptors a map client can drop directly into deck.gl, MapLibre, Leaflet, Mapbox, Cesium, etc. (controlled by `include_render`)
* **Full hex grid** for predictions (controlled by `include_hexes`)
All geometry in MCP responses lives in the `render` envelope as GeoJSON. There is no separate polyline encoding to decode — clients consume `render[].data` directly.
The default is rich because:
* **Renderer-aware agents** (Claude Artifacts, ChatGPT Canvas, custom mapping apps, Footstep-built clients) get a complete answer they can drop into a map without per-tool extraction logic.
* **Token-conscious LLM agents** that only want summaries pass `compact: true` once and pay nothing for geometry.
* The historical "lean defaults" caused renderer-aware agents to silently truncate work — the model would build a 4-point straight line from `bounds` corners because no flag was set. We've inverted that failure mode: by default the answer looks complete; opting out is explicit.
## Flag matrix
Every renderer-aware tool accepts these flags:
| Flag | Default | What it controls |
| --------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `include_render` | `true` | The `render` envelope — framework-agnostic GeoJSON layer descriptors. All geometry lives here. |
| `include_hexes` | `true` | The full hex grid (`cells`) on `get_prediction`. The top results stay regardless. |
| `include_elevation_samples` | `false` | Per-sample elevation profile array on routing tools (\~500 samples per route). Off even at rich defaults — niche even for renderers. |
| `compact` | `false` | When `true`, sets all three above to `false` — no render envelope, no hex grid, no elevation samples. Equivalent to opting out of every rich-mode field at once. |
### Notes on individual flags
**`include_elevation_samples` defaults `false` even at rich defaults.** Summary fields (total ascent, max elevation, average grade) are *the* answer for elevation; the per-sample array is an opt-in for clients building dedicated elevation charts.
**`compact: true` is sugar for setting all three false.** Token-conscious LLM agents that don't render maps should pass `compact: true` once on every call.
**There is no `include_geometry` flag.** All geometry in MCP responses lives in the `render` envelope as GeoJSON. There is no separate raw-polyline form. (The REST API still has its own `format: footstep | geojson` switch — that's an independent contract.)
## Examples
### Rich response (default)
```json theme={null}
{
"tool": "get_directions",
"arguments": {
"locations": [{ "lat": 51.5, "lon": -0.1 }, { "lat": 55.95, "lon": -3.19 }]
}
}
```
Returns summary fields plus a `render` envelope with a GeoJSON `linestring` layer ready to drop into a map.
### Compact response
```json theme={null}
{
"tool": "get_directions",
"arguments": {
"locations": [{ "lat": 51.5, "lon": -0.1 }, { "lat": 55.95, "lon": -3.19 }],
"compact": true
}
}
```
Returns summary fields only — distance, duration, narrative, terrain summary, turn-by-turn steps. No render envelope. Smallest possible payload.
### Elevation-chart client
```json theme={null}
{
"tool": "get_directions",
"arguments": {
"locations": [...],
"include_elevation_samples": true
}
}
```
Adds the per-sample elevation profile to the structured response.
## Per-tool flag availability
| Flag | Routing tools | Geocoding tools | `get_prediction` | `get_isochrone` |
| --------------------------- | ------------- | --------------- | ---------------- | --------------- |
| `include_render` | ✓ | ✓ | ✓ | ✓ |
| `include_hexes` | — | — | ✓ | — |
| `include_elevation_samples` | ✓ | — | — | — |
| `compact` | ✓ | ✓ | ✓ | ✓ |
Tools without any geometry component (`get_matrix`, `parse_address`, etc.) have no flags — their response is summary-only by definition.
# MCP Quickstart
Source: https://docs.footstep.ai/mcp/getting-started
Use Footstep with your AI assistant
If you use an AI assistant like Claude, ChatGPT, Cursor, or Windsurf, you can connect it to Footstep to get directions, find places, compare routes, and more - all by asking in plain English.
## What you can do
### Plan a journey
* "How do I walk from Kings Cross to Tower Bridge?"
* "Directions to Buckingham Palace from my hotel"
* "What's the fastest way to drive from Heathrow to Cambridge?"
### Compare travel options
* "Should I walk or cycle from the office to the station?"
* "Compare driving vs cycling - which is hillier?"
* "What's the flattest route between these two places?"
### Find places
* "Find coffee shops near Kings Cross"
* "Are there any supermarkets within walking distance?"
* "What restaurants are near 51.53, -0.12?"
### Find stops on the way
* "Are there any petrol stations on my route to Cambridge?"
* "Find a coffee shop on the way that won't add more than 5 minutes"
### Check reachability
* "How far can I cycle in 20 minutes from Liverpool Street?"
* "Show me everywhere I can walk to in 15 minutes from here"
### Work with addresses
* "Where is 10 Downing Street?"
* "What address is at 51.5034, -0.1276?"
* "Geocode these 5 addresses and tell me which ones are in London"
### Analyse terrain and elevation
* "What's the elevation profile between these two coordinates?"
* "How much climbing is there on this walking route?"
* "Is this route flat or hilly?"
### Analyse a recorded activity
* "Clean up this GPS trace from my bike ride"
* "What roads did I travel on during this run?"
* "Show me the terrain and surface quality of my recorded walk"
### Optimise multiple stops
* "Find the best order to visit these 8 delivery addresses"
* "I need to visit 5 clients today - what's the most efficient route?"
## How to set it up
You need two things: a Footstep API key and an AI assistant that supports MCP.
### 1. Get an API key
Sign up at [footstep.ai](https://footstep.ai) and create an API key from your dashboard. It starts with `sk_live_`.
### 2. Connect your assistant
The setup depends on which assistant you use. In most cases you paste a small config block into a settings file. Nothing to install.
**Claude Desktop** - Go to Settings > Developer > Edit Config, then paste:
```json theme={null}
{
"mcpServers": {
"footstep": {
"url": "https://mcp.footstep.ai",
"headers": {
"x-api-key": "sk_live_your_key_here"
}
}
}
}
```
**Cursor / Windsurf / VS Code** - Add a `.mcp.json` file to your project folder:
```json theme={null}
{
"mcpServers": {
"footstep": {
"url": "https://mcp.footstep.ai",
"headers": {
"x-api-key": "sk_live_your_key_here"
}
}
}
}
```
Replace `sk_live_your_key_here` with your actual API key.
For other clients (OpenAI, Gemini, Vercel AI SDK), see the [full configuration guide](/mcp/configuration).
### 3. Start asking
Once connected, just ask your assistant anything from the examples above. It will automatically use the right Footstep tool and explain the results.
## Tips
* **Be specific about how you want to travel.** "Walking directions" and "cycling directions" give different results - cycling accounts for bike lanes and road surfaces, walking accounts for footpaths and stairs.
* **Mention terrain if you care about it.** Ask "what's the flattest route?" or "how hilly is this?" and the assistant will include elevation and difficulty information.
* **Give coordinates if you have them.** You can mix place names and coordinates: "Directions from 51.53, -0.12 to Tower Bridge".
* **Ask follow-up questions.** After getting directions, you can ask "is there a flatter alternative?" or "how about by bike instead?".
## Map-rendering clients
If you're building a chat app that renders Footstep results on a map (deck.gl, MapLibre, Leaflet, Mapbox, Cesium…), the response is already shaped for you.
Every renderer-aware tool returns a `render` array of framework-agnostic GeoJSON layer descriptors — drop them straight into your map library, no decoder required:
```ts theme={null}
const result = await tools.get_directions.execute({
locations: [{ lat: 51.5, lon: -0.1 }, { lat: 55.95, lon: -3.19 }],
});
for (const layer of result.render ?? []) {
// layer.kind: "linestring" | "point" | "polygon" | "h3-cells" | …
// layer.data: GeoJSON Feature / FeatureCollection (or kind-specific shape)
// layer.bbox: [minLng, minLat, maxLng, maxLat]
myMap.addLayer(layer);
}
```
See [render envelopes](/mcp/render-envelopes) for the full kind taxonomy and per-library examples.
## Token-conscious LLM agents
Standalone chat agents that don't render maps (Claude Desktop, terminal CLIs, text-only chatbots) can pass `compact: true` on every tool call to suppress geometry, render envelopes, elevation samples, and full hex grids — leaving only summary fields:
```ts theme={null}
import { experimental_createMCPClient } from "ai";
const mcpClient = await experimental_createMCPClient({
transport: {
type: "sse",
url: "https://mcp.footstep.ai",
headers: { "x-api-key": process.env.FOOTSTEP_API_KEY! },
},
});
const rawTools = await mcpClient.tools();
// Set `compact: true` on every tool call to receive summary-only responses.
const tools = Object.fromEntries(
Object.entries(rawTools).map(([name, tool]) => [
name,
{
...tool,
execute: (args: Record, opts: unknown) =>
tool.execute({ ...args, compact: true }, opts),
},
]),
);
```
See [response defaults & controls](/mcp/defaults) for the full flag matrix.
# Introduction
Source: https://docs.footstep.ai/mcp/introduction
Connect AI agents to Footstep
The Footstep MCP server lets AI agents call routing and geocoding tools directly. It implements the [Model Context Protocol](https://modelcontextprotocol.io), the open standard for connecting LLMs to external tools.
## Connect
Point your MCP client at the hosted server. No installation required.
```
https://mcp.footstep.ai
```
Pass your API key as a header or in the URL, depending on your client. See the [configuration guide](/mcp/configuration) for setup examples.
## Supported clients
MCP is an open standard. The Footstep MCP server works with any compatible client:
| Client | Type |
| ---------------------- | ------------------------- |
| Claude Desktop / Code | AI assistant / CLI |
| Cursor | IDE |
| Windsurf | IDE |
| Cline / Continue | VS Code extensions |
| OpenAI Agents SDK | Python framework |
| Gemini (via LangChain) | Python framework |
| Vercel AI SDK | TypeScript framework |
| Any MCP client | Custom agents, frameworks |
## Next steps
Set up the MCP server with your client.
See what tools are available to your agent.
# Render envelopes
Source: https://docs.footstep.ai/mcp/render-envelopes
Drop Footstep MCP tool results straight into your map library
Every renderer-aware Footstep tool returns a `render` array on its response — a list of framework-agnostic GeoJSON layer descriptors. Drop them straight into deck.gl, MapLibre, Leaflet, Mapbox-GL-JS, or Cesium.
```ts theme={null}
const result = await tools.get_directions.execute({
locations: [{ lat: 51.5, lon: -0.1 }, { lat: 55.95, lon: -3.19 }],
});
for (const layer of result.render ?? []) {
// layer.kind: "linestring" | "point" | "polygon" | "h3-cells" | …
// layer.data: GeoJSON Feature / FeatureCollection (or kind-specific shape)
// layer.bbox: [minLng, minLat, maxLng, maxLat]
myMap.addLayer(layer);
}
```
`render` is included by default. Pass `compact: true` to suppress it on calls from text-only clients — see [response defaults & controls](/mcp/defaults).
## Layer descriptor shape
Every entry in `render` is a discriminated union on `kind`. Common fields:
| Field | Type | Notes |
| ------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `kind` | `"linestring"` \| `"point"` \| `"polygon"` \| `"h3-cells"` \| `"trips"` \| `"arcs"` \| `"heatmap"` | Discriminator |
| `label` | `string` | Human-readable, suitable for legend entries |
| `data` | varies by `kind` | GeoJSON for the geometry-typed kinds; semantic shapes for the rest |
| `bbox` | `[minLng, minLat, maxLng, maxLat]` | RFC 7946 array — drop straight into `fitBounds` / `flyTo` |
| `style_hints` | varies by `kind` | Optional; carries kind-specific styling guidance (e.g. `value_range` for hex colour scales) |
Layers do **not** carry an `id` or `opacity` — those belong to the renderer. Order in the array is z-precedence: earlier layers render under later ones.
## Layer kinds
### `linestring` — routes, traces, snapped paths
```json theme={null}
{
"kind": "linestring",
"label": "London → Edinburgh",
"data": {
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [[-0.124, 51.532], [-3.187, 55.953]]
},
"properties": {}
},
"bbox": [-3.187, 51.532, -0.124, 55.953],
"style_hints": { "recommended_color": "#1f77b4", "mode": "auto" }
}
```
Emitted by `get_directions`, `find_and_route`, `optimize_stops`, `compare_routes`, `search_along_route`, `snap_trace`. `style_hints.mode` carries the travel mode (only on `compare_routes`); `recommended_color` is provided when one mode-styled layer needs to visually distinguish itself from another.
### `point` — geocode results, destinations, ordered stops
```json theme={null}
{
"kind": "point",
"label": "Matched destinations",
"data": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [-3.187, 55.953] },
"properties": { "name": "Edinburgh" }
}
]
},
"bbox": [-3.187, 55.953, -3.187, 55.953]
}
```
Emitted by `geocode`, `reverse_geocode`, `search_places`, `batch_geocode`, plus the destination/stop layers attached to `find_and_route`, `optimize_stops`, `search_along_route`. Per-feature `properties` carries the row's full record (label, confidence, place\_type, etc.) so you can drive popups directly from the GeoJSON.
### `polygon` — isochrone contours, areas
```json theme={null}
{
"kind": "polygon",
"label": "15-minute walk",
"data": {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[[-0.13, 51.5], [...], [-0.13, 51.5]]]
},
"properties": {}
},
"bbox": [-0.13, 51.49, -0.10, 51.52],
"style_hints": { "contour_value": 15, "contour_label": "15 minutes" }
}
```
Emitted by `get_isochrone` (one layer per contour). `style_hints.contour_value` is the underlying numeric (minutes / kilometres) so renderers can colour by gradient.
### `h3-cells` — predicted probability surfaces
```json theme={null}
{
"kind": "h3-cells",
"label": "Predicted area (top 50)",
"data": [
{ "hex": "8a2a1072b59ffff", "value": 0.87 },
{ "hex": "8a2a1072b58ffff", "value": 0.42 }
],
"bbox": [-0.13, 51.50, -0.10, 51.52],
"style_hints": { "value_range": [0.42, 0.87] }
}
```
Emitted by `get_prediction`. `style_hints.value_range` is required — clients use it to pick a colour scale without a second pass over the data. deck.gl's [`H3HexagonLayer`](https://deck.gl/docs/api-reference/geo-layers/h3-hexagon-layer) consumes `data` directly via `getHexagon: d => d.hex`.
### `trips`, `arcs`, `heatmap`
Reserved for future spatial tools (animated trips for trajectory replay, arcs for matrix flows, heatmaps for density). Their schemas mirror the deck.gl layer of the same name; see [`@footstep-internal/render-envelope`](https://github.com/footstepai/platform/tree/main/packages/render-envelope) for the type definitions.
## Framework integration
### deck.gl
The `kind` taxonomy maps directly to deck.gl primitives:
| `kind` | deck.gl layer |
| ------------ | ----------------------------------------------------------------------------------------------------- |
| `linestring` | [`PathLayer`](https://deck.gl/docs/api-reference/layers/path-layer) (or `GeoJsonLayer`) |
| `point` | [`ScatterplotLayer`](https://deck.gl/docs/api-reference/layers/scatterplot-layer) (or `GeoJsonLayer`) |
| `polygon` | [`GeoJsonLayer`](https://deck.gl/docs/api-reference/layers/geo-json-layer) |
| `h3-cells` | [`H3HexagonLayer`](https://deck.gl/docs/api-reference/geo-layers/h3-hexagon-layer) |
| `trips` | [`TripsLayer`](https://deck.gl/docs/api-reference/geo-layers/trips-layer) |
| `arcs` | [`ArcLayer`](https://deck.gl/docs/api-reference/layers/arc-layer) |
| `heatmap` | [`HeatmapLayer`](https://deck.gl/docs/api-reference/aggregation-layers/heatmap-layer) |
Translator example:
```ts theme={null}
import { GeoJsonLayer, H3HexagonLayer } from "@deck.gl/layers";
function toDeckLayer(layer: RenderLayer) {
switch (layer.kind) {
case "linestring":
case "polygon":
case "point":
return new GeoJsonLayer({ id: layer.label, data: layer.data });
case "h3-cells":
return new H3HexagonLayer({
id: layer.label,
data: layer.data,
getHexagon: (d) => d.hex,
getFillColor: (d) => colorScale(d.value, layer.style_hints.value_range),
});
// ...
}
}
```
### MapLibre / Mapbox-GL-JS
GeoJSON-typed kinds (`linestring`, `point`, `polygon`) drop straight in as sources:
```ts theme={null}
map.addSource("route", { type: "geojson", data: layer.data });
map.addLayer({
id: "route",
type: "line",
source: "route",
paint: { "line-color": layer.style_hints?.recommended_color ?? "#1f77b4" },
});
map.fitBounds(layer.bbox, { padding: 40 });
```
For `h3-cells`, use [`h3-js`](https://github.com/uber/h3-js) to convert each hex to its boundary and emit a polygon FeatureCollection.
### Leaflet
```ts theme={null}
import L from "leaflet";
L.geoJSON(layer.data).addTo(map);
map.fitBounds([
[layer.bbox[1], layer.bbox[0]],
[layer.bbox[3], layer.bbox[2]],
]);
```
Leaflet's `fitBounds` takes `[[lat, lng], [lat, lng]]` — flip from the RFC 7946 array.
### Cesium
Use `Cesium.GeoJsonDataSource.load(layer.data)` for the GeoJSON-typed kinds. For `h3-cells`, convert via `h3-js` to polygons and add as a CZML / GeoJSON data source.
## When the response has multiple layers
Several tools emit two or more layers in `render`:
* `find_and_route` → `[linestring(route), point(destination)]`
* `optimize_stops` → `[linestring(route), point(ordered stops)]`
* `compare_routes` → one `linestring` per travel mode
* `get_isochrone` → one `polygon` per contour
* `search_along_route` → `[linestring(route), point(matched places)]`
Iterate the array and add each layer. To fit the camera to the whole result, merge bounding boxes:
```ts theme={null}
const combined = result.render.reduce(
(acc, layer) => [
Math.min(acc[0], layer.bbox[0]),
Math.min(acc[1], layer.bbox[1]),
Math.max(acc[2], layer.bbox[2]),
Math.max(acc[3], layer.bbox[3]),
],
result.render[0].bbox,
);
map.fitBounds(combined);
```
## Suppressing the envelope
Text-only clients (Claude Desktop, terminal CLIs, summary bots) pass `compact: true` on every call to skip the envelope and only receive narrative-friendly summary fields. See [response defaults & controls](/mcp/defaults).
# Response shape
Source: https://docs.footstep.ai/mcp/response-shape
How MCP tool results are structured, including errors
Every Footstep MCP tool returns a result in the same envelope. This page describes the wire shape so your client can read responses without per-tool conditionals.
## Result envelope
Tool results are delivered via the [MCP `structuredContent` field](https://modelcontextprotocol.io/specification/draft/server/tools#structured-content). The value is a parsed JSON object — your client reads it directly, no `JSON.parse` step required.
```json theme={null}
{
"structuredContent": {
"destination": { "name": "London Bridge", "coordinates": { "lat": 51.508, "lng": -0.087 } },
"route": { "distance_meters": 4312, "duration_seconds": 723, "narrative": "..." },
"render": [
{ "kind": "linestring", "label": "Route", "data": { ... }, "bbox": [...] }
]
}
}
```
Use any MCP client that supports `structuredContent` (e.g. `@modelcontextprotocol/sdk` ≥ 1.0).
## Errors
Hard failures (the tool ran but couldn't compute a result) are returned with MCP's `isError: true` flag and a structured error object in `structuredContent`:
```json theme={null}
{
"isError": true,
"structuredContent": {
"error": {
"code": "no_route_found",
"message": "No route found between the supplied points.",
"details": { "origin": [-0.124, 51.532], "destination": [-3.187, 55.953] }
}
}
}
```
Soft cases (the tool ran and produced a valid empty answer — for example, `geocode` with a query that matches no places) are **not** errors. They return a normal success response with empty arrays:
```json theme={null}
{
"structuredContent": {
"results": []
}
}
```
This separation lets clients pattern-match on `error.code` for branching UX — "ask the user to clarify" vs "retry with backoff" vs "suggest an alternative travel mode" — without parsing free-text messages.
## Error codes
| Code | Meaning | Recommended client action |
| ------------------------ | ----------------------------------------------------- | --------------------------------------------------------- |
| `invalid_input` | Schema validation failed | Fix the request, retry |
| `out_of_bounds` | Coordinate outside service area | Surface region limit to user |
| `unroutable_point` | Origin or destination not on routable network | Suggest nearest road or alternative point |
| `no_route_found` | Endpoints valid but no path computable | Suggest alternative travel mode or different endpoints |
| `geocode_ambiguous` | Multiple high-confidence matches | Ask user to clarify; `details.candidates` carries options |
| `prediction_no_signal` | `get_prediction` ran but produced a degenerate result | Surface "insufficient data" to user |
| `prediction_unsupported` | `get_prediction` lacks required inputs | Fix request, retry |
| `upstream_timeout` | Underlying service didn't respond in time | Retry with backoff (idempotent calls only) |
| `upstream_error` | Generic upstream failure | Retry with backoff |
| `rate_limited` | Quota exceeded | Back off; `details.retry_after_seconds` indicates wait |
The `error.details` field is optional and carries code-specific structured information (candidate matches for `geocode_ambiguous`, retry timing for `rate_limited`, the offending field for `invalid_input`, etc.).
## What's in `structuredContent`
The keys you'll see depend on the tool. Most renderer-aware tools share three groups:
* **Summary fields** — `distance_meters`, `duration_seconds`, `narrative`, `terrain`, `bounds`-equivalent inside `render[].bbox`, etc. Always present unless the response is an error.
* **Raw geometry** — `legs[].shape` (polylines), `contours[].geometry` (polygons), `top_results` (hex rows), etc. Controlled by [response defaults](/mcp/defaults).
* **`render` envelope** — framework-agnostic layer descriptors ready to drop into a map library. Controlled by `include_render` (default `true`). Detailed in the [render envelopes](/mcp/render-envelopes) reference.
See per-tool reference pages for the exact keys each tool returns.
# Tools
Source: https://docs.footstep.ai/mcp/tools
Routing, geocoding, natural-language, and prediction tools available to your agent
The MCP server exposes 15 tools. Click any tool for details.
### Routing
| Tool | What it does |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| [`get_directions`](/mcp/tools/get-directions) | Get driving, walking, or cycling directions between locations. Returns distance, duration, turn-by-turn steps, and terrain analytics. |
| [`optimize_stops`](/mcp/tools/optimize-stops) | Find the fastest order to visit multiple stops. Returns optimised route with distance/time savings. |
| [`compare_routes`](/mcp/tools/compare-routes) | Compare walk vs bike vs drive between the same locations. Side-by-side distance, duration, and terrain difficulty. |
| [`find_and_route`](/mcp/tools/find-and-route) | Find a place by name and get directions to it in one step. Combines geocoding and routing. |
| [`get_isochrone`](/mcp/tools/get-isochrone) | Find everywhere reachable within a time or distance limit from a starting point. Returns a polygon boundary. |
| [`get_matrix`](/mcp/tools/get-matrix) | Calculate travel times and distances between every combination of origins and destinations. |
| [`get_elevation`](/mcp/tools/get-elevation) | Get elevation data for a list of coordinates. Returns heights and summary statistics. |
| [`snap_trace`](/mcp/tools/snap-trace) | Clean up a GPS trace and get road surface, class, speed, and terrain details. |
| [`search_along_route`](/mcp/tools/search-along-route) | Find places along a route ranked by how little detour they add. |
### Geocoding
| Tool | What it does |
| ----------------------------------------------- | --------------------------------------------------------------------------------------- |
| [`geocode`](/mcp/tools/geocode) | Convert an address or place name to coordinates. Returns lat/lng with confidence score. |
| [`reverse_geocode`](/mcp/tools/reverse-geocode) | Convert coordinates to an address. Find what's at a given lat/lng. |
| [`batch_geocode`](/mcp/tools/batch-geocode) | Geocode up to 1,000 addresses in one call. |
| [`search_places`](/mcp/tools/search-places) | Find places and points of interest near a location. |
### Natural Language
| Tool | What it does |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [`parse_address`](/mcp/tools/parse-address) | Clean up messy free-text addresses. Fixes typos, expands abbreviations, and infers missing fields. Useful as a pre-step before geocoding. |
### Predict
| Tool | What it does |
| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| [`get_prediction`](/mcp/tools/get-prediction) | Generate spatial probability predictions for missing person scenarios. Returns per-hex scores across an H3 grid. |
## Example prompts
Once connected, you can ask your AI agent things like:
* "Get me walking directions from Kings Cross to Tower Bridge"
* "Should I walk or cycle? Compare both options"
* "Directions to the nearest train station from here"
* "Find coffee shops near my hotel"
* "Are there any petrol stations on my way to Cambridge?"
* "What's the elevation profile between these two coordinates?"
* "How far can I cycle in 15 minutes from Liverpool Street station?"
* "Find the best order to visit these 8 delivery stops"
* "Clean up this GPS trace from my bike ride and show me the terrain"
* "Geocode these 5 addresses and tell me which ones are in London"
* "Clean up this messy CSV of customer addresses before geocoding them"
The agent will call the appropriate Footstep tool and interpret the results for you.
## Rate limits
MCP tool calls use your API key and count against the same rate limits as direct API calls. See the [authentication guide](/authentication) for rate limit details.
# batch_geocode
Source: https://docs.footstep.ai/mcp/tools/batch-geocode
Geocode up to 1,000 addresses in one call
Geocode a list of addresses in a single request. Each address can be free text or structured components (street, city, country). Results are returned in the same order as the input — `results[i]` corresponds to `addresses[i]` — and failed items don't break the batch.
## Example prompts
* "Geocode these 5 addresses and tell me which ones are in London"
* "Find coordinates for all the addresses in this list"
* "Batch geocode these office locations and tell me which country each is in"
* "Process these 50 delivery addresses and flag any that couldn't be found"
## What you get back
An array of results aligned with the input addresses. Each entry is one of:
* **Successful match** — the geocoded result fields directly: `coordinates`, `label`, `name`, `district`, `locality`, etc. Same shape as `geocode` returns. Confidence is omitted when 1.0.
* **Failed row** — `{ error }` only, no coordinates. The error is one of `timeout`, `upstream_unavailable`, `rate_limited`, `invalid_input`, or `unknown` — branch on this rather than parsing free text.
* **No match, no error** — `{}` (empty object) preserves array alignment with the input.
The presence of `coordinates` discriminates a successful row from a failure — there's no separate wrapper.
When all matches share the same country / region (e.g. a batch of UK-only addresses), those fields are hoisted to a top-level `context` object instead of being repeated on every row. Mixed-country batches keep the per-row admin fields.
A `summary` object also reports `total`, `matched`, and `failed` counts.
## Tips for landmark queries
Free-text rows benefit from the same query hygiene as `geocode`:
* **Qualify with city context** — `"Big Ben, London"` resolves much more reliably than `"Big Ben"`.
* **Plain street addresses don't need extra context.**
For batch jobs that mix addresses and landmarks, the structured fields (`address`, `locality`, `region`, `country`, etc.) give the most precise control for the address rows.
## Map rendering
Responses include a `render` envelope with a `point` layer for the **successfully** matched rows — failed rows are skipped in the layer (their structured-response row carries an `error` field instead). Pass `compact: true` for summary-only responses. See [response defaults & controls](/mcp/defaults) and [render envelopes](/mcp/render-envelopes).
## Example response
```json theme={null}
{
"structuredContent": {
"results": [
{ "name": "London", "coordinates": { "lat": 51.5, "lng": -0.1 } },
{ "error": "no match" },
{ "name": "Paris", "coordinates": { "lat": 48.85, "lng": 2.35 } }
],
"summary": { "total": 3, "matched": 2, "failed": 1 },
"render": [
{ "kind": "point", "label": "Geocoded addresses", "data": {/* FeatureCollection: only matched rows */}, "bbox": [/* … */] }
]
}
}
```
# compare_routes
Source: https://docs.footstep.ai/mcp/tools/compare-routes
Compare travel modes between the same origin and destination
Run the same route with different travel modes and get a side-by-side comparison of distance, duration, and terrain difficulty. Useful for deciding how to travel.
Supports comparing 2-4 modes in one call: walking, cycling, driving, bus, and truck.
## Example prompts
* "Should I walk or cycle from Kings Cross to Tower Bridge?"
* "Compare driving vs cycling from my hotel to the conference centre"
* "What's the easiest way to get from A to B - walking, cycling, or driving?"
* "How much hillier is cycling vs walking between these two points?"
## What you get back
A summary per travel mode (distance, duration, terrain analytics) plus a comparison block showing which mode is fastest, shortest, and easiest by terrain. Includes a natural language summary like "Cycling is 3 min faster than walking but has 40m more climbing."
For step-by-step directions on a chosen mode, call `get_directions` after comparing.
## Map rendering
Responses include a `render` envelope with one `linestring` layer per mode (style hints carry the mode name and a recommended colour for distinct styling). Pass `compact: true` for summary-only responses (the comparison block + per-mode totals only). See [response defaults & controls](/mcp/defaults) and [render envelopes](/mcp/render-envelopes).
## Example response
```json theme={null}
{
"structuredContent": {
"routes": {
"auto": { "distance_meters": 6000, "duration_seconds": 600 },
"bicycle": { "distance_meters": 5800, "duration_seconds": 1300 }
},
"comparison": { "fastest": "auto", "shortest": "bicycle", "easiest": "auto", "summary": "…" },
"render": [
{
"kind": "linestring",
"label": "auto route",
"data": {/* GeoJSON LineString */},
"bbox": [/* … */],
"style_hints": { "mode": "auto", "recommended_color": "#1f77b4" }
},
{
"kind": "linestring",
"label": "bicycle route",
"data": {/* GeoJSON LineString */},
"bbox": [/* … */],
"style_hints": { "mode": "bicycle", "recommended_color": "#ff7f0e" }
}
]
}
}
```
# find_and_route
Source: https://docs.footstep.ai/mcp/tools/find-and-route
Find a place and get directions to it in one step
Geocode an origin and a destination (address, place name, postcode, or landmark) and route between them. Combines geocoding and routing in a single call so the agent doesn't need to chain two separate tools.
Both `origin` and `destination` accept either lat/lon coordinates or a place name / postcode / address string — the string form is geocoded for you.
## Example prompts
* "How do I get from SW1A 1AA to Buckingham Palace?"
* "Directions from Kings Cross to the British Museum"
* "Walking route from my hotel at 51.52, -0.13 to the nearest train station"
* "Find 10 Downing Street and show me how to cycle there from Westminster"
## What you get back
The geocoded destination (label, coordinates, country code, place type, confidence), the route (distance, duration, terrain, turn-by-turn steps), and up to three alternative destination matches when the top result wasn't unambiguous.
Alternatives are filtered for usefulness: same country as the primary, above a minimum confidence threshold, and not broader admin areas that already contain the primary (e.g. "London" isn't returned as an alternative to "Tower Bridge"). Surviving alternatives are sorted by distance from the primary so the most spatially plausible candidates surface first. The geocoder is also biased toward the caller's `origin`, so a "Tower Bridge" search from London prefers the actual bridge over namesakes elsewhere.
Pass `narrative: true` for an AI-generated 1-3 sentence summary of the route alongside the structured data. When narrative is included, the response also carries `narrative_units` (`kilometers` or `miles`) telling you which units the summary used. All numeric route fields are always in meters / seconds regardless.
## Tips for landmark origins and destinations
* **Qualify with city context** — `"Big Ben, London"` resolves more reliably than `"Big Ben"`.
* **Plain street addresses and postcodes don't need extra context.**
* **Coords win when you have them** — pass `{ "lat": ..., "lon": ... }` whenever the caller already has a precise location (e.g. a GPS fix or a click on the map).
## Map rendering
Responses include a `render` envelope with a `linestring` layer for the route plus `point` layers for the origin (labelled with the geocoded name, or "Start" for coord-only origins) and the matched destination. Pass `compact: true` for summary-only responses. See [response defaults & controls](/mcp/defaults) and [render envelopes](/mcp/render-envelopes).
## Example response
```json theme={null}
{
"structuredContent": {
"destination": {
"name": "London Bridge",
"label": "London Bridge, London, England, United Kingdom",
"coordinates": { "lat": 51.508, "lng": -0.087 },
"place_type": "venue"
},
"route": { "distance_meters": 4312, "duration_seconds": 723 },
"render": [
{ "kind": "linestring", "label": "Route", "data": {/* GeoJSON */}, "bbox": [/* … */] },
{ "kind": "point", "label": "Start: SW1A 1AA", "data": {/* FeatureCollection */}, "bbox": [/* … */] },
{ "kind": "point", "label": "Destination: London Bridge", "data": {/* FeatureCollection */}, "bbox": [/* … */] }
]
}
}
```
# geocode
Source: https://docs.footstep.ai/mcp/tools/geocode
Convert an address or place name to coordinates
Forward geocode: turn a text query (address, place name, or landmark) into geographic coordinates. Results are ranked by relevance and include a confidence score.
You can bias results towards a location with `focus_lat`+`focus_lon`, or restrict to specific countries with `country` (comma-separated ISO 3166-1 alpha-3 codes). Supply `focus_lat`+`focus_lon` whenever you have any spatial context — a visible viewport, a previous result, a known anchor. Common place names like "Cambridge", "Bath", or "Lebanon" exist in several countries; a focus point picks the one the user means.
## Example prompts
* "Where is Buckingham Palace?"
* "Find the coordinates for 10 Downing Street, London"
* "Geocode 'Empire State Building' and tell me the lat/lng"
* "What are the coordinates for Springfield? I mean the one in Illinois."
## What you get back
A list of matching locations, each with coordinates (lat/lng), a full label, country, region, district (borough or municipality, e.g. "City of Westminster"), locality, optional confidence score (omitted when 1.0; present when below), and the result type (venue, address, street, locality, etc.).
When all results share the same country / country\_code / region, those fields are hoisted to a top-level `context` object so they aren't repeated on every result. Read shared admin from `context`, per-result variation from `results[i]`.
## Tips for landmark queries
* **Qualify with city context.** `"Big Ben, London"` resolves much more reliably than `"Big Ben"` alone — the comma form lets the parser treat the city as administrative context.
* **Plain street addresses don't need extra context** — `"10 Downing Street, London"` is enough.
If you're driving the tool from an LLM, mentioning these hints in the system prompt often improves results without any code changes.
## Map rendering
Responses include a `render` envelope with a `point` layer for the matched candidates (per-feature `properties` carries name, label, place\_type, confidence). Pass `compact: true` for summary-only responses. See [response defaults & controls](/mcp/defaults) and [render envelopes](/mcp/render-envelopes).
## Example response
```json theme={null}
{
"structuredContent": {
"results": [
{
"name": "Buckingham Palace",
"label": "Buckingham Palace, London, England, United Kingdom",
"coordinates": { "lat": 51.501, "lng": -0.142 },
"place_type": "venue"
}
],
"context": { "country": "United Kingdom", "country_code": "GBR" },
"render": [
{ "kind": "point", "label": "Geocoded matches", "data": {/* FeatureCollection */}, "bbox": [/* … */] }
]
}
}
```
# get_directions
Source: https://docs.footstep.ai/mcp/tools/get-directions
Get driving, walking, or cycling directions between locations
Get turn-by-turn directions between two or more locations. Supports car, pedestrian, bicycle, bus, and truck routing. Every response includes terrain analytics (elevation gain, difficulty, grade profiles) by default.
Your agent can also fine-tune the route: avoid hills, prefer lit streets, set vehicle dimensions for truck routing, or request alternate routes.
## Example prompts
* "Get me walking directions from Kings Cross to Tower Bridge"
* "How do I drive from Heathrow to Cambridge avoiding tolls?"
* "Plan a cycling route from Greenwich to Richmond Park that avoids hills"
* "What's the flattest walking route between these two coordinates?"
## What you get back
A full route with distance, duration, and turn-by-turn steps. Terrain analytics include total ascent/descent, elevation profile, grade percentages, and a difficulty classification (flat, rolling, hilly, or mountainous). Route flags (`has_toll`, `has_highway`, `has_ferry`) tell you if the route uses any of those — and are omitted entirely when none apply (the common case in urban routing). Only the truthy entries are emitted, so absence of a flag means it doesn't apply.
Each step carries `instruction`, `distance_meters`, `duration_seconds`, `travel_mode`, `type`, and `streets`. The `streets` array lists the named roads the step traverses; it's omitted on unnamed manoeuvres (forks, "destination on the left", some roundabout exits) so absence means "no street name to attach", not an empty list. Step-level `ferry`/`toll`/`highway` flags are emitted only when true.
### Step type values
`type` is one of a fixed set of manoeuvre kinds. Grouped by category:
| Category | Values |
| ---------------- | ----------------------------------------------------------------------------------------------------------- |
| **Start / end** | `start`, `start_left`, `start_right`, `destination`, `destination_left`, `destination_right` |
| **Direction** | `left`, `right`, `slight_left`, `slight_right`, `sharp_left`, `sharp_right`, `u_turn_left`, `u_turn_right` |
| **Continuation** | `continue`, `becomes`, `stay_straight`, `stay_left`, `stay_right` |
| **Highway** | `merge`, `merge_left`, `merge_right`, `ramp_straight`, `ramp_left`, `ramp_right`, `exit_left`, `exit_right` |
| **Roundabout** | `roundabout_enter`, `roundabout_exit` |
| **Ferry** | `ferry_enter`, `ferry_exit` |
| **Fallback** | `none`, `unknown` |
Treat the enum as a closed set — these are the only values an `auto`, `pedestrian`, `bicycle`, `bus`, or `truck` route will produce. The `none` and `unknown` values are present for completeness and shouldn't appear in normal output.
All numeric distance / duration fields are always in meters / seconds regardless of the request `units` (which only affects the natural-language `narrative` summary). Pass `narrative: true` for an AI-generated plain-English summary of the route — the response then also includes a `narrative_units` field telling you which units the summary was rendered in (`kilometers` or `miles`).
For 2-waypoint routes, the route's totals/terrain/flags are reported once at the top level — the single leg only carries `steps`. Multi-waypoint routes (3+ waypoints) keep the per-leg breakdown so you can see distance/terrain per segment. Geometry for the route lives in the `render` envelope as a GeoJSON `linestring` layer.
## Alternate routes: `alternates`
Set `alternates: 1-3` to request alternative routings. When found, the response carries an `alternates` array of full route objects (same shape as `route`), each with their own distance, duration, terrain analytics, and turn-by-turn steps. The LLM can reason about "which is flatter?" or "which avoids the highway?" by comparing them.
Alternates aren't always available — for short urban routes there often isn't a meaningfully different option. The `alternates` field is omitted when none are available.
## Map rendering
Responses include a `render` envelope with a `linestring` layer for the route. Pass `compact: true` for summary-only responses. See [response defaults & controls](/mcp/defaults) and [render envelopes](/mcp/render-envelopes).
## Example response
```json theme={null}
{
"structuredContent": {
"route": {
"distance_meters": 5765,
"duration_seconds": 812,
"terrain": {
"difficulty": "flat",
"total_ascent_meters": 12.4,
"total_descent_meters": 8.1,
"max_elevation_meters": 28,
"min_elevation_meters": 5,
"avg_grade_percent": 1.2,
"max_grade_percent": 4.5
},
"legs": [{ "steps": [/* turn-by-turn directions */] }]
},
"render": [
{
"kind": "linestring",
"label": "Route",
"data": {
"type": "Feature",
"geometry": { "type": "LineString", "coordinates": [/* [lng, lat] pairs */] },
"properties": {}
},
"bbox": [-0.13, 51.49, -0.06, 51.54]
}
]
}
}
```
# get_elevation
Source: https://docs.footstep.ai/mcp/tools/get-elevation
Get elevation data for a list of coordinates
Query elevation values for a set of coordinates or along a path. Returns heights in meters with a computed summary.
Optionally resample the input at a fixed interval for smoother elevation profiles.
## Example prompts
* "What's the elevation at the top of Primrose Hill?"
* "Show me the elevation profile between these two coordinates"
* "How much climbing is there on this path?"
* "Get elevation data for these 10 GPS points"
## What you get back
Elevation values for each input point, plus a summary with `max_elevation_meters`, `min_elevation_meters`, and `avg_elevation_meters`.
### `range: true` for paths
Pass `range: true` when your input is an ordered path (a route, a hike, a GPS trace). The response then carries:
* `range_height` — `[distance_meters, elevation_meters]` tuples for charting an elevation profile.
* `total_ascent_meters` and `total_descent_meters` — cumulative climb and drop along the path. Included only in `range` mode.
# get_isochrone
Source: https://docs.footstep.ai/mcp/tools/get-isochrone
Find everywhere reachable within a time or distance limit
Generate reachability contours from a starting point. Shows how far you can travel within a given time limit (in minutes) or distance limit (in kilometres). Returns polygon boundaries you can display on a map.
Supports multiple contours in one request, so you can show 5, 10, and 15-minute ranges together.
For "what's reachable from X" queries, pass `from` as a place name and the origin is geocoded for you — there is no need to call `geocode` first. If you already have coordinates, pass `location` instead.
## Example prompts
* "How far can I walk in 15 minutes from Liverpool Street station?" → `get_isochrone(from="Liverpool Street station, London", contours=[{time: 15}], travel="pedestrian")`
* "Show me the area I can cycle to in 20 minutes from my office" → `get_isochrone(location={lat: ..., lon: ...}, contours=[{time: 20}], travel="bicycle")`
* "What's within a 5km drive of this warehouse?" → `get_isochrone(location={lat: ..., lon: ...}, contours=[{distance: 5}], travel="auto")`
* "Compare 10-minute and 30-minute walking ranges from Kings Cross" → `get_isochrone(from="Kings Cross, London", contours=[{time: 10}, {time: 30}], travel="pedestrian")`
## What you get back
Each contour is returned with full polygon coordinates, a vertex-count + bbox summary, and a list of named anchors inside the polygon (see below). The response also includes the origin point and travel type used. Pass `compact: true` to suppress the polygon coordinates and the `render` envelope when the caller only needs summary fields.
## `reachable_places` — named anchors inside the polygon
For each contour, the response includes a `reachable_places` array: named venues, neighbourhoods, parks, stations, and landmarks that fall inside the polygon, ordered by relevance. This turns a polygon (which an LLM can't render) into something an LLM can actually speak:
> "In 15 minutes on foot from Kings Cross you can reach Russell Square, Holborn, Camden Town and Bloomsbury."
Each place carries `name`, `label`, `place_type`, and `coordinates`. This is best-effort enrichment: if no named anchors can be resolved for a contour, `reachable_places` is omitted and the rest of the response goes through unchanged.
## Contour ordering
Contours are returned **sorted ascending by `value`** — the smallest reach first, regardless of input order. So `contours: [{time: 10}, {time: 5}]` and `contours: [{time: 5}, {time: 10}]` both produce a response with the 5-minute contour at index 0.
## Map rendering
Each contour ships with a vertex-count + bbox summary plus a `polygon` layer per contour in the `render` envelope (with `style_hints.contour_value` carrying the contour's value for gradient ordering). Drop the layers straight into your map library. Pass `compact: true` for summary-only responses. See [response defaults & controls](/mcp/defaults) and [render envelopes](/mcp/render-envelopes).
## Example response
```json theme={null}
{
"structuredContent": {
"origin": { "lat": 51.532, "lon": -0.124 },
"travel": "pedestrian",
"contours": [
{
"metric": "time",
"value": 15,
"geometry_summary": { "type": "Polygon", "vertex_count": 137, "bbox": {/* … */} },
"reachable_places": [/* named anchors inside the polygon */]
}
],
"render": [
{
"kind": "polygon",
"label": "15-minute reach",
"data": {/* GeoJSON Feature with full Polygon geometry */},
"bbox": [/* … */],
"style_hints": { "contour_value": 15, "contour_label": "15-minute reach" }
}
]
}
}
```
# get_matrix
Source: https://docs.footstep.ai/mcp/tools/get-matrix
Calculate travel times and distances between every combination of origins and destinations
Compute a time and distance matrix between a set of origins and destinations. Returns every source-to-target pair with distance in meters and duration in seconds. Unreachable pairs come back as `null`.
Useful for logistics, dispatching, and finding the closest location from a set of options.
## Example prompts
* "How long does it take to drive between each of these 4 warehouses?"
* "Calculate travel times from our office to all 10 client locations"
* "Which of these 3 restaurants is closest to my hotel by walking?"
* "Build a distance matrix for these delivery origins and destinations"
## What you get back
A 2D matrix indexed by source and target, where each cell contains `distance_meters` and `duration_seconds`. Unreachable pairs come back as `null`. The matrix preserves the order of your input — `matrix[i][j]` is the route from `sources[i]` to `targets[j]`.
If you need to verify how a coordinate snapped to the road network, call [`/v1/routing/locate`](/api/endpoint/locate) — that's the dedicated tool for snap diagnostics.
# get_prediction
Source: https://docs.footstep.ai/mcp/tools/get-prediction
Generate spatial probability predictions for missing person scenarios
**Research Preview** — Predictions are generated from behavioural models that have not yet been fully validated against real-world outcomes. Access is granted on request — contact [support@footstep.ai](mailto:support@footstep.ai).
Pinpoint where to look first when someone goes missing. Given a last known position, a behavioural profile, and a search area, returns a confidence-ranked grid covering that area — so search teams can prioritise the highest-likelihood ground.
Supports three area types: circle (centre + radius), polygon (GeoJSON), or buffered path (LineString + buffer). Weather is fetched automatically unless overridden or disabled.
## Inputs
| Field | Required | Description |
| ------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `profile` | yes | Behavioural profile id. One of `despondent`, `dementia_alzheimers`. |
| `area_type` + area shape | yes | `circle` (with `center` + `radius_m`), `polygon` (with `polygon`), or `path` (with `path` and an optional `buffer_m` — defaults to 50 m, capped at 500 m). |
| `datetime` | yes | ISO 8601 scenario time. Drives weather lookup and time-of-day signals. |
| `age_years` | no | Subject age. Optional — omit when unknown. Supplying it sharpens the prediction. |
| `initial_bearing_deg` | no | Initial direction of travel. Focuses results to a directional cone. |
| `weather` | no | Manual override. When omitted, weather is fetched for `datetime`. |
## Example prompts
* "Predict the most likely locations for a despondent 75-year-old last seen heading south from this point"
* "Run a prediction for a dementia patient, age 80, in this 2km radius area"
* "Generate a search priority map for this polygon area, the subject was last seen at 10pm"
* "Predict with heavy rain and strong wind conditions for this search area"
## What you get back
A rich response (default) returns the following keys in `structuredContent`:
* `top_results` — the top 50 H3 hexagons ranked by score (highest first). Each row carries `hex`, `score`, and the cell centroid as `lat` / `lng` so the result can be chained directly into `search_places`, `reverse_geocode`, `get_directions`, etc. without a separate hex-to-coordinates step. `score` is an integer 0–30 — a relative confidence score across the surviving hexes in this prediction, NOT a probability or percentage.
* `cells` — every scored hex (the full grid). Each row carries `hex` and `score`. Suppress with `include_hexes: false` if you don't need the full surface in the structured response — the rendered hex layer in `render` is independent of this field.
* `summary` — `hex_count` (total hexes scored) and `processing_time_ms`.
* `coverage` — `top_n` (how many rows are in `top_results`), `total_count` (how many were scored), `coverage_percent` (score mass held by the returned rows), and `truncated` (false when every scored hex was returned). Use `coverage_percent` to gauge how concentrated the prediction is — a high value means the top hexes hold most of the likelihood; a low value means the search area is genuinely diffuse.
* `render` — a single `h3-cells` layer ready to drop into a map. `style_hints.value_range` carries `[min, max]` so the renderer can pick a colour scale. See [render envelopes](/mcp/render-envelopes).
## Response controls
| Flag | Default | Effect |
| ---------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `include_hexes` | `true` | Includes the full hex grid as `cells`. Set to `false` to keep only `top_results` in the structured response (the `render` envelope still carries the full grid). |
| `include_render` | `true` | Includes the `render` envelope. Set to `false` for text-only callers that won't render the result. |
| `compact` | `false` | When `true`, omits both the full grid (`cells`) and the `render` envelope, leaving only `top_results`, `summary`, and `coverage`. The compact response is what every existing chaining flow needs. |
LLM agents that don't render maps and only want to chain into other tools should pass `compact: true`. Renderer clients should leave the defaults.
## Example response
```json theme={null}
{
"structuredContent": {
"profile": "despondent",
"summary": { "hex_count": 8910, "processing_time_ms": 1234 },
"coverage": { "top_n": 50, "total_count": 8910, "coverage_percent": 87.4, "truncated": true },
"top_results": [
{ "hex": "8c194ad14da43ff", "score": 28, "lat": 51.502341, "lng": -0.123456 }
],
"cells": [
{ "hex": "8c194ad14da43ff", "score": 28 },
{ "hex": "8c194ad14da45ff", "score": 12 }
],
"render": [
{
"kind": "h3-cells",
"label": "Prediction",
"data": [
{ "hex": "8c194ad14da43ff", "value": 28 }
],
"bbox": [/* … */],
"style_hints": { "value_range": [0, 28] }
}
]
}
}
```
# optimize_stops
Source: https://docs.footstep.ai/mcp/tools/optimize-stops
Find the fastest order to visit multiple stops
Given a list of stops, find the most efficient order to visit them all. Solves the travelling salesman problem and returns the optimised route with full terrain analytics, plus a breakdown of how much distance and time you saved compared to the original order.
## Example prompts
* "Find the best order to visit these 8 delivery addresses"
* "I need to visit 5 clients today, what's the most efficient route?"
* "Optimise this list of warehouse stops for a bike courier"
* "Reorder these 12 locations to minimise driving time"
## What you get back
The reordered stop sequence (`optimized_order`), savings vs the original order, and the optimised route's totals (distance, duration, terrain).
When the input order was already optimal, `savings` is omitted and `already_optimal: true` is returned instead — a single boolean rather than a row of zeros.
For step-by-step directions through the optimised order, call `get_directions` with the reordered waypoints.
## Map rendering
Responses include a `render` envelope with a `linestring` layer for the optimised route plus a `point` layer for the ordered stops. Pass `compact: true` for summary-only responses. See [response defaults & controls](/mcp/defaults) for the full flag matrix and [render envelopes](/mcp/render-envelopes) for the layer schema.
## Example response
```json theme={null}
{
"structuredContent": {
"optimized_order": [0, 2, 1, 3],
"savings": { "distance_saved_meters": 500, "time_saved_seconds": 120 },
"route": { "distance_meters": 12340, "duration_seconds": 2200 },
"render": [
{ "kind": "linestring", "label": "Optimised route", "data": {/* … */}, "bbox": [/* … */] },
{
"kind": "point",
"label": "Stops in visit order",
"data": {
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "geometry": {/* … */}, "properties": { "order_index": 0, "original_index": 0 } }
]
},
"bbox": [/* … */]
}
]
}
}
```
# parse_address
Source: https://docs.footstep.ai/mcp/tools/parse-address
Clean and structure messy free-text addresses
Correct and structure messy address strings. Fixes typos, expands abbreviations (`st` → `Street`, `ave` → `Avenue`), and infers missing fields like postcode, region, or country. Use this as a pre-step before geocoding when your input data is dirty; pass clean addresses straight to `geocode` or `batch_geocode`.
## Example prompts
* "Clean up these 30 customer addresses before I geocode them"
* "What's the proper formatted version of '10 downing st london uk'?"
* "Parse and standardise this list of addresses, then tell me which ones are in the UK"
* "Fix the typos in these addresses and break them into structured fields"
## What you get back
An array of results aligned with the input addresses. Each entry contains:
* `corrected` — the standardised, fully formatted address.
* `components` — structured fields (`house_number`, `unit`, `road`, `neighbourhood`, `locality`, `county`, `region`, `postcode`, `country`, `country_code`). Only populated fields are included.
* `corrections` — itemised list of changes made, each with `field`, `original` (or `null` if inferred), `corrected`, and `type` (one of `typo`, `abbreviation`, `inferred`, `reformatted`, `removed`). Omitted entirely when the input was already clean.
* `confidence` — score between 0 and 1. Omitted when 1.0; present when the parser was uncertain.
When every row resolves to the same country (or region), those fields are hoisted to a top-level `context` object instead of being repeated on each row. Mixed-country batches keep the per-row admin fields.
## When to use this vs `geocode`
* Your input is **clean** (real addresses, complete and well-formed) — skip `parse_address` and call `geocode` / `batch_geocode` directly.
* Your input is **messy** (typos, abbreviations, missing fields, inconsistent capitalisation) — call `parse_address` first, then geocode the `corrected` string. Cleaner input gives better geocoding hit rates and lets you flag low-confidence rows before spending geocoding budget on them.
## Limits
Up to 100 addresses per call.
# reverse_geocode
Source: https://docs.footstep.ai/mcp/tools/reverse-geocode
Convert coordinates to an address
Reverse geocode: convert geographic coordinates into a human-readable address or place name. Returns the nearest matching locations sorted by proximity.
You can filter by place type (venue, address, street, locality) to control the level of detail.
## Example prompts
* "What address is at 51.5034, -0.1276?"
* "What's at these coordinates: 48.8584, 2.2945?"
* "Tell me the nearest street address to this lat/lng"
* "What neighbourhood is this point in?"
## What you get back
The nearest location(s) with coordinates, a full label, country, region, district (e.g. borough or municipality), locality, neighbourhood, optional confidence score (omitted when 1.0), and result type. Each result also carries the straight-line `distance_meters` from the input point and — when the result isn't sitting on top of the input — a `bearing_deg` (0–360) plus 8-point `bearing_compass` (e.g. `"NE"`). By default returns a single result; you can ask for more.
When you request multiple results and they all share the same country / region, those fields are hoisted into a top-level `context` object so they aren't repeated on every row.
## Map rendering
Responses include a `render` envelope with a `point` layer for the resolved location(s). Pass `compact: true` for summary-only responses. See [response defaults & controls](/mcp/defaults) and [render envelopes](/mcp/render-envelopes).
## Example response
```json theme={null}
{
"structuredContent": {
"results": [
{
"name": "10 Downing Street",
"label": "10 Downing Street, London, England, United Kingdom",
"coordinates": { "lat": 51.5034, "lng": -0.1276 },
"place_type": "address"
}
],
"render": [
{ "kind": "point", "label": "Resolved location", "data": {/* FeatureCollection */}, "bbox": [/* … */] }
]
}
}
```
# search_along_route
Source: https://docs.footstep.ai/mcp/tools/search-along-route
Find places along a route ranked by detour time
Calculate a route and search for places along the corridor. Results are ranked by how little detour they add to your journey. Useful for finding stops on the way to a destination without going too far off course.
You can set the maximum acceptable detour (1 minute to 1 hour) to control how far off-route results can be.
## Example prompts
* "Find coffee shops on my way from Kings Cross to Cambridge"
* "Are there any petrol stations along the route that won't add more than 5 minutes?"
* "Show me restaurants between here and the airport with minimal detour"
* "What supermarkets can I stop at on my drive to Oxford?"
## What you get back
A list of places found along the corridor plus the route's totals (distance, duration, terrain). Each place includes the detour it would add (in seconds and meters), and where along the route it sits (as a percentage from start to end). Results are ranked by detour time so the most convenient stops come first.
When all candidate places share the same country / region (the typical case for an in-corridor search), those fields are hoisted to a top-level `places_context` object instead of being repeated on every place.
## Map rendering
Responses include a `render` envelope with a `linestring` layer for the route plus a `point` layer for the candidate places. Pass `compact: true` for summary-only responses (route summary fields and candidate places only). See [response defaults & controls](/mcp/defaults) and [render envelopes](/mcp/render-envelopes).
## Example response
```json theme={null}
{
"structuredContent": {
"route": { "distance_meters": 24000, "duration_seconds": 1500 },
"places": [
{ "place": { "name": "Costa", "label": "Costa, Cambridge Services", "coordinates": { "lat": 52.05, "lng": 0.10 } }, "detour_seconds": 90 }
],
"render": [
{ "kind": "linestring", "label": "Route", "data": {/* GeoJSON */}, "bbox": [/* … */] },
{
"kind": "point",
"label": "Matched places",
"data": {
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "geometry": {/* Point */}, "properties": { "name": "Costa", "detour_seconds": 90 } }
]
},
"bbox": [/* … */]
}
]
}
}
```
# search_places
Source: https://docs.footstep.ai/mcp/tools/search-places
Find places and points of interest near a location
Search for places by category or keyword near a location. Unlike `geocode` (which resolves a single specific address or landmark to coordinates), this is designed for discovery queries like "coffee shops near me" or "restaurants in Soho". Results are ranked by proximity.
`query` accepts both **categories** (cafe, restaurant, supermarket, park, gym, atm, pharmacy, hotel, hospital, fuel, library, museum, …) and **specific names** (Costa, Tesco, Black Sheep Coffee, Tower Bridge). Categories are expanded internally to multilingual synonyms — "cafe" also catches "coffee", "café", "kaffee", etc. Hybrid queries like "italian restaurant" combine the literal phrase with the category synonyms.
For "find X near Y" queries, pass `near` as a place name and the search center is geocoded for you — there is no need to call `geocode` first. If you already have coordinates, pass `lat` and `lon` instead — this disambiguates common place names that exist in multiple countries.
Qualify ambiguous `near` strings tightly: "Lebanon, NH" not just "Lebanon", "Cambridge, UK" when you specifically mean the English one. Add `country` (comma-separated ISO 3166-1 alpha-3 codes, e.g. `"GBR"` or `"USA,CAN"`) when the search context is country-bound.
## Example prompts
* "Find coffee shops near Kings Cross" → `search_places(query="coffee shop", near="Kings Cross, London")`
* "What restaurants are within 1km of my hotel?" → `search_places(query="restaurant", lat=..., lon=..., radius=1)`
* "Are there any supermarkets near 51.53, -0.12?" → `search_places(query="supermarket", lat=51.53, lon=-0.12)`
* "Show me parks within walking distance of Tower Bridge" → `search_places(query="park", near="Tower Bridge, London")`
* "Find an airport near Lebanon, NH" → `search_places(query="airport", near="Lebanon, NH", country="USA")`
## What you get back
A list of matching places, each with coordinates, name, full label, distance from the search point in meters, the bearing from the search point (`bearing_deg` 0–360 plus an 8-point `bearing_compass` like `"NE"`), and (when below 1.0) a confidence score. Results are sorted by proximity. Bearing is omitted for any place sitting essentially at the search point.
When every result is in the same country / region (the typical case for a proximity search), those admin fields are hoisted to a top-level `context` object instead of being repeated on each row. So the response shape is `{ results: [...], context?: { country, country_code, region } }` — read shared admin from `context`, per-result fields from `results[i]`.
## Map rendering
Responses include a `render` envelope with a `point` layer for the matched POIs. Each Feature carries the row's metadata (`name`, `label`, `place_type`, `confidence`) on `properties` so popups can be wired off the GeoJSON. Pass `compact: true` for summary-only responses. See [response defaults & controls](/mcp/defaults) and [render envelopes](/mcp/render-envelopes).
## Example response
```json theme={null}
{
"structuredContent": {
"results": [
{
"name": "Costa",
"label": "Costa Coffee, Camden, London",
"coordinates": { "lat": 51.54, "lng": -0.14 },
"place_type": "venue",
"distance_meters": 320,
"bearing_deg": 38,
"bearing_compass": "NE"
}
],
"context": { "country": "United Kingdom" },
"render": [
{ "kind": "point", "label": "Matched places", "data": {/* FeatureCollection */}, "bbox": [/* … */] }
]
}
}
```
# snap_trace
Source: https://docs.footstep.ai/mcp/tools/snap-trace
Clean up a GPS trace and get road details
Map-match a recorded GPS trace (up to 20,000 points) to the road network. Returns the corrected path with a confidence score, plus road details like surface type, road class, speed limits, and terrain analytics.
Useful for analysing recorded activities (runs, rides, walks) or cleaning noisy GPS data.
## Example prompts
* "Clean up this GPS trace from my bike ride"
* "What roads did I actually travel on during this run?"
* "Snap these GPS coordinates to roads and show me the surface types"
* "Analyse my recorded walk - what was the terrain and road quality like?"
## What you get back
A confidence-scored snapped path, route with terrain analytics (ascent, descent, difficulty), and per-segment road attributes (surface type, road class, speed limit, grade). Also includes per-point match quality so you can see where GPS was noisy.
Consecutive segments that share the same street names, road class, and surface are returned as a single edge — a long stretch of one road shows up once, not many times. Lengths sum across merged edges; `speed_kph` and `grade_percent` are length-weighted averages. The split is preserved whenever any of those attributes differ.
### Edge attributes
Each edge carries:
* **`road_class`** — one of `motorway`, `trunk`, `primary`, `secondary`, `tertiary`, `unclassified`, `residential`, `service`. Roughly mirrors OSM's `highway=*` hierarchy from biggest road type to smallest. `service` covers alleys, parking aisles, and driveways.
* **`surface`** — one of `paved_smooth`, `paved`, `paved_rough`, `compacted`, `dirt`, `gravel`, `ground`, `impassable`. `compacted` is a firm gravel/dirt mix; `ground` is natural untreated terrain.
* `names` — array of street names for the edge (often empty on unnamed paths).
* `length_meters`, `speed_kph`, `grade_percent` — numeric attributes.
Unknown values from the underlying engine are dropped rather than passed through, so any string you see in `road_class` or `surface` is from the lists above.
### Low-confidence matches
When `confidence` is below 0.5 — meaning the trace couldn't be reliably matched to the road network (sparse points, off-road, or noisy GPS) — the response includes:
* `match_quality: "low"` — a flag indicating the match is unreliable.
* `match_quality_reason` — a short human-readable explanation.
`distance_meters`, `duration_seconds`, `edges`, and `terrain` are still populated so you can see what the engine reconstructed. The disclaimer travels alongside the data — treat numbers as approximate when `match_quality` is set, exact when it isn't.
## When a trace can't be matched
Some inputs can't produce a meaningful match — too few points, points spaced too widely, or points too far from any road. The endpoint returns **422 Unprocessable Entity** with a message describing the cause (e.g. `"Insufficient number of trace points"`, `"No suitable edges near input location"`). Treat 422 as a "fix the input" signal rather than retrying. Common fixes:
* **Sparse traces** — provide more points (every few seconds, not every minute) or include `time` on each point.
* **Off-road points** — relax `gps_accuracy` or `search_radius` so the matcher can snap further from the recorded location.
* **Single-mode mismatch** — if a phone trace was recorded while indoors or in a tunnel, try `shape_match: "walk_or_snap"` (the default) rather than strict `map_snap`.
## Matching strictness
The tool defaults to a forgiving matching mode (`walk_or_snap`) that handles typical phone-GPS noise — if a point falls a few metres off the nearest road, the tool walks the closest edge rather than rejecting the whole trace. This matches the realistic 5–15 m accuracy of urban GPS recordings.
For high-quality traces (cyclometer downloads, surveying-grade data) or when you want strict per-point snapping, the REST API exposes `shape_match` (`edge_walk` / `map_snap` / `walk_or_snap`) and `gps_accuracy`. Defaults are sensible for most cases — only override when you have a specific reason.
## Map rendering
Responses include a `render` envelope with a `linestring` layer for the snapped trace. Pass `compact: true` for summary-only responses. See [response defaults & controls](/mcp/defaults) and [render envelopes](/mcp/render-envelopes).
## Example response
```json theme={null}
{
"structuredContent": {
"confidence": 0.91,
"distance_meters": 2300,
"duration_seconds": 480,
"terrain": { "difficulty": "flat", "total_ascent_meters": 4 },
"edges": [/* coalesced segment-level surface / class / speed / grade */],
"render": [
{ "kind": "linestring", "label": "Snapped trace", "data": {/* GeoJSON LineString */}, "bbox": [/* … */] }
]
}
}
```
# Pricing
Source: https://docs.footstep.ai/pricing
Pay-as-you-go pricing for every endpoint
Pay only for successful API calls. Every new account starts with £5 credit.
## API pricing
| API | Price |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **Geocoding** — [search](/api/endpoint/search), [reverse](/api/endpoint/reverse), [autocomplete](/api/endpoint/autocomplete), [structured search](/api/endpoint/structured-search), [places](/api/endpoint/places), [parse](/api/endpoint/parse), [locate](/api/endpoint/locate) | **£0.50** per 1,000 requests |
| **Routing** — [route](/api/endpoint/route), [optimise](/api/endpoint/optimize), [elevation](/api/endpoint/elevation), [isochrone](/api/endpoint/isochrone), [matrix](/api/endpoint/matrix), [snap](/api/endpoint/snap), [compare](/api/endpoint/compare), [find & route](/api/endpoint/find-and-route), [search along route](/api/endpoint/search-along-route), [batch geocode](/api/endpoint/batch) | **£2.00** per 1,000 requests |
| **Natural Language** — [query](/api/endpoint/query), [address correction](/api/endpoint/parse-address) | **£25.00** per 1,000 requests |
| **Predict** Research Preview — [spatial probability model](/api/endpoint/predict) | **£1.00** per request |
All prices in GBP. Only successful responses (2xx/3xx) are billed — failed requests are never charged.
## How it works
1. **Sign up** at [console.footstep.ai](https://console.footstep.ai) — your account is credited with £5
2. **Make API calls** — usage is metered per request at the rates above
3. **Top up** your balance when you need to, or enable auto-recharge
MCP tool calls are billed at the same rate as the underlying API endpoint.
## Billing details
* Usage is tracked per API key and deducted in near real-time
* When your balance reaches zero, requests return `402 Payment Required`
* Set up [auto-recharge](https://console.footstep.ai) in the console to top up automatically
* All prices exclude VAT where applicable
## Volume pricing
Sustained usage above 1 million requests per month? [Contact us](mailto:support@footstep.ai) for volume pricing.
## Next steps
Get your API key and make your first request in minutes.
Learn how to authenticate your API calls.
# Quickstart
Source: https://docs.footstep.ai/quickstart
First API calls for routing and geocoding
This guide covers routing between two coordinates and geocoding an address. You'll need an API key from [console.footstep.ai](https://console.footstep.ai).
## Get an API key
Sign up at [console.footstep.ai](https://console.footstep.ai) and create an API key. Your key will look like `sk_live_abc123...`. Keep it safe, as it's used to authenticate every request.
API keys are for server-side use only. Never expose them in frontend code, mobile apps, or anywhere a user could inspect network traffic.
## Your first request
Every routing request needs at least two locations: a start and an end. Each location is a `lat`/`lon` pair. Here's a route from King's Cross to Tower Bridge in London:
```bash cURL theme={null}
curl -X POST https://api.footstep.ai/v1/routing/route \
-H "x-api-key: sk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"locations": [
{ "lat": 51.5322, "lon": -0.1240 },
{ "lat": 51.5055, "lon": -0.0754 }
]
}'
```
```javascript JavaScript theme={null}
const response = await fetch("https://api.footstep.ai/v1/routing/route", {
method: "POST",
headers: {
"x-api-key": "sk_live_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
locations: [
{ lat: 51.5322, lon: -0.1240 },
{ lat: 51.5055, lon: -0.0754 },
],
}),
});
const data = await response.json();
```
```python Python theme={null}
import requests
response = requests.post(
"https://api.footstep.ai/v1/routing/route",
headers={"x-api-key": "sk_live_your_key_here"},
json={
"locations": [
{"lat": 51.5322, "lon": -0.1240},
{"lat": 51.5055, "lon": -0.0754},
]
},
)
data = response.json()
```
The defaults return a car route with terrain analytics. You can change this with the `travel` parameter.
## Understand the response
The response contains a `route` object with everything you need:
```json theme={null}
{
"route": {
"distance_meters": 5765,
"duration_seconds": 812,
"terrain": {
"total_ascent_meters": 12.4,
"total_descent_meters": 8.1,
"max_elevation_meters": 28,
"min_elevation_meters": 5,
"avg_grade_percent": 1.2,
"max_grade_percent": 4.5,
"elevation_profile": [
{ "distance_meters": 0, "elevation_meters": 22 },
{ "distance_meters": 500, "elevation_meters": 18 },
{ "distance_meters": 1000, "elevation_meters": 15 }
],
"difficulty": "flat"
},
"legs": [
{
"distance_meters": 5765,
"duration_seconds": 812,
"steps": [
{
"instruction": "Drive north on Midland Road.",
"distance_meters": 120,
"duration_seconds": 15
}
]
}
]
}
}
```
Here's what the key fields mean:
| Field | What it tells you |
| ------------------------------ | -------------------------------------------------------------------- |
| `distance_meters` | Total route distance in meters |
| `duration_seconds` | Estimated travel time in seconds |
| `terrain.total_ascent_meters` | Total climbing over the route in meters |
| `terrain.total_descent_meters` | Total descending over the route in meters |
| `terrain.elevation_profile` | Array of distance/elevation points for charting |
| `terrain.difficulty` | Overall classification: `flat`, `rolling`, `hilly`, or `mountainous` |
| `legs[].steps[]` | Turn-by-turn directions with distance and time per manoeuvre |
All field names include their unit. `distance_meters` is always meters, `duration_seconds` is always seconds, `grade_percent` is always a percentage. This is true regardless of the `units` parameter you send in the request.
## Change how you travel
The default is `auto` (car). You can switch to walking, cycling, or other travel types using the `travel` parameter:
```json theme={null}
{
"locations": [
{ "lat": 51.5322, "lon": -0.1240 },
{ "lat": 51.5055, "lon": -0.0754 }
],
"travel": "pedestrian"
}
```
| Travel | Use case |
| ------------ | ------------------------------------------------------------ |
| `auto` | Car routing (default) |
| `pedestrian` | Walking and hiking. Factors in terrain, avoids motorways |
| `bicycle` | Cycling. Considers surface type and hill gradients |
| `bus` | Bus routing |
| `truck` | Truck routing. Respects vehicle dimensions and weight limits |
Each travel type produces different routes and terrain analytics. A `pedestrian` route through hilly terrain will show significantly different `difficulty` and grade profiles compared to the same coordinates with `auto`.
## Try GeoJSON format
By default, responses use the `footstep` format, which is compact JSON with encoded polyline geometry. If you're working with mapping libraries or GIS tools, you can request GeoJSON instead:
```json theme={null}
{
"locations": [
{ "lat": 51.5322, "lon": -0.1240 },
{ "lat": 51.5055, "lon": -0.0754 }
],
"format": "geojson"
}
```
This returns a standard [GeoJSON FeatureCollection](https://datatracker.ietf.org/doc/html/rfc7946) with decoded coordinate arrays. You can paste the response directly into [geojson.io](https://geojson.io) to visualise it, or load it into Leaflet, Mapbox GL, deck.gl, or QGIS without any transformation.
## Try geocoding
Geocoding converts text into coordinates. Search for any address, place, or landmark:
```bash cURL theme={null}
curl "https://api.footstep.ai/v1/geocoding/search?text=Buckingham+Palace" \
-H "x-api-key: sk_live_your_key_here"
```
```javascript JavaScript theme={null}
const response = await fetch(
"https://api.footstep.ai/v1/geocoding/search?text=Buckingham+Palace",
{ headers: { "x-api-key": "sk_live_your_key_here" } }
);
const data = await response.json();
```
```python Python theme={null}
import requests
response = requests.get(
"https://api.footstep.ai/v1/geocoding/search",
headers={"x-api-key": "sk_live_your_key_here"},
params={"text": "Buckingham Palace"},
)
data = response.json()
```
Every result includes a confidence score and place type:
```json theme={null}
{
"results": [
{
"coordinates": { "lat": 51.5014, "lng": -0.1419 },
"label": "Buckingham Palace, London, England, United Kingdom",
"name": "Buckingham Palace",
"confidence": 0.95,
"place_type": "venue"
}
]
}
```
Use `focus.point` to bias results towards a location (e.g. the user's city) and `boundary.country` to restrict to specific countries. See the [geocoding guide](/api/geocoding) for the full set of parameters and endpoints.
## Next steps
Terrain-intelligent routing, elevation, and spatial analysis.
Search, reverse geocode, autocomplete, and batch processing.
How API keys work, key states, and security practices.
Error codes, what triggers them, and how to handle retries.