# Polygon Area, Perimeter & Centroid Calculator

> Polygon Area, Perimeter & Centroid Calculator is a paid API for AI agents from geometry.openverbs.com, paid per call via x402, $0.004/call, status unknown (last checked 2026-09-14).

Computes the area (via shoelace formula), perimeter, and centroid of a simple polygon given an ordered list of 2D vertices.

## Facts

- Endpoint: POST https://geometry.openverbs.com/v1/polygon
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/polygon-area-perimeter-centroid-calculator-dbd53281
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Q8gtQ6unRS3DRCcqGnokK

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 polygon-area-perimeter-centroid-calculator-dbd53281 -d '<json body>'
```

Example prompt: Calculate the area, perimeter, and centroid of a polygon with vertices at [0,0], [4,0], [4,3], [0,3] — treating them as a closed ring.

## When to prefer this

Use this endpoint when you need all three core polygon metrics — area, perimeter, and centroid — computed in a single call from an ordered vertex list. Prefer it over manual computation when dealing with arbitrary irregular polygons (not rectangles or triangles, which have sibling endpoints). Ideal when vertices are already in coordinate form and you need a fast, reliable geometric result without setting up a local math library.

## Known failure modes

- Fewer than 3 vertices provided — returns validation error
- Malformed coordinate pairs (not exactly 2 numbers) — schema validation failure
- More than 10,000 vertices submitted — exceeds maxItems limit
- Self-intersecting polygon passed — result may be geometrically incorrect without an error
- Non-numeric coordinate values — type validation error
- Payment not provided or insufficient — 402 Payment Required response

## How this service works

Area (shoelace formula), perimeter and centroid of a simple polygon given its vertices in order. Vertices are treated as a closed ring (last connects to first).

## Output

Returns the computed area of the polygon (using the shoelace formula), its perimeter (sum of all edge lengths), and the coordinates of its centroid (geometric center), given the ordered list of 2D vertex coordinates.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "points": {
       "type": "array",
       "minItems": 3,
       "maxItems": 10000,
       "items": {
        "type": "array",
        "items": {
         "type": "number"
        },
        "minItems": 2,
        "maxItems": 2
       },
       "description": "Vertices as [x, y] pairs, in order."
      }
     },
     "required": [
      "points"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/polygon-area-perimeter-centroid-calculator-dbd53281/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from geometry.openverbs.com](https://www.zero.xyz/host/geometry.openverbs.com/llms.txt)
