NAV

Introduction

Welcome to the Geloky API! You can use our Geocoding API to geocode or reverse geocode your data. It allows you to convert addresses to latitude and longitude or convert latitude and longitude to addresses in two formats. There are Geloky and Google Maps response formats.

You can view code examples in the dark area to the right.

Authentication

Geloky uses API keys to allow access to the API. It’s easy to get. Just visit your dashboard panel and you will find your API key there. You can easily replace the API key there too.

Geloky expects for the API key to be included in all API requests to the server as a GET parameter.

Geocoding API

Overview

What is geocoding?

Geocoding is the process of converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates (like latitude 37.423021 and longitude -122.083739).

Reverse geocoding is the process of converting geographic coordinates into a human-readable address.

The Geocoding API provides a direct way to access these services via an HTTP request. You can check data accuracy the Geocoding service returns here and here.

Geocoding API requests and responses

GET https://geloky.com/api/geo/geocode?address=350, 5th Avenue, New York, 10018, United States&key=YOUR_API_KEY&format=geloky

The above command returns JSON structured like this:

[
  {
    "address": "350 5th Ave, New York, New York, 10118",
    "latitude": 40.74837686528841,
    "longitude": -73.98485413472395
  }
]

GET https://geloky.com/api/geo/geocode?address=350, 5th Avenue, New York, 10018, United States&key=YOUR_API_KEY&format=google

The above command returns JSON structured like this:

{
  "results": 
  [
    {
      "formatted_address": "350 5th Ave, New York, New York, 10118",
      "geometry": 
      {
        "location": 
        {
          "lat": 40.74837686528841,
          "lng": -73.98485413472395
        }
      }
    }
  ],
  "status": "OK"
  }

A Geocoding API request takes the following form: GET https://geloky.com/api/geo/geocode?parameters

Query Parameters

Parameter Required Default Description
address Yes The street address that you want to geocode. Specify addresses in accordance with the format used by the national postal service of the country concerned. Additional address elements such as business names and unit, suite or floor numbers should be avoided. Street address elements should be delimited by spaces (shown here as url-escaped to %20): address=24%20Sussex%20Drive%20Ottawa%20ON
key Yes Your application's API key. This key identifies your application for purposes of quota management. You can get a key here
format No geloky Structure format of returned data. It can be geloky or google

Reverse geocoding (address lookup) request and response

GET https://geloky.com/api/geo/reverse-geocode?latlng=40.74837686528841,-73.98485413472395&key=YOUR_API_KEY&format=geloky

The above command returns JSON structured like this:

[
  {
    "address": "Empire State Building, 350, 5th Avenue, Koreatown, Manhattan, New York County, New York, 10018, United States",
    "latitude": 40.74837686528841,
    "longitude": -73.98485413472395
  }
]

GET https://geloky.com/api/geo/reverse-geocode?latlng=40.74837686528841,-73.98485413472395&key=YOUR_API_KEY&format=google

The above command returns JSON structured like this:

{
  "results": 
  [
    {
      "formatted_address": "Empire State Building, 350, 5th Avenue, Koreatown, Manhattan, New York County, New York, 10018, United States",
      "geometry": 
      {
        "location": 
        {
          "lat": 40.74837686528841,
          "lng": -73.98485413472395
        }
      }
    }
  ],
  "status": "OK"
}

The term geocoding generally refers to translating a human-readable address into a location on a map. The process of doing the opposite, translating a location on the map into a human-readable address, is known as reverse geocoding

A Reverse Geocoding API request takes the following form: GET https://geloky.com/api/geo/reverse-geocode?parameters

Query Parameters

Parameter Required Default Description
latlng Yes The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address.
key Yes Your application's API key. This key identifies your application for purposes of quota management. You can get a key here
format No geloky Structure format of returned data. It can be geloky or google

Batch Geocoding API requests and responses

GET https://geloky.com/api/geo/geocode-batch?addresses=["350, 5th Avenue, New York, 10018, United States", "Volodymirska, 40A, Kyiv, 01034, Ukraine"]&key=YOUR_API_KEY&format=geloky

The above command returns JSON structured like this:

[
  {
    "address": "350 5th Ave, New York, New York, 10118",
    "latitude": 40.74837686528841,
    "longitude": -73.98485413472395
  },
  {
    "address": "Volodymyrska vulytsia 40A, Shevchenkivskyi raion, Kyiv",
    "latitude": 50.449698631481176,
    "longitude": 30.514730616759174
  }
]

GET https://geloky.com/api/geo/geocode-batch?addresses=["350, 5th Avenue, New York, 10018, United States", "Volodymirska, 40A, Kyiv, 01034, Ukraine"]&key=YOUR_API_KEY&format=google

The above command returns JSON structured like this:

{
  "results": [
    {
      "formatted_address": "350 5th Ave, New York, New York, 10118",
      "geometry": 
      {
        "location": 
        {
          "lat": 40.74837686528841,
          "lng": -73.98485413472395
        }
      }
    },
    {
      "formatted_address": "Volodymyrska vulytsia 40A, Shevchenkivskyi raion, Kyiv",
      "geometry": 
      {
        "location": 
        {
          "lat": 50.449698631481176,
          "lng": 30.514730616759174
        }
      }
    }
  ],
  "status": "OK"
}

Batch Geocoding API is a REST API that allows you to geocode large data sets. You can geocode a lot of addresses at once, as minimum - starting from one address and ending with as many needed.

A Batch Geocoding API request takes the following form: GET https://geloky.com/api/geo/geocode-batch?parameters

Query Parameters

Parameter Required Default Description
addresses Yes An array of street addresses that you want to geocode. Specify addresses in accordance with the format used by the national postal service of the country concerned. Additional address elements such as business names and unit, suite or floor numbers should be avoided. Street address elements should be delimited by spaces. Addresses should be specified in an array and delimited by comma.
key Yes Your application's API key. This key identifies your application for purposes of quota management. You can get a key here.
format No geloky Structure format of returned data. It can be geloky or google

Batch Reverse Geocoding API requests and responses

GET https://geloky.com/api/geo/reverse-geocode-batch?coordinates=["40.748428399999995,-73.98565461987332","50.43347000000006,30.51968000000005"]&key=YOUR_API_KEY&format=geloky

The above command returns JSON structured like this:

[
  {
    "address": "Empire State Building, 350, 5th Avenue, Koreatown, Manhattan, New York County, New York, 10018, United States",
    "latitude": 40.748428399999995,
    "longitude": -73.98565461987332
  },
  {
    "address": "Музей спортивної слави України, Велика Васильківська вулиця 55, Печерський район, Київ",
    "latitude": 50.43347000000006,
    "longitude": 30.51968000000005
  }
]

GET https://geloky.com/api/geo/reverse-geocode-batch?coordinates=["40.748428399999995,-73.98565461987332","50.43347000000006,30.51968000000005"]&key=YOUR_API_KEY&format=google

The above command returns JSON structured like this:

{
  "results": [
    {
      "formatted_address": "Empire State Building, 350, 5th Avenue, Koreatown, Manhattan, New York County, New York, 10018, United States",
      "geometry": 
      {
        "location": 
        {
          "lat": 40.748428399999995,
          "lng": -73.98565461987332
        }
      }
      },
        {
      "formatted_address": "Velyka Vasylkivska street 55, Pechersky district, Kyiv, Ukraine",
      "geometry": 
      {
        "location": 
        {
          "lat": 50.43347000000006,
          "lng": 30.51968000000005
        }
      }
    }
  ],
  "status": "OK"
}

Reverse geocode large data sets in one request. The process of translating a location on the map into a human-readable address, is known as reverse geocoding.

A Batch Reverse Geocoding API request takes the following form: GET https://geloky.com/api/geo/reverse-geocode-batch?parameters

Query Parameters

Parameter Required Default Description
coordinates Yes An array of coordinates (latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address). Latitude and Longitude should be delimited by comma. They should be specified in an array and delimited by comma.
key Yes Your application's API key. This key identifies your application for purposes of quota management. You can get a key here.
format No geloky Structure format of returned data. It can be geloky or google

Distance Matrix/Routing API

Overview

Distance Matrix service computes travel distance and journey duration between multiple origins and destinations using a given mode of travel. This service does not return detailed route information. As simple as it may seem, it’s an extraordinarily powerful tool that finds utility across a spectrum of industries and use cases.

The Distance Matrix/Routing API provides a direct way to access this service via an HTTP request.

Distance Matrix/Routing API requests and responses

GET https://geloky.com/api/geo/distance?origin=52.429892,13.505498&destination=52.522199,13.425576&key=YOUR_API_KEY&format=geloky

The above command returns JSON structured like this:

[
  {
    "origin": "52.429892,13.505498",
    "destination": "52.522199,13.425576",
    "length": 11.097,
    "time": 27.54
  }
]

GET https://geloky.com/api/geo/distance?origin=52.429892,13.505498&destination=52.522199,13.425576&units=km&vehicle=walk&key=YOUR_API_KEY&format=google

{
  "destination": "52.522199,13.425576",
  "origin": "52.429892,13.505498",
  "rows": 
  [
    {
      "elements": {
        "distance": 
        {
          "text": "13.498 km",
          "value": 13.498
        },
        "duration": 
        {
          "text": "161.97 mins",
          "value": 161.97
        },
        "status": "OK"
      }
    }
  ],
  "status": "OK"
}

Distance Matrix/Routing API provides travel distance and time for a matrix of origin and destination.

A Distance Matrix/Routing API request takes the following form: GET https://geloky.com/api/geo/distance?parameters

Query Parameters

Parameter Required Default Description
origin Yes Starting point for calculating travel distance and time. Location in the form of latitude/longitude coordinates or longitude/latitude coordinates
destination Yes One location to use as the final destination for calculating travel distance and time. Location in the form of latitude/longitude coordinates or longitude/latitude coordinates
order No lat_lon You may specify an order of what stands first in origin and destination. lat_lon stands for Latitude/Longitude. lon_lat stands for Longitude/Latitude
priority No fast You may specify a priority of your route. It can be the fastest route or the shortest route.
vehicle No auto For the calculation of distances, you may specify the transportation mode to use. By default, distances are calculated for the driving mode. The following travel modes are supported: auto, walk, truck
units No ml You can specify units for distance. It can be miles or kilometers. Default units are miles. The following units are supported: ml, km
key Yes Your application's API key. This key identifies your application for purposes of quota management. You can get a key here.
format No geloky Structure format of returned data. It can be geloky or google