# boring-api · geo — Bearing

> boring-api · geo — Bearing is a paid API for AI agents from geo.boring-api.com, paid per call via x402, $0.0005/call, status unknown (last checked 2026-09-13).

Computes the compass bearing (initial heading angle) between two geographic coordinates using pure in-Worker spatial math, with no external API calls.

## Facts

- Endpoint: POST https://geo.boring-api.com/bearing
- Price: $0.0005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/boring-api-geo-bearing-8a6d33e1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lEDagsSGvM9oAlGAj7wje

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 boring-api-geo-bearing-8a6d33e1 -d '<json body>'
```

Example prompt: What's the compass bearing from Seattle (47.6062, -122.3321) to Denver (39.7392, -104.9903)? Just compute the heading angle between those two points.

## When to prefer this

Choose this endpoint when you need a fast, cheap, serverless bearing/heading computation with no third-party API dependency or rate limits. Ideal for agents that need real-time directional math embedded in a workflow without managing geospatial libraries. Prefer over full mapping APIs (Google Maps, Mapbox) when you only need the bearing angle and want predictable $0.0005 per-call pricing.

## Known failure modes

- Missing or malformed 'from' or 'to' coordinate objects — likely returns a 400 or validation error
- Coordinates outside valid lat/lon ranges (lat > 90, lon > 180) may produce incorrect results or errors
- Payment not included or insufficient — returns HTTP 402 requiring x402 payment of $0.0005 USDC
- Identical 'from' and 'to' points may return undefined or zero bearing
- Non-numeric latitude/longitude values causing parse failures

## How this service works

Pure-library spatial math and timezone lookup. Distance, bearing, polygons, point-in-polygon, timezone-by-coords. No external API calls — all computed in-Worker.

## Output

Returns a JSON object containing the computed bearing angle in degrees (0–360), representing the initial compass heading from the 'from' coordinate to the 'to' coordinate, calculated entirely in-Worker without any external API calls.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "type": "object"
  },
  "from": {
   "type": "object"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/boring-api-geo-bearing-8a6d33e1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from geo.boring-api.com](https://www.zero.xyz/host/geo.boring-api.com/llms.txt)
