Forward Geocoding API

Convert addresses, cities, landmarks, and place names into latitude and longitude coordinates. The forward geocoding API returns structured JSON with lat, lon, and display_name for each result.

How Forward Geocoding Works

Forward geocoding takes a text string describing a location and returns geographic coordinates. Pass any address, city name, landmark, or place name as the q parameter. The API resolves the location and returns its latitude and longitude along with a formatted display name.

This is the core operation for any application that needs to map a textual location to a point on Earth. Whether you are building a delivery routing system, a real estate map, or an AI travel agent, forward geocoding translates human-readable locations into machine-usable coordinates.

API Endpoint

MethodGET
Endpoint/api/geocode
Parameterq (required) — the address or location to geocode
Price$0.001 USDC via x402 V2
NetworkBase mainnet (eip155:8453)

Request Example

Send a GET request with the location you want to geocode:

GET /api/geocode?q=1600+Pennsylvania+Ave+NW,+Washington,+DC

Response

The API returns latitude, longitude, and a formatted address:

{
  "lat": 38.8976763,
  "lon": -77.0365298,
  "display_name": "1600 Pennsylvania Ave NW, Washington, DC 20500, USA"
}

After successful payment and geocoding, the response also includes payer and settlement fields confirming the x402 payment was processed.

Pricing

$0.001 USDC per request. No subscription. No API key. Payment is handled automatically via x402 V2 on Base mainnet using USDC.

What Is a Geocoding API?

A geocoding API converts addresses and place names into geographic coordinates. This is essential for mapping applications, location-based services, logistics software, and any system that needs to work with geographic data. Traditional geocoding APIs require API keys and monthly subscriptions. This API uses x402 micropayments instead, so you pay only for the requests you make.

Address to Coordinates API

The address to coordinates API takes a street address, city name, or landmark and returns its latitude and longitude. This is useful for delivery routing, real estate mapping, lead enrichment, and location-aware AI workflows. The response includes precise coordinates that can be used with mapping libraries and geographic databases.

Use Cases

Forward geocoding is used in delivery and logistics software to convert customer addresses into map coordinates for routing. Real estate applications use it to display property locations on maps. AI agents use it to translate natural-language location references into structured coordinate data. CRM and lead enrichment tools use it to add geographic data to address records.


Related