{"uid":"cap_YpR_HJmSfQQewRvRlJMsB","slug":"agent-time-place-distance-calculator-9bbf12ed","name":"Agent Time & Place – Distance Calculator","description":"Geocoding, timezones, holidays, business days, sun times, FX and distances for AI agents. Deterministic, sub-cent, no API key: payment is authentication (x402).","url":"https://time-place.agent-utils.workers.dev/v1/distance","method":"GET","headers":{},"bodySchema":{"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":"'lat,lon' or city name"},"from":{"type":"string","description":"'lat,lon' or city name"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"km":{"type":"number"},"to":{"type":"object"},"from":{"type":"object"},"miles":{"type":"number"},"compass":{"type":"string"},"bearingDeg":{"type":"number"},"nauticalMiles":{"type":"number"},"timezoneOffsetDifferenceMinutes":{"type":"integer"}}}}}}},"responseSchema":{"type":"json","example":{"km":7936.2,"to":{"lat":-23.5475,"lon":-46.6361,"name":"São Paulo","timezone":"America/Sao_Paulo"},"from":{"lat":38.7167,"lon":-9.1333,"name":"Lisbon","timezone":"Europe/Lisbon"},"miles":4931.3,"compass":"SW","bearingDeg":224.1,"nauticalMiles":4285.2,"timezoneOffsetDifferenceMinutes":-240}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_HmRSuTdo66kUNJ8URv8eO","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the geodesic distance between two locations (by coordinates or city name), returning km, miles, nautical miles, bearing, compass direction, and timezone offset difference.","exampleAgentPrompt":"How far is it from Lisbon to São Paulo — give me the distance in kilometers and miles, the compass direction, and the timezone difference between the two cities?","exampleUseCases":[{"title":"Shipping route distance estimate","prompt":"What's the straight-line distance in nautical miles from Rotterdam to Singapore, and what compass bearing would a ship follow?"},{"title":"Cross-timezone meeting distance check","prompt":"How far apart are New York and London, and what's the timezone offset between them so I know how many hours ahead London is?"},{"title":"Field coordinate distance verification","prompt":"Can you calculate the distance in kilometers between coordinates 34.0522,-118.2437 and 40.7128,-74.0060, and tell me the compass direction?"}],"resultDescription":"Returns a JSON object with the resolved 'from' and 'to' locations (name, lat, lon, timezone), distance in km, miles, and nautical miles, compass direction string (e.g. 'SW'), bearing in degrees, and the timezone offset difference in minutes between the two locations.","failureModes":["Unresolvable city name returns a geocoding error","Malformed 'lat,lon' string causes a 400 bad request","Missing 'from' or 'to' query parameter causes a 422 validation error","Payment not provided or insufficient triggers a 402 Payment Required response","Rate or quota issues may return 429 or 503"],"whenToPreferThis":"Choose this endpoint when you need a deterministic, sub-cent, keyless distance calculation between two points on Earth — especially when you also want bearing, compass direction, and timezone offset in a single call. Ideal for AI agents that need geospatial context without managing API keys; payment-as-authentication via x402 makes it frictionless for autonomous agents.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:43:37.691Z","isFirstParty":false}