# boring-api · geo — Polygon Centroid

> boring-api · geo — Polygon Centroid 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-15).

Computes the geometric centroid (center point) of a polygon using pure in-Worker spatial math, with no external API calls.

## Facts

- Endpoint: POST https://geo.boring-api.com/polygon-centroid
- Price: $0.0005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/boring-api-geo-polygon-centroid-6383ab98
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KifcbgzQ2vXMUzVIdhijA

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-polygon-centroid-6383ab98 -d '<json body>'
```

Example prompt: Calculate the centroid of this polygon: {"type":"Polygon","coordinates":[[[-73.99,40.73],[-73.97,40.73],[-73.97,40.75],[-73.99,40.75],[-73.99,40.73]]]}

## When to prefer this

Choose this endpoint when you need fast, serverless, no-external-call centroid computation for a polygon — especially when you want predictable low latency and privacy since no data leaves the Worker. Prefer over GIS platform APIs when you don't need map rendering or additional geospatial enrichment.

## Known failure modes

- Invalid or malformed polygon object returns a 400 error
- Unclosed polygon ring may cause computation error or unexpected result
- Self-intersecting polygon may produce geometrically incorrect centroid
- Missing polygon property in request body causes validation failure
- Very large or complex polygon with many vertices may increase latency slightly

## 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 centroid object containing the computed geographic center point of the submitted polygon, expressed as latitude and longitude coordinates. Computation is performed entirely in-Worker with no external dependencies.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "polygon": {
   "type": "object"
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/boring-api-geo-polygon-centroid-6383ab98/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)
