# geoprimitives GeoJSON Validator

> geoprimitives GeoJSON Validator is a paid API for AI agents from api.geoprimitives.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-11).

Validates a GeoJSON document against RFC 7946 and returns a structured, indexed list of errors and warnings with precise feature, geometry, ring, and position references.

## Facts

- Endpoint: POST https://api.geoprimitives.dev/v1/geojson/validate?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/geoprimitives-geojson-validator-15df9e4c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lLuJU1-V3v3FStymF1jhV

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 geoprimitives-geojson-validator-15df9e4c -d '<json body>'
```

Example prompt: Can you validate this GeoJSON FeatureCollection for me and tell me exactly which features have problems, what's wrong with them, and where in the coordinates the issue is — I need to know before I run it through the polyfill?

## When to prefer this

Choose this endpoint when you need actionable, indexed validation feedback rather than a bare pass/fail boolean. It is especially valuable before submitting GeoJSON to downstream geometry operations (polyfill, point-in-polygon, geometry processing) that reject invalid documents without explanation. Use it to audit third-party or user-authored GeoJSON, to diagnose why another endpoint refused a document, or any time you need to locate and fix specific geometry issues in a collection. The flat per-call pricing makes it cost-effective to validate entire FeatureCollections in one call rather than document by document.

## Known failure modes

- Malformed JSON body returns a parse error
- Input is not a GeoJSON object (missing 'type' field) returns a structure error
- Network timeout on very large documents
- Unexpected geometry types not in the RFC 7946 spec may be flagged as structural errors

## How this service works

Validate GeoJSON against RFC 7946 and get back a structured list of problems, not a bare boolean. Checks structure, coordinate range, ring closure, ring winding order, consecutive duplicate vertices, self-intersections, and hole nesting. Every issue carries the feature, geometry, ring and position index it sits on, so a 500-feature collection is actionable rather than merely condemned. Reach for it before paying for an operation on data you did not author, and to find out why /v1/geometry, /v1/h3/polyfill or /v1/pip refused a document: those endpoints reject unclosed rings and out-of-range coordinates rather than guessing. Errors make a document invalid; warnings -- duplicate vertices, the crs member RFC 7946 removed -- do not, and are reported separately. One price per call whatever the document: a single Point costs exactly what a 1 MiB FeatureCollection costs, so send the whole collection rather than a document at a time. That is measured rather than assumed -- a Point is about 0.0015 ms of compute on this runtime and a 1 MiB collection about 10 ms, a spread far below what it costs to settle one payment -- which is why there is no size tier here to choose between and no bulk sibling to look for. Nothing is modified here: POST /v1/geojson/repair is the endpoint that rewrites. Limits: 1 MiB request body, and a self-intersection budget of 2000000 segment-pair comparisons per request, enough for any ring under about 1400 vertices. Rings past the budget are listed in checksSkipped with the reason, never silently passed as clean.

## Output

A structured report containing two lists: 'errors' (issues that make the document invalid, e.g. unclosed rings, out-of-range coordinates, bad structure, self-intersections, wrong hole nesting) and 'warnings' (non-fatal issues, e.g. duplicate consecutive vertices, deprecated crs member). Each issue carries the feature index, geometry index, ring index, and position index where it occurs, making every finding directly actionable on collections of any size.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "type": {
   "enum": [
    "FeatureCollection",
    "Feature",
    "Point",
    "MultiPoint",
    "LineString",
    "MultiLineString",
    "Polygon",
    "MultiPolygon",
    "GeometryCollection"
   ],
   "type": "string",
   "description": "GeoJSON type. Post the document itself: a Feature, a FeatureCollection, or a bare Geometry."
  },
  "features": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "Present when type is FeatureCollection."
  },
  "geometry": {
   "type": "object",
   "description": "Present when type is Feature. May be null."
  },
  "geometries": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "description": "Present when type is GeometryCollection."
  },
  "coordinates": {
   "type": "array",
   "description": "Present on a bare Geometry other than GeometryCollection."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/geoprimitives-geojson-validator-15df9e4c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.geoprimitives.dev](https://www.zero.xyz/host/api.geoprimitives.dev/llms.txt)
