# fittings Nearest Point

> fittings Nearest Point is a paid API for AI agents from fittings.sh, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Finds the closest candidate coordinate to a query point, returning great-circle distance and initial bearing.

## Facts

- Endpoint: POST https://fittings.sh/v1/spatial/nearest-point
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fittings-nearest-point-90a8c498
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_blceEiedOPO1JJAndta8_

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 fittings-nearest-point-90a8c498 -d '<json body>'
```

Example prompt: From this list of warehouse coordinates, which one is closest to the point at latitude 40.7128, longitude -74.0060? Give me the distance and the direction I'd head from there.

## When to prefer this

Use this endpoint when you need to identify the single nearest coordinate from a set of up to 5000 candidates to a given query point, getting both distance and bearing in one call. It is ideal for logistics, store-finder, fleet dispatch, or any proximity-matching workflow where you already have a list of candidate locations. Prefer this over computing pairwise distances yourself or using a full routing engine when straight-line (great-circle) distance is sufficient and you don't need road-network routing.

## Known failure modes

- Empty candidates array returns an error or empty result
- Malformed coordinate objects (missing lat or lon) cause validation errors
- Exceeding the 5000-candidate limit may return a 400 error
- Invalid GeoJSON format (e.g. lat/lon swapped) produces incorrect results silently
- Network timeout if payload is very large

## How this service works

The closest candidate coordinate to a query point, with great-circle distance and initial bearing.

## Output

Returns the single closest candidate point from the provided list, along with the great-circle distance in meters and the initial bearing in degrees from the query point to that candidate. If the candidate had an ID, that is included in the response.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "point": {
   "type": "object",
   "description": "{lat, lon} or GeoJSON [longitude, latitude]"
  },
  "candidates": {
   "type": "array",
   "description": "Up to 5000 points, each {lat, lon, id?} or [longitude, latitude]"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fittings-nearest-point-90a8c498/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fittings.sh](https://www.zero.xyz/host/fittings.sh/llms.txt)
