# Duo Data Utilities – GeoJSON Polygon Geometry

> Duo Data Utilities – GeoJSON Polygon Geometry is a paid API for AI agents from api.duoleads.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-02).

Computes geometric predicates on a GeoJSON Polygon or MultiPolygon: point-in-polygon containment, bounding box, centroid, geodesic area (m²), perimeter length, and ring winding order.

## Facts

- Endpoint: GET https://api.duoleads.com/v1/geo/polygon?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/duo-data-utilities-geojson-polygon-geometry-7d8793c8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0pb1wgdEZ1PtNPjnr114S

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 duo-data-utilities-geojson-polygon-geometry-7d8793c8
```

Example prompt: Does the point at latitude 52.375, longitude 4.9 fall inside this GeoJSON polygon: {"type":"Polygon","coordinates":[[[4.85,52.35],[4.95,52.35],[4.95,52.4],[4.85,52.4],[4.85,52.35]]]}? Also give me its geodesic area, centroid, and bounding box.

## When to prefer this

Choose this endpoint when you need deterministic, server-side geodesic geometry computations on GeoJSON polygons — especially when correct hole handling, accurate WGS-84 area/perimeter at any latitude, or point-in-polygon tests are required without installing a geospatial library. Prefer it over client-side turf.js or PostGIS when you need a stateless, pay-per-call API with no infrastructure setup. Best for single polygon analysis up to 2000 coordinate pairs.

## Known failure modes

- geometry string exceeds 3072 characters — returns error
- more than 2000 coordinate pairs — returns error
- invalid or malformed GeoJSON — returns validation error
- lat/lon out of valid WGS-84 range — returns parameter error
- geometry type other than Polygon/MultiPolygon/wrapping Feature — returns unsupported type error
- missing required geometry query param — returns 400 bad request
- payment not received — returns 402 Payment Required

## How this service works

Geometric predicates on a GeoJSON geometry supplied in the request: point-in-polygon with correct hole handling, bounding box, centroid, signed area in square metres, perimeter length, and ring winding order. Accepts Polygon and MultiPolygon, and a GeoJSON Feature wrapping either. Area and length are geodesic on the WGS-84 ellipsoid, correct at any latitude; containment is planar in lon/lat.

## Output

A JSON object containing: ok (true), and a data object with any computed subset of: bbox ([minLon,minLat,maxLon,maxLat]), centroid ({lat,lon}), area_m2 (geodesic area on WGS-84), perimeter_m (geodesic perimeter), winding (array of 'cw'/'ccw' per ring), contains (boolean, if lat/lon provided), on_boundary (boolean), rings (count), vertices (count). Also includes meta with request_id, computed_at timestamp, price_usd, and deterministic flag.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "geometry"
     ],
     "properties": {
      "lat": {
       "type": "string",
       "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
       "maxLength": 64,
       "description": "Point latitude; with lon, runs the containment test."
      },
      "lon": {
       "type": "string",
       "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
       "maxLength": 64,
       "description": "Point longitude; with lat, runs the containment test."
      },
      "ops": {
       "type": "string",
       "maxLength": 128,
       "description": "Comma-separated subset of contains,bbox,centroid,area,perimeter,winding. Default all."
      },
      "geometry": {
       "type": "string",
       "maxLength": 3072,
       "description": "URL-encoded GeoJSON Polygon, MultiPolygon or a Feature wrapping one. At most 3072 characters and 2000 coordinate pairs."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "ok",
      "route",
      "version",
      "data",
      "meta"
     ],
     "properties": {
      "ok": {
       "const": true
      },
      "data": {
       "type": "object",
       "required": [
        "rings",
        "vertices"
       ],
       "properties": {
        "bbox": {
         "type": "array",
         "items": {
          "type": "number"
         }
        },
        "rings": {
         "type": "integer"
        },
        "area_m2": {
         "type": "number"
        },
        "winding": {
         "type": "array",
         "items": {
          "type": "string"
         }
        },
        "centroid": {
         "type": "object",
         "required": [
          "lat",
          "lon"
         ],
         "properties": {
          "lat": {
           "type": "number"
          },
          "lon": {
           "type": "number"
          }
         }
        },
        "contains": {
 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "bbox": [
    4.85,
    52.35,
    4.95,
    52.4
   ],
   "rings": 1,
   "area_m2": 37890432.411,
   "winding": [
    "ccw"
   ],
   "centroid": {
    "lat": 52.37500000001563,
    "lon": 4.900000000001667
   },
   "contains": true,
   "vertices": 4,
   "on_boundary": false,
   "perimeter_m": 24747.979
  },
  "meta": {
   "price_usd": "0.05",
   "disclaimer": "Factual output of a deterministic computation over public data. Provided as is, with no warranty of accuracy, completeness or availability. Not investment, financial, legal, tax, medical or any other professional advice, and not a recommendation. Verify before relying on it. Terms: https://api.duoleads.com/terms",
   "request_id": "01K6B7Q4ZC8H3F2M9WXR5TYN0D",
   "computed_at": "2026-09-28T12:00:00.000Z",
   "deterministic": true
  },
  "route": "/v1/geo/polygon",
  "version": "1.0.0"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/duo-data-utilities-geojson-polygon-geometry-7d8793c8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.duoleads.com](https://www.zero.xyz/host/api.duoleads.com/llms.txt)
