# Map Tile Maths – Zoom for Extent

> Map Tile Maths – Zoom for Extent is a paid API for AI agents from map-tiles.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Calculates the highest slippy-map zoom level at which a lat/lon bounding box fits inside a given pixel viewport, returning the optimal zoom, map centre, and tile span.

## Facts

- Endpoint: GET https://map-tiles.x402tookit.com/zoom-for-extent?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/map-tile-maths-zoom-for-extent-f87dd0fe
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_E89X6pMm7pAYvRMaaKi4E

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 map-tile-maths-zoom-for-extent-f87dd0fe
```

Example prompt: What's the highest zoom level that fits the bounding box west=-0.35, south=51.38, east=0.15, north=51.70 into a 1024×768 pixel map viewport? Also tell me the center coordinates and how many tiles wide and high it will be.

## When to prefer this

Use this endpoint when you need to programmatically determine the correct slippy-map zoom level to fit a geographic bounding box into a specific pixel viewport — for example when generating map thumbnails, configuring map widgets, planning tile downloads, or preparing map embed parameters. It is the canonical choice over manual zoom estimation when you need the exact highest valid zoom, the map centre, and tile span in one call.

## Known failure modes

- Missing required bounding box parameters (west/south/east/north) returns a 4xx error
- Bounding box crossing the antimeridian may produce unexpected results
- Invalid coordinate ranges (e.g. north < south) may return an error or nonsensical zoom
- Viewport dimensions of zero or negative values may cause computation errors
- Payment failure or missing x402 payment header returns a 402 Payment Required response

## How this service works

Highest map zoom level at which a lat/lon bounding box fits a viewport of given pixel size, with centre and tile span.

## Output

Returns an integer zoom level (and fractional zoom), the centre latitude and longitude, the number of tiles wide and high needed, total tile count, which axis was the limiting constraint, whether the result was clamped to the maximum zoom of 24, and a human-readable summary string. Includes optional degraded/disclaimer flags.

## 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": [
      "west",
      "south",
      "east",
      "north"
     ],
     "properties": {
      "east": {
       "type": "number",
       "description": "East longitude"
      },
      "west": {
       "type": "number",
       "description": "West longitude"
      },
      "north": {
       "type": "number",
       "description": "North latitude"
      },
      "south": {
       "type": "number",
       "description": "South latitude"
      },
      "paddingPx": {
       "type": "integer",
       "description": "Padding on every side in pixels (default 0)"
      },
      "viewportWidth": {
       "type": "integer",
       "description": "Map viewport width in pixels (default 800)"
      },
      "viewportHeight": {
       "type": "integer",
       "description": "Map viewport height in pixels (default 600)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "zoom": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "limitedBy": {
       "type": [
        "null",
        "string"
       ]
      },
      "tileCount": {
       "type": [
        "null",
        "number"
       ]
      },
      "tilesHigh": {
       "type": [
        "null",
        "number"
       ]
      },
      "tilesWide": {
       "type": [
        "null",
        "number
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/map-tile-maths-zoom-for-extent-f87dd0fe/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from map-tiles.x402tookit.com](https://www.zero.xyz/host/map-tiles.x402tookit.com/llms.txt)
