Geocoding API
A simple free geocoding API for turning coordinates into human readable locations and locations into coordinates.

Reverse Geocode

$ curl https://geo-info.co/45.6479,-74.3451
{
    "city": "Lachute",
    "community": "Lachute",
    "communityCode": "76020",
    "country": "CA",
    "county": "Laurentides",
    "countyCode": "15",
    "isCity": true,
    "latitude": 45.6501,
    "longitude": -74.3325,
    "nearbyCities": [
        {
            "city": "Chatham",
            "community": "",
            "communityCode": "",
            "country": "CA",
            "county": "",
            "countyCode": "",
            "isCity": true,
            "latitude": 45.6834,
            "longitude": -74.4159,
            "postalCode": "J8G",
            "state": "Quebec",
            "stateCode": "QC"
        },
        {
            "city": "Saint-Colomban",
            "community": "Saint-Colomban",
            "communityCode": "75005",
            "country": "CA",
            "county": "Laurentides",
            "countyCode": "15",
            "isCity": true,
            "latitude": 45.7334,
            "longitude": -74.1325,
            "postalCode": "J5K",
            "state": "Quebec",
            "stateCode": "QC"
        },
        {
            "city": "Mirabel Southwest",
            "community": "",
            "communityCode": "",
            "country": "CA",
            "county": "Mirabel",
            "countyCode": "",
            "isCity": true,
            "latitude": 45.6345,
            "longitude": -74.1005,
            "postalCode": "J7N",
            "state": "Quebec",
            "stateCode": "QC"
        },
        {
            "city": "Hawkesbury",
            "community": "",
            "communityCode": "",
            "country": "CA",
            "county": "",
            "countyCode": "",
            "isCity": true,
            "latitude": 45.6001,
            "longitude": -74.616,
            "postalCode": "K6A",
            "state": "Ontario",
            "stateCode": "ON"
        },
        {
            "city": "Saint-J\u00e9r\u00f4me West",
            "community": "Saint-J\u00e9r\u00f4me",
            "communityCode": "75017",
            "country": "CA",
            "county": "Laurentides",
            "countyCode": "15",
            "isCity": true,
            "latitude": 45.7987,
            "longitude": -74.0727,
            "postalCode": "J5L",
            "state": "Quebec",
            "stateCode": "QC"
        }
    ],
    "nearbyPlaces": [
        {
            "altCountry": "",
            "country": "CA",
            "elevation": "",
            "featureClass": "L",
            "featureCode": "PRK",
            "isPlace": true,
            "latitude": 45.3001,
            "longitude": -75.24931,
            "placeAltNames": "",
            "placeAsciiName": "Parc Alcide-Marcoux",
            "placeName": "Parc Alcide-Marcoux",
            "population": "0",
            "state": "10",
            "timezone": "America/Toronto"
        },
        {
            "altCountry": "",
            "country": "CA",
            "elevation": "",
            "featureClass": "P",
            "featureCode": "PPL",
            "isPlace": true,
            "latitude": 45.3334,
            "longitude": -75.24931,
            "placeAltNames": "",
            "placeAsciiName": "Limoges",
            "placeName": "Limoges",
            "population": "2048",
            "state": "08",
            "timezone": "America/Toronto"
        },
        {
            "altCountry": "",
            "country": "CA",
            "elevation": "",
            "featureClass": "P",
            "featureCode": "PPL",
            "isPlace": true,
            "latitude": 45.35782,
            "longitude": -75.25239,
            "placeAltNames": "",
            "placeAsciiName": "Cambridge Forest Estates",
            "placeName": "Cambridge Forest Estates",
            "population": "0",
            "state": "08",
            "timezone": "America/Toronto"
        },
        {
            "altCountry": "",
            "country": "CA",
            "elevation": "",
            "featureClass": "H",
            "featureCode": "STM",
            "isPlace": true,
            "latitude": 45.4001,
            "longitude": -75.24931,
            "placeAltNames": "",
            "placeAsciiName": "South Indian Creek",
            "placeName": "South Indian Creek",
            "population": "0",
            "state": "08",
            "timezone": "America/Toronto"
        },
        {
            "altCountry": "",
            "country": "CA",
            "elevation": "",
            "featureClass": "L",
            "featureCode": "AREA",
            "isPlace": true,
            "latitude": 45.4168,
            "longitude": -75.24931,
            "placeAltNames": "",
            "placeAsciiName": "Russell",
            "placeName": "Russell",
            "population": "0",
            "state": "08",
            "timezone": "America/Toronto"
        }
    ],
    "postalCode": "J8H",
    "state": "Quebec",
    "stateCode": "QC"
}

About

Have you ever been in the situation where you have latitude and longitude coordinates and need to convert them to a human readable location? How about a situation where you have the name of a location and you need the coordinates? This kind of thing comes up a lot. Having an API that does this for you very quickly and easily can help make this task a bit easier.

Some reasons you might want to use geo-info:

You need a simple API that can do both geocoding and reverse geocoding.
You don't want to jump through hoops to get the information that you need.
You want a simple API that does not over complicate things.
You need information on towns nearby to the locations that you are looking up.
Speed and reliability are two things that you take seriously. You expect the solutions that you use to always be available when you need them and blazing fast.

Using the API

The geo-info API is very easy to use. There are two basic formats for making requests: https://geo-info.co/{latitude},{longitude} and https://geo-info.co/{free search}. The information that is returned is a very neat JSON object with information based on your latitude and longitude input.

Given a latitude and longitude the API will return the closest city/town along with the state, postal code, county, and country that the city is located in. The API will also return a list of cities nearby sorted by distance.

The "free search" query endpoint allows for searching for locations without any predefined format.

The dataset currently used is provided by GeoNames and is available under the Creative Commons 4.0 License.

Python

import requests

resp = requests.get("https://geo-info.co/45.6479,-74.3451")
json = resp.json()
print(json['city'])

NodeJS

const request = require("request");

request.get("https://geo-info.co/Lachute,Quebec,CA", (err, resp, body) => {
    const resp_obj = JSON.parse(body);
    console.log(resp_obj.city);
});

Ruby

require "net/http"
require "json"

resp = Net::HTTP.get(URI("https://geo-info.co/J8H,CA"))
json = JSON.parse(resp)
puts json['city']
Contact Join our Slack Channel