# Geocode Batch API (OpenStreetMap Nominatim)

> Geocode Batch API (OpenStreetMap Nominatim) is a paid API for AI agents from freetier-agent-api.pages.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-20).

Geocodes up to 5 addresses or place names in a single call to coordinates and structured addresses, with optional country filter, using cached OpenStreetMap Nominatim data.

## Facts

- Endpoint: GET https://freetier-agent-api.pages.dev/api/geocode-batch?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/geocode-batch-api-openstreetmap-nominatim-731c0148
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_eza0VZ0deTGFv5TDvzqEU

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 geocode-batch-api-openstreetmap-nominatim-731c0148
```

Example prompt: Can you geocode these three locations for me: '10 Downing Street, London', 'Eiffel Tower, Paris', and 'Colosseum, Rome'? Limit results to European countries if possible.

## When to prefer this

Choose this endpoint when you need to geocode a small batch (1–5) of addresses or place names quickly and cheaply without setting up a full geocoding account. It is especially useful for agents doing lightweight enrichment, mapping, or validation where OSM Nominatim coverage is acceptable and ODbL attribution is compatible. For single-address lookups it still works fine, but for more than 5 addresses you will need to make multiple calls.

## Known failure modes

- More than 5 addresses submitted — API only accepts up to 5 per call
- Place name not recognized by Nominatim — result entry may have null coordinates
- Invalid ISO-2 country code filter — may return no results or ignore the filter
- Network or cache errors — may return HTTP 5xx
- Ambiguous place names without country filter may return unexpected matches

## How this service works

Geocode batch: up to 5 addresses or place names (separated by |) to coordinates and a structured address in one call, optional country filter. OpenStreetMap Nominatim, cached, ODbL attribution.

## Output

Returns a JSON object with a count and found fields, plus a results array where each entry echoes the original query string and includes the matched latitude, longitude, and a full display_name structured address string. Unmatched queries may return null results.

## 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": [
      "q"
     ],
     "properties": {
      "q": {
       "type": "string",
       "description": "addresses separated by |, max 5"
      },
      "country": {
       "type": "string",
       "description": "optional ISO-2 country filter"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 2,
  "found": 2,
  "results": [
   {
    "q": "Eiffel Tower, Paris",
    "result": {
     "lat": 48.8582,
     "lon": 2.2945,
     "display_name": "Tour Eiffel, ..."
    }
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/geocode-batch-api-openstreetmap-nominatim-731c0148/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from freetier-agent-api.pages.dev](https://www.zero.xyz/host/freetier-agent-api.pages.dev/llms.txt)
