# fittings Point-in-Polygon

> fittings Point-in-Polygon 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).

Determines whether a geographic point falls inside, outside, or on the boundary of a GeoJSON Polygon or MultiPolygon, correctly handling holes and boundary cases.

## Facts

- Endpoint: POST https://fittings.sh/v1/spatial/point-in-polygon
- 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-point-in-polygon-28921bff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ujD6LWuRU1uEBeKDX_8q4

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-point-in-polygon-28921bff -d '<json body>'
```

Example prompt: Is the point at latitude 51.5074, longitude -0.1278 inside this GeoJSON polygon I'm pasting — and if it lands exactly on an edge, count that as outside: {"type":"Polygon","coordinates":[[[-0.15,51.49],[-0.10,51.49],[-0.10,51.52],[-0.15,51.52],[-0.15,51.49]]]}?

## When to prefer this

Choose this endpoint when you need a precise, hole-aware point-in-polygon test on arbitrary GeoJSON shapes — including MultiPolygons with interior holes — and need explicit control over boundary semantics. It is ideal for geofencing, delivery zone checks, and regulatory containment queries where boundary edge cases matter and the polygon complexity can reach up to 20,000 vertices.

## Known failure modes

- Malformed GeoJSON polygon input returns a validation error
- Polygon exceeds 20,000 vertex limit and is rejected
- Point coordinates provided in wrong order (lat/lon vs lon/lat) produce incorrect results
- Self-intersecting or unclosed polygon rings may produce undefined results
- Missing required point or polygon field returns a 400 error

## How this service works

Whether a coordinate falls inside a GeoJSON Polygon or MultiPolygon, honouring holes and reporting boundary hits.

## Output

A JSON object indicating whether the point is inside the polygon (true/false), whether it landed exactly on a boundary edge, and the final classification accounting for the ignoreBoundary flag setting.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "point": {
   "type": "object",
   "description": "{lat, lon} or GeoJSON [longitude, latitude]"
  },
  "polygon": {
   "type": "object",
   "description": "GeoJSON Polygon, MultiPolygon, Feature or bare ring, up to 20000 vertices"
  },
  "ignoreBoundary": {
   "type": "boolean",
   "description": "Treat a point on an edge as outside. Defaults to false."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fittings-point-in-polygon-28921bff/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)
