airport.near

Airports within a radius of a coordinate, sorted by distance. Query: lat (-90..90), lon (-180..180), radius_km (1-2000, default 200), limit (1-100, default 20), type (optional: large_airport|medium_airport|small_airport|heliport|seaplane_base|balloonport|closed), country (optional 2-letter ISO 3166-1), scheduled_service (optional bool, true = commercial-service airports only). Returns { query, count, airports: [{ id, ident, name, iataCode, icaoCode, type, latitude, longitude, distanceKm, ... }] }.

price
$0.0010 USDC per call
method
GET/api/airport/near
payment
x402 v2 · EIP-3009 transferWithAuthorization · USDC on Base mainnet
auth
None. Sign the payment, retry with PAYMENT-SIGNATURE.
tier
Tier 0 — no paid upstream

Parameters

NameTypeDescription
latrequirednumberLatitude in decimal degrees (-90 to 90).
min -90 · max 90
lonrequirednumberLongitude in decimal degrees (-180 to 180).
min -180 · max 180
radius_kmnumberSearch radius in kilometers (1-2000). Default 200.
min 1 · max 2000
limitintegerMax airports to return (1-100). Default 20.
min 1 · max 100
typestringFilter by airport type.
one of: large_airport | medium_airport | small_airport | heliport | seaplane_base | balloonport | closed
countrystringFilter by ISO 3166-1 alpha-2 country code (e.g. US).
match ^[A-Z]{2}$
scheduled_servicebooleanWhen true, only commercial-service airports.

Code samples

cURLbash
# 1. Probe with no auth → 402 envelope with PaymentRequirements
curl -sS 'https://2s.io/api/airport/near?lat=-90&lon=-180&radius_km=200&limit=20&type=large_airport&country=example&scheduled_service=false'

# 2. Sign + retry with PAYMENT-SIGNATURE:
curl -sS 'https://2s.io/api/airport/near?lat=-90&lon=-180&radius_km=200&limit=20&type=large_airport&country=example&scheduled_service=false' \
  -H 'PAYMENT-SIGNATURE: <base64-json-payload>'

# Or use the canonical runner (handles probe → sign → retry):
#   EVM_PRIVATE_KEY=0x... node --env-file=.env.local \
#     --experimental-strip-types scripts/x402-pay.ts \
#     'https://2s.io/api/airport/near?lat=-90&lon=-180&radius_km=200&limit=20&type=large_airport&country=example&scheduled_service=false'
TypeScript / Node — @2sio/sdktypescript
import { TwoS } from '@2sio/sdk'

const client = new TwoS({
  privateKey: process.env.EVM_PRIVATE_KEY as `0x${string}`,
})

const result = await client.airport.near({
  "lat": -90,
  "lon": -180,
  "radius_km": 200,
  "limit": 20,
  "type": "large_airport",
  "country": "example",
  "scheduled_service": false
})

console.log('endpoint:', result.endpoint)
console.log('cost:', result.costUsd, 'USDC')
console.log('tx:', result.settlement?.txHash)
console.log('data:', result.data)
Python — 2siopython
import os
from twosio import TwoS

client = TwoS(private_key=os.environ["EVM_PRIVATE_KEY"])

result = client.airport.near(lat=-90, lon=-180, radius_km=200, limit=20, type="large_airport", country="example", scheduled_service=False)

print("endpoint:", result.endpoint)
print("cost:", result.cost_usd, "USDC")
print("tx:", (result.settlement or {}).get("tx_hash"))
print("data:", result.data)
MCP — Claude Desktop / AgentKit / any MCP hostjson
// 1. Add @2sio/mcp to your MCP host config (Claude Desktop example below).
//    EVM_PRIVATE_KEY funds x402 payments per call.

// claude_desktop_config.json
{
  "mcpServers": {
    "2sio": {
      "command": "npx",
      "args": ["-y", "@2sio/mcp"],
      "env": { "EVM_PRIVATE_KEY": "0x..." }
    }
  }
}

// 2. Once the server is running, agents call this tool via standard MCP:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "airport.near",
    "arguments": {
      "lat": -90,
      "lon": -180,
      "radius_km": 200,
      "limit": 20,
      "type": "large_airport",
      "country": "example",
      "scheduled_service": false
    }
  }
}

Response

FieldTypeDescription
queryobject
countinteger
airportsarray
sourceobject
Example response datajson
{
  "query": {
    "latitude": 1,
    "longitude": 1,
    "radiusKm": 1,
    "limit": 1,
    "type": "example",
    "country": "example",
    "scheduledServiceOnly": false
  },
  "count": 1,
  "airports": [
    {
      "id": 1,
      "ident": "example",
      "name": "example",
      "iataCode": "example",
      "icaoCode": "example",
      "type": "example",
      "latitude": 1,
      "longitude": 1,
      "distanceKm": 1,
      "isoCountry": "example",
      "isoRegion": "example",
      "municipality": "example",
      "scheduledService": false
    }
  ],
  "source": {
    "provider": "example",
    "license": "example",
    "url": "example"
  }
}

Discovery

2s.io is x402-native. Every call is paid per-request from a USDC-funded EVM wallet on Base — no signup, no API keys, no monthly fees. Source code: github.com/2s-io/sdk.