Geocoding API logo
DataMAINTAINED2 tokens / call

Geocoding API

Place names to coordinates and back for 235,640 cities and towns worldwide, no third-party calls

City and place-level forward and reverse geocoding for 235,640 populated places worldwide, self-hosted from GeoNames and refreshed daily: turn a place name into coordinates (population-ranked, with exact, prefix and alternate-name matching for local and historical names like Firenze or Bombay) or coordinates into the nearest places with distances. Every result carries the GeoNames id, region, population, timezone and place type (capital, admin seat, neighbourhood). No third-party calls at request time.

Every call needs an X-Api-Key header. A free key includes 500 tokens a month, no card required. 2 tokens per call, so the free plan covers about 250 calls a month.

No credit card requiredAccess to 125+ APIsCancel anytime
response.json
{
  "query": "GET /v1/geocode?q=Paris&limit=5",
  "results": [
    {
      "name": "Paris",
      "country": "FR",
      "admin1": "Île-de-France",
      "latitude": 48.85341,
      "longitude": 2.3488,
      "population": 2138551
    },
    {
      "name": "Paris",
      "country": "US",
      "admin1": "Texas",
      "latitude": 33.66094,
      "longitude": -95.55551,
      "population": 24782
    }
  ],
  "coverage": "235,640 places worldwide, daily-synced GeoNames"
}
Production Ready
Battle-tested infrastructure with a 99.9% uptime SLA. Rate limits are generous, responses are consistent.
Simple Integration
Standard REST + JSON. Works with any HTTP client. Copy-ready code snippets in 4 languages.
One Key, 125+ APIs
Your DataAndAPIs subscription unlocks every API on the platform — anime, finance, sports, and more.

Use cases for Geocoding API

  • Turn a typed city name into coordinates to centre a map, run a radius search or fetch the weather.

  • Label a GPS position with the nearest town, region and country in a photo, fitness or fleet app.

  • Resolve local and historical names such as Firenze or Bombay to the canonical place.

  • Attach the GeoNames id, timezone and population to a location record for downstream joins.

Geocoding API endpoints

Every endpoint with its parameters and a real example response.

GETData Sources

https://api-geocoding.dataandapis.com/v1/sources

This endpoint takes no parameters.

Example request

curl "https://api-geocoding.dataandapis.com/v1/sources" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "ok": true,
  "sources": [
    {
      "slug": "geonames-cities500",
      "name": "GeoNames cities500",
      "url": "https://download.geonames.org/export/dump/cities500.zip",
      "license": "CC BY 4.0",
      "cadence": "daily modifications sync (shared geography database)",
      "places": 235640,
      "last_update": "2026-09-02 21:41:55"
    }
  ]
}

GETForward Geocode

https://api-geocoding.dataandapis.com/v1/geocode

Query parameters

ParameterExample
countryOptional
limit5Optional
qParisRequired

Example request

curl "https://api-geocoding.dataandapis.com/v1/geocode?limit=5&q=Paris" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "ok": true,
  "query": "Paris",
  "count": 5,
  "results": [
    {
      "id": 2988507,
      "name": "Paris",
      "ascii_name": "Paris",
      "latitude": 48.85341,
      "longitude": 2.3488,
      "country": "FR",
      "admin1": "Île-de-France",
      "admin1_code": "11",
      "population": 2138551,
      "timezone": "Europe/Paris",
      "feature_code": "PPLC",
      "place_type": "national capital",
      "is_capital": true,
      "matched_by": "exact"
    },
    {
      "id": 4717560,
      "name": "Paris",
      "ascii_name": "Paris",
      "latitude": 33.66094,
      "longitude": -95.55551,
      "country": "US",
…
Show full response
{
  "ok": true,
  "query": "Paris",
  "count": 5,
  "results": [
    {
      "id": 2988507,
      "name": "Paris",
      "ascii_name": "Paris",
      "latitude": 48.85341,
      "longitude": 2.3488,
      "country": "FR",
      "admin1": "Île-de-France",
      "admin1_code": "11",
      "population": 2138551,
      "timezone": "Europe/Paris",
      "feature_code": "PPLC",
      "place_type": "national capital",
      "is_capital": true,
      "matched_by": "exact"
    },
    {
      "id": 4717560,
      "name": "Paris",
      "ascii_name": "Paris",
      "latitude": 33.66094,
      "longitude": -95.55551,
      "country": "US",
      "admin1": "Texas",
      "admin1_code": "TX",
      "population": 24782,
      "timezone": "America/Chicago",
      "feature_code": "PPLA2",
      "place_type": "second-order admin seat",
      "is_capital": false,
      "matched_by": "exact"
    },
    {
      "id": 6942553,
      "name": "Paris",
      "ascii_name": "Paris",
      "latitude": 43.2,
      "longitude": -80.38333,
      "country": "CA",
      "admin1": "Ontario",
      "admin1_code": "08",
      "population": 12310,
      "timezone": "America/Toronto",
      "feature_code": "PPL",
      "place_type": "populated place",
      "is_capital": false,
      "matched_by": "exact"
    }
  ],
  "source": "GeoNames cities500 (CC BY 4.0)",
  "source_url": "https://www.geonames.org/",
  "scope": "city/place-level geocoding (populated places with population >= 500)"
}

GETPlace Detail

https://api-geocoding.dataandapis.com/v1/place/{id}

Path parameters

ParameterExample
id2988507Required

Example request

curl "https://api-geocoding.dataandapis.com/v1/place/2988507" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "ok": true,
  "id": 2988507,
  "name": "Paris",
  "ascii_name": "Paris",
  "latitude": 48.85341,
  "longitude": 2.3488,
  "country": "FR",
  "admin1": "Île-de-France",
  "admin1_code": "11",
  "population": 2138551,
  "timezone": "Europe/Paris",
  "feature_code": "PPLC",
  "place_type": "national capital",
  "is_capital": true,
  "elevation_m": 42,
  "alternate_names": [
    "Baariis",
    "Bahliz",
    "Baris",
    "Bariz",
    "Lungsod ng Paris",
    "Lutece",
    "Lutetia",
    "Lutetia Parisorum",
    "Lutèce",
    "PAR",
    "Pa-ri",
…
Show full response
{
  "ok": true,
  "id": 2988507,
  "name": "Paris",
  "ascii_name": "Paris",
  "latitude": 48.85341,
  "longitude": 2.3488,
  "country": "FR",
  "admin1": "Île-de-France",
  "admin1_code": "11",
  "population": 2138551,
  "timezone": "Europe/Paris",
  "feature_code": "PPLC",
  "place_type": "national capital",
  "is_capital": true,
  "elevation_m": 42,
  "alternate_names": [
    "Baariis",
    "Bahliz",
    "Baris",
    "Bariz",
    "Lungsod ng Paris",
    "Lutece",
    "Lutetia",
    "Lutetia Parisorum",
    "Lutèce",
    "PAR",
    "Pa-ri",
    "Paarys",
    "Palika",
    "Paname",
    "Pantruche",
    "Paraeis",
    "Paras",
    "Pari",
    "Paries",
    "Parigge",
    "Pariggi",
    "Parighji",
    "Parigi",
    "Pariis",
    "Pariisi"
  ],
  "source": "GeoNames cities500 (CC BY 4.0)",
  "source_url": "https://www.geonames.org/",
  "scope": "city/place-level geocoding (populated places with population >= 500)"
}

GETReverse Geocode

https://api-geocoding.dataandapis.com/v1/reverse

Query parameters

ParameterExample
lat40.71Required
limit3Optional
lon-74.0Required
min_population0Optional

Example request

curl "https://api-geocoding.dataandapis.com/v1/reverse?lat=40.71&limit=3&lon=-74.0&min_population=0" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "ok": true,
  "latitude": 40.71,
  "longitude": -74,
  "search_radius_deg": 0.25,
  "count": 3,
  "results": [
    {
      "id": 5128581,
      "name": "New York City",
      "ascii_name": "New York City",
      "latitude": 40.71427,
      "longitude": -74.00597,
      "country": "US",
      "admin1": "New York",
      "admin1_code": "NY",
      "population": 8804190,
      "timezone": "America/New_York",
      "feature_code": "PPL",
      "place_type": "populated place",
      "is_capital": false,
      "distance_km": 0.7
    },
    {
      "id": 8436473,
      "name": "Financial District",
      "ascii_name": "Financial District",
      "latitude": 40.70789,
…
Show full response
{
  "ok": true,
  "latitude": 40.71,
  "longitude": -74,
  "search_radius_deg": 0.25,
  "count": 3,
  "results": [
    {
      "id": 5128581,
      "name": "New York City",
      "ascii_name": "New York City",
      "latitude": 40.71427,
      "longitude": -74.00597,
      "country": "US",
      "admin1": "New York",
      "admin1_code": "NY",
      "population": 8804190,
      "timezone": "America/New_York",
      "feature_code": "PPL",
      "place_type": "populated place",
      "is_capital": false,
      "distance_km": 0.7
    },
    {
      "id": 8436473,
      "name": "Financial District",
      "ascii_name": "Financial District",
      "latitude": 40.70789,
      "longitude": -74.00857,
      "country": "US",
      "admin1": "New York",
      "admin1_code": "NY",
      "population": 60976,
      "timezone": "America/New_York",
      "feature_code": "PPLX",
      "place_type": "section of populated place",
      "is_capital": false,
      "distance_km": 0.8
    },
    {
      "id": 5112540,
      "name": "Chinatown",
      "ascii_name": "Chinatown",
      "latitude": 40.71649,
      "longitude": -73.99625,
      "country": "US",
      "admin1": "New York",
      "admin1_code": "NY",
      "population": 90000,
      "timezone": "America/New_York",
      "feature_code": "PPLX",
      "place_type": "section of populated place",
      "is_capital": false,
      "distance_km": 0.8
    }
  ],
  "source": "GeoNames cities500 (CC BY 4.0)",
  "source_url": "https://www.geonames.org/",
  "scope": "city/place-level geocoding (populated places with population >= 500)"
}

Where the data comes from

Source
GeoNames cities500 dataset (CC BY 4.0), served from the shared geography database.
Freshness
Daily sync of GeoNames modifications.

One install. Every endpoint.

No proprietary SDKs needed. Any HTTP client works. Pick your language and paste.

3languages
4endpoints
RESTarchitecture
1key for all APIs
  • Fully typed responses — auto-completion in your IDE
  • Tracks the API in lockstep — new endpoints land same day
  • One key works across 125+ APIs on the platform
import axios from 'axios';

const { data } = await axios.get(
  'https://api-geocoding.dataandapis.com/v1/sources',
  { headers: { 'X-Api-Key': process.env.API_KEY } }
);

Geocoding API · X-Api-Key

Explore the endpoints

Browse request parameters and inspect live example responses.

Available Endpoints

Request Parameters

API URL

Headers

X-Api-Key
import axios from 'axios';

const url = 'https://api-geocoding.dataandapis.com/v1/sources';
const { data } = await axios.get(url, {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' }
});

One subscription. Every API.

Tokens unlock this API and 125+ others on DataAndAPIs. Switch APIs any time — we promote.

FREE

$0/mo

500 tokens / month

  • Access to all APIs
  • Tokens reset monthly
  • Community support
Start free
Most Popular

STARTER

$6.99/mo

25,000 tokens / month

  • Access to all APIs
  • Tokens reset monthly
  • Email support
Subscribe

PRO

$24.99/mo

100,000 tokens / month

  • Access to all APIs
  • Tokens reset monthly
  • Priority email support
Subscribe

ULTRA

$99.99/mo

1,000,000 tokens / month

  • Access to all APIs
  • Tokens reset monthly
  • Priority support
Subscribe

Need higher volume, dedicated infra, or a custom contract? Talk to sales →

Questions about Geocoding API

Ship Geocoding API this afternoon.

500 free tokens. No card. Plus 125+ other APIs on the same key.