# agent402.tools Geocode

> agent402.tools Geocode is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-13).

Resolves a free-form address or place name to geographic coordinates (lat/lon), bounding box, display name, and place type using OpenStreetMap/Nominatim — no API key required.

## Facts

- Endpoint: GET https://agent402.tools/api/geocode
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-geocode-7f57ebf5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mtdsl4ixOeUrQF87idsoO

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 agent402-tools-geocode-7f57ebf5
```

Example prompt: What are the latitude and longitude coordinates for 1600 Pennsylvania Ave, Washington DC? Just return the top result.

## When to prefer this

Choose this endpoint when you need to convert a free-form address or place name to geographic coordinates without managing your own API key or quota. It is especially suitable for one-off geocoding needs in agentic workflows, when you want OpenStreetMap-backed results at low cost per call, and when you need bounding box or place type metadata alongside the coordinates.

## Known failure modes

- Address not found — returns empty array if Nominatim cannot match the query
- Ambiguous place name returns unexpected location — mitigated by setting countryCodes filter
- Payment failure — x402 payment of $0.003 USDC not processed, request rejected
- Rate limiting or Nominatim upstream unavailability causes timeout or 5xx error
- Invalid query parameter (missing q) returns validation error

## How this service works

Resolve a free-form address or place name to coordinates: lat/lon, display name, bounding box, place type. OpenStreetMap/Nominatim, no key. ?q=1600+Pennsylvania+Ave+Washington+DC&limit=1.

## Output

Returns structured geocoding data including latitude, longitude, a human-readable display name, a bounding box (min/max lat/lon), and place type classification (e.g. building, city, road) based on OpenStreetMap data.

## 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": "Free-form address or place name"
      },
      "limit": {
       "type": "number",
       "description": "Results to return, 1-10 (default 1)"
      },
      "countryCodes": {
       "type": "string",
       "description": "Comma-separated ISO-3166-1 alpha-2 codes to restrict, e.g. us,ca (optional)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "query",
      "count",
      "results",
      "source"
     ],
     "properties": {
      "count": {
       "type": "integer"
      },
      "query": {
       "type": "string"
      },
      "source": {
       "type": "string"
      },
      "results": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "lat": {
          "type": "number"
         },
         "lon": {
          "type": "number"
         },
         "osm": {
          "type": "string"
         },
         "type": {
          "type": "string"
         },
         "class": {
          "type": "string"
         },
         "importance": {
          "type": "number"
         },
         "boundingBox": {
          "type": "object"
         },
         "displayName": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 1,
  "query": "1600 Pennsylvania Ave NW, Washington, DC",
  "source": "nominatim.openstreetmap.org (ODbL)",
  "results": [
   {
    "lat": 38.8976633,
    "lon": -77.0365739,
    "osm": "way/238241022",
    "type": "attraction",
    "class": "tourism",
    "importance": 0.78,
    "boundingBox": {
     "east": -77.0362519,
     "west": -77.0368537,
     "north": 38.897829,
     "south": 38.8974908
    },
    "displayName": "White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Columbia, 20500, United States"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-geocode-7f57ebf5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
