FREE Webinar: Should I use React or Vue?

Accurate Forward & Reverse Batch Geocoding REST API Geocoding is the ability to provide geographical coordinates based on a known address. This is also known as forward-geocoding.

Reverse-geocoding is the ability to input geographial coordinates and get an address back from those coordinates.

Doing this is incredibly difficult as there involves a lot of satellite data, human intervention etc in order to get accurate data to build the next Uber or Airbnb.

Thankfully, that’s just what positionstack has done. Positionstack is a geocoding company brought to you by apilayer. They have indexed over 2 billion locations and currently process over 1 billion requests per day.

Using aviationstack

It’s free to get started, and you can head over to their website and get your API key.

Sending a request to

https://api.positionstack.com/v1/forward
    ? access_key = YOUR_ACCESS_KEY
    & query = 565 5 Ave, Manhattan, New York, NY, USA

Returns this information

{
    "data": [
        {
            "latitude": 40.755884,
            "longitude": -73.978504,
            "name": "565 5 Ave",
            "type": "address",
            "number": "565",
            "street": "5 Ave",
            "postal_code": "10017",
            "confidence": 1,
            "region": "New York",
            "region_code": "NY",
            "administrative_area": null,
            "neighbourhood": "Midtown East",
            "country": "United States",
            "country_code": "USA",
            "label": "565 5 Ave, Manhattan, New York, NY, USA",
            "map_url": "https://map.positionstack.com/export/embed.html?bbox=-73.978004,40.756384,-73.979004,40.755384&layer=mapnik&marker=40.755884,-73.978504",
            "country_module": {
                "latitude": "39.44325637817383",
                "longitude": "-98.95733642578125",
                "common_name": "United States",
                "official_name": "United States of America",
                "capital": "Washington D.C.",
                "flag": "🇺🇸",
                "area": 9372610,
                "landlocked": false,
                "independent": true,
                "global": {
                    "alpha2": "US",
                    "alpha3": "USA",
                    "numeric_code": "840",
                    "region": "Americas",
                    "subregion": "Northern America",
                    "region_code": "019",
                    "subregion_code": "021",
                    "world_region": "AMER",
                    "continent_name": "North America",
                    "continent_code": "NA"
                },
                "dial": {
                    "calling_code": "1",
                    "national_prefix": "1",
                    "international_prefix": "011"
                },
                "currencies": [
                    {
                        "symbol": "$",
                        "code": "USD",
                        "name": "US Dollar",
                        "numeric": 840,
                        "minor_unit": 2
                    }
                ],
                "languages": {
                    "eng": "English"
                }
            },
            "sun_module": {
                "rise": {
                    "time": 1575633924,
                    "astronomical": 1575628051,
                    "civil": 1575632092,
                    "nautical": 1575630040
                },
                "set": {
                    "time": 1575667704,
                    "astronomical": 1575673576,
                    "civil": 1575669535,
                    "nautical": 1575671587
                },
                "transit": 1575650814
            },
            "timezone_module": {
                "name": "America/New_York",
                "offset_sec": -18000,
                "offset_string": "-05:00"
            }
        ]
    }
}

As you can see from the data returned above, this tells us that the supplied address in one in the United States, it gives us its longitude and latitude, information about the location etc. You can tell there’s a wealth of information available there.

positionstack has done this for over 2 billion locations.

Embeddable maps

From the data above, you can also see a field titled map_url which lets you embed a map of the location on your website or app. In this case, the map looks like this.

This content is sponsored via Syndicate Ads.