Geocoding API logo

Geocoding API

ENDPOINTS
GET/geocode

Geocode City

Convert city names into geographic coordinates (latitude and longitude). Returns an array of matching locations. Narrow results down by providing an optional state and/or country_code.

QUERY PARAMS

The city name you want to geocode.

State/region to disambiguate cities with the same name.

Two-letter ISO country code.

Examples: US, GB, JP

[
  {
    "name": "New York",
    "state": "New York",
    "coordinates": {
      "latitude": 40.7127281,
      "longitude": -74.0060152
    },
    "country_code": "US"
  },
  {
    "name": "New Lenox",
    "state": "Illinois",
    "coordinates": {
      "latitude": 41.5119761,
      "longitude": -87.9656098
    },
    "country_code": "US"
  },
  {
    "name": "New York",
    "state": "England",
    "coordinates": {
      "latitude": 55.0252998,
      "longitude": -1.4869496
    },
    "country_code": "GB"
  },
  {
    "name": "New York",
    "state": "Bo District",
    "coordinates": {
      "latitude": 7.9631123,
      "longitude": -11.7636869
    },
    "country_code": "SL"
  },
  {
    "name": "Oswego",
    "state": "Illinois",
    "coordinates": {
      "latitude": 41.6834778,
      "longitude": -88.3525714
    },
    "country_code": "US"
  }
]