# geo-point-in-polygon

> geo-point-in-polygon is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-16).

Determines whether a geographic coordinate (lat/lon) lies inside or outside a given polygon using ray-casting with planar approximation.

## Facts

- Endpoint: GET https://x402.agentindex.world/geo/point-in-polygon?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/geo-point-in-polygon-707c6963
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rJHH-wYoZ_12Zs0dcV-eM

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 geo-point-in-polygon-707c6963
```

Example prompt: Is the point at latitude 40.7128, longitude -74.0060 inside the polygon defined by these corners: (40.70, -74.02), (40.70, -73.99), (40.73, -73.99), (40.73, -74.02)?

## When to prefer this

Use this endpoint when you need a lightweight, pay-per-call geospatial containment test without maintaining a geospatial database or library. Ideal for city- or region-scale polygons where planar approximation is acceptable. Best suited for serverless agent workflows needing on-demand geofencing without API key management.

## Known failure modes

- Polygon has fewer than 3 vertices — minItems:3 constraint violation
- Invalid latitude (outside -90 to 90) or longitude (outside -180 to 180)
- Planar approximation may produce inaccurate results for very large or pole-spanning polygons
- Malformed JSON payload for point or polygon objects
- Missing required lat/lon fields in point or polygon vertices

## How this service works

Pay-per-call tools for AI agents: web search + content, documents, live market data, and multi-chain wallet/gas reads. Mainnet test from $0.000001 USDC on Base. Pay-per-call tools for AI agents in USDC on Base (x402/MPP): search, pdf, web-read, extract, summarize, fact-check, translate, jobs, discover. See GET /capabilities.

## Output

A boolean result indicating whether the provided geographic point (lat/lon) is inside or outside the specified polygon, computed via ray-casting with planar approximation suitable for city- or region-scale polygons.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "point": {
   "type": "object",
   "title": "LatLon",
   "required": [
    "lat",
    "lon"
   ],
   "properties": {
    "lat": {
     "type": "number",
     "title": "Lat",
     "maximum": 90,
     "minimum": -90
    },
    "lon": {
     "type": "number",
     "title": "Lon",
     "maximum": 180,
     "minimum": -180
    }
   }
  },
  "polygon": {
   "type": "array",
   "items": {
    "type": "object",
    "title": "LatLon",
    "required": [
     "lat",
     "lon"
    ],
    "properties": {
     "lat": {
      "type": "number",
      "title": "Lat",
      "maximum": 90,
      "minimum": -90
     },
     "lon": {
      "type": "number",
      "title": "Lon",
      "maximum": 180,
      "minimum": -180
     }
    }
   },
   "title": "Polygon",
   "minItems": 3
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "inside": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/geo-point-in-polygon-707c6963/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentindex.world](https://www.zero.xyz/host/x402.agentindex.world/llms.txt)
