Locate Service: Locate Geocode API
This api service allows you to get the coordinates based on the name of a place.
Request Body: JSON
{
"service": "locate-geocode",
"payload": {
"search_term": "1600 Amphitheatre Parkway, California"
}
}
Request Body Definition
- service - This defines the service that we want to use
- payload - Information needed in order for the service to process the request
- payload.search_term - This is the search term for the place you want to get the coordinates of.
Sample Response
If your request is successful, you will receive the following response where you get the result and the credits you have left after making the request, with a status code of 200.
{
"result": {
"longitude": -121.4639893,
"latitude": 38.5009429,
"search_term": "1600 Amphitheatre Parkway, California"
},
"remaining_credits": 809
}
If your request is not successful, you will receive a message from the json response describing the error. Possible errors may be due to:
- Invalid API token with status code 401
- Invalid service name with status code of 422
- Not enough credits with status code of 422
- Invalid payload with status code of 422
Response Data Definition
- result - A dictionary containing the coordinates of the place.
- remaining_credits - The remaining locate credits after calling the api service.