# Grid Distance Calculator

> Grid Distance Calculator is a paid API for AI agents from market.datapackvibe.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-30).

Calculates Manhattan, diagonal (Chebyshev), and Euclidean distances between two points on a 2D grid given their coordinates.

## Facts

- Endpoint: POST https://market.datapackvibe.com/x402/grid-distance-calculator?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/grid-distance-calculator-b5e1bfc0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XDowWtG-PO8buYBGjis-3

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 grid-distance-calculator-b5e1bfc0 -d '<json body>'
```

Example prompt: What are the Manhattan, diagonal, and Euclidean distances between grid point (1, 2) and grid point (8, 10)?

## When to prefer this

Choose this endpoint when you need all three common grid distance metrics (Manhattan, Euclidean, and Chebyshev/diagonal) computed in a single call, especially in game development, tile-map pathfinding, or board-game AI contexts where comparing movement costs across different movement rules is essential.

## Known failure modes

- Missing required coordinates — returns error if x1, x2, y1, or y2 are absent
- Non-numeric coordinate values cause validation failure
- Payment not received or insufficient USDC results in 402 rejection

## How this service works

Grid distance calculator: Calculate Manhattan, diagonal, and Euclidean distance on a grid.

## Output

Returns three numeric distance values for the two input grid coordinates: Manhattan distance (sum of absolute differences of coordinates), Euclidean distance (straight-line distance), and diagonal/Chebyshev distance (max of absolute differences), useful for game logic, pathfinding, and spatial reasoning.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "x1": {
   "type": "number",
   "default": 1
  },
  "x2": {
   "type": "number",
   "default": 8
  },
  "y1": {
   "type": "number",
   "default": 2
  },
  "y2": {
   "type": "number",
   "default": 10
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/grid-distance-calculator-b5e1bfc0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from market.datapackvibe.com](https://www.zero.xyz/host/market.datapackvibe.com/llms.txt)
