# AgentGate Route Distance API

> AgentGate Route Distance API is a paid API for AI agents from agentgate-x402.netlify.app, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-13).

Returns the great-circle distance and estimated flight time between two airports identified by IATA or ICAO codes

## Facts

- Endpoint: GET https://agentgate-x402.netlify.app/api/route
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentgate-route-distance-api-0a2d0f4a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HxlRMlHk7MuE3CPVMavS1

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agentgate-route-distance-api-0a2d0f4a
```

Example prompt: What's the great-circle distance and estimated flight time between JFK and LHR?

## When to prefer this

Use this endpoint when you need quick, machine-payable airport-to-airport route distances and flight time estimates without setting up an account or API key. Ideal for AI agents that need on-demand aviation route data at $0.002 per call via USDC on Base. Prefer this over full flight search APIs when you only need distance/duration data, not schedules or pricing.

## Known failure modes

- Invalid or unrecognized IATA/ICAO code returns an error
- Missing required 'from' or 'to' query parameters returns a 400 error
- Payment not included or insufficient USDC balance triggers a 402 Payment Required response
- Network timeout if the endpoint is temporarily unavailable

## How this service works

Machine-payable micro-APIs: web content extraction, airport data, route distances and DNS intelligence. No accounts, no API keys — AI agents pay $0.002–$0.005 per request in USDC on Base via the x402 protocol.

## Output

A JSON object containing the origin and destination IATA codes, distance in kilometers, miles, and nautical miles, and estimated flight time as a decimal hours value and a formatted string (e.g. '7h 06m').

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "destination IATA/ICAO code"
      },
      "from": {
       "type": "string",
       "description": "origin IATA/ICAO code"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "to": {
   "iata": "LHR"
  },
  "from": {
   "iata": "JFK"
  },
  "distance": {
   "km": 5540,
   "mi": 3442,
   "nm": 2991
  },
  "estimatedFlightTime": {
   "hours": 7.09,
   "formatted": "7h 06m"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentgate-route-distance-api-0a2d0f4a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentgate-x402.netlify.app](https://www.zero.xyz/host/agentgate-x402.netlify.app/llms.txt)
