# 24K Labs Geocoding API

> 24K Labs Geocoding API is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-15).

Converts a place name into latitude, longitude, country, and population using Open-Meteo geocoding.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/geocode
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/24k-labs-geocoding-api-5f698ab7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mrJeDPG_ALNQOss1f7lhA

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 24k-labs-geocoding-api-5f698ab7 -d '<json body>'
```

Example prompt: What are the latitude, longitude, country, and population for Tokyo? I need the full geocoding details.

## When to prefer this

Use this endpoint when you need a quick, low-cost geocode lookup (name → coordinates + metadata) and you don't need reverse geocoding (coordinates → name). It's ideal for pipelines that need to feed lat/lng into weather or mapping APIs, or when you need population data alongside coordinates. Backed by Open-Meteo's geocoding data, which covers cities and towns globally.

## Known failure modes

- Ambiguous place names (e.g. 'Springfield') may resolve to an unexpected location
- Misspelled or unrecognized place names return no result or an error
- Very small settlements or obscure locations may not be in the dataset
- API returns an error if required place name field is missing from the request body

## How this service works

Turn a place name into latitude/longitude, country, and population (Open-Meteo geocoding).

## Output

Returns the latitude, longitude, country name, and population for the resolved place, as returned by Open-Meteo's geocoding service.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "q": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "lat": 35.68,
  "lon": 139.69
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/24k-labs-geocoding-api-5f698ab7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
