LocateOne DocsBrowse docs →

Geocode address

The Geocoding API converts an address into geographic reference positions for mapping. It provides the confidence radius of the result for accuracy.

POSThttps://api.getos1.com/locateone/v1/geocode
Headers
x-api-keystringrequired
This key is used for authentication and billing.
Content-typestringrequired

application/json

Body
bodyobjectrequired
Request body. Contains the address details.
dataobjectrequired
addressstringrequired
The street address which you want to geocode.
pincodestringoptional
Pincode associated with the provided address.
citystringoptional
City associated with the provided address.
statestringoptional
State associated with the provided address.
Request example
curl --request POST \
     --url https://api.getos1.com/locateone/v1/geocode \
     --header 'accept: application/json' \
     --header 'content-type: string' \
     --header 'x-api-key: string' \
     --data '{
     "data": {
     "address": ""
     }
     }'
Responses
200400401403429500
200Output of geocoding prediction API.
successbooleanoptional
True value indicates that the address was succesfully parsed and the geographical coordinates have been returned without any error. A false value would suggst an error in processing the request. The details for the possible reson for any error will be provided via the message key.
Example: true
status_codenumberoptional
Status codes indicate whether a specific API request has been successfully completed. And these codes will also help you track down the reason in case of failure.
Example: 200
messagestringoptional
This field will provide the information regarding the request processed by the geocoding API. This may help you get an idea about the success or a possible reason for failure.
Example: Request has been processed
request_idstringoptional
A unique id to distinguish between requests.
Example: AX34687667877689
resultobjectoptional
Contains the geocoding result with the geographical coordinates value and its accuracy via confidence_radius for a given unstructured address.
geocodeobjectoptional
Contains the geographical coordinates value for the given address, which includes
latnumberoptional
latitude part of the geographical coordinates.
Example: 28.454736
lngnumberoptional
longitude part of the geographical coordinates.
Example: 77.070171
confidence_radiusnumberoptional
It is a measure of horizontal accuracy that indicates the actual address will be within the radius of x meters around the predicted geocode.
Example: 24
400
successbooleanoptional
True value indicates that the address was succesfully parsed and the geographical coordinates have been returned without any error. A false value would suggst an error in processing the request. The details for the possible reson for any error will be provided via the message key.
Example: false
status_codenumberoptional
Status codes indicate whether a specific API request has been successfully completed. And these codes will also help you track down the reason in case of failure.
Example: 400
messagestringoptional
This field will provide the information regarding the request processed by the geocoding API. This may help you get an idea about the success or a possible reason for failure.
Example: Invalid query parameters provided in input. Caused due to either missing keys or invalid data type for a key.
request_idstringoptional
A unique id to distinguish between requests
Example: AX34687667877689
resultobjectoptional
Contains the geocoding result with the geographical coordinates value and its accuracy via confidence_radius for a given unstructured address.
401Unauthorized
successbooleanoptional
True value indicates that the address was succesfully parsed and the geographical coordinates have been returned without any error. A false value would suggst an error in processing the request. The details for the possible reson for any error will be provided via the message key.
Example: false
status_codenumberoptional
Status codes indicate whether a specific API request has been successfully completed. And these codes will also help you track down the reason in case of failure.
Example: 401
messagestringoptional
This field will provide the information regarding the request processed by the geocoding API. This may help you get an idea about the success or a possible reason for failure.
Example: Authentication token is invalid.
request_idstringoptional
A unique id to distinguish between requests
Example: AX34687667877689
resultobjectoptional
Contains the geocoding result with the geographical coordinates value and its accuracy via confidence_radius for a given unstructured address.
403Forbidden
successbooleanoptional
True value indicates that the address was succesfully parsed and the geographical coordinates have been returned without any error. A false value would suggst an error in processing the request. The details for the possible reson for any error will be provided via the message key.
Example: false
status_codenumberoptional
Status codes indicate whether a specific API request has been successfully completed. And these codes will also help you track down the reason in case of failure.
Example: 403
messagestringoptional
This field will provide the information regarding the request processed by the geocoding API. This may help you get an idea about the success or a possible reason for failure.
Example: Authentication token is forbidden to access the API.
request_idstringoptional
A unique id to distinguish between requests.
Example: AX34687667877689
resultobjectoptional
Contains the geocoding result with the geographical coordinates value and its accuracy via confidence_radius for a given unstructured address.
429Too many requests
messagestringoptional
This field will provide the information regarding the request processed by the geocoding API. This may help you get an idea about the success or a possible reason for failure.
Example: Too many requests.
500Error message due to internal issue while processing payload or server level issues.
successbooleanoptional
True value indicates that the address was succesfully parsed and the geographical coordinates have been returned without any error. A false value would suggst an error in processing the request. The details for the possible reson for any error will be provided via the message key.
Example: false
status_codenumberoptional
Status codes indicate whether a specific API request has been successfully completed. And these codes will also help you track down the reason in case of failure.
Example: 500
messagestringoptional
This field will provide the information regarding the request processed by the geocoding API. This may help you get an idea about the success or a possible reason for failure.
Example: Error occured: request data: <payload> with error_details: <error_details>.
request_idstringoptional
The `request_id` will be blank.
resultobjectoptional
Contains the geocoding result with the geographical coordinates value and its accuracy via confidence_radius for a given unstructured address.
Response samples
// Output of geocoding prediction API.
{
  "success": true,
  "status_code": 200,
  "message": "Request has been processed",
  "request_id": "AX34687667877689",
  "result": {
    "geocode": {
      "lat": 28.454736,
      "lng": 77.070171
    },
    "confidence_radius": 24
  }
}