API reference / Risk & Location
Reverse geocode
Address, city, state and pincode for a latitude and longitude.
POST
/v1/geo/reverse-geocode- Authentication
- Bearer token
- Scope
kyc:verify
Request body
| Field | Type | Required | Description |
|---|---|---|---|
latitude | number | Yes | Latitude from -90 to 90; a numeric string is also accepted. |
longitude | number | Yes | Longitude from -180 to 180; a numeric string is also accepted. |
Sample code
Set your key in the GRAPPI_API_KEY environment variable. Sample values are placeholders.
curl -sS -X POST 'https://grappi.ai/v1/geo/reverse-geocode' \
-H "Authorization: Bearer $GRAPPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"latitude": 19.076,
"longitude": 72.8777
}'Sample response
{
"request_id": "req_01HZY3K8M2",
"result": {
"address": "12 Example Lane, Pune, Maharashtra 411001, India",
"city": "Pune",
"state": "Maharashtra",
"state_code": "MH",
"country": "India",
"country_code": "IN",
"zipcode": "411001",
"latitude": "18.5204",
"longitude": "73.8567",
"confidence_score": 0.92
}
}Response fields
| Field | Type | Description |
|---|---|---|
address | string | Full address of the place. |
city | string | City. |
state | string | State. |
state_code | string | State code. |
country | string | Country. |
country_code | string | Two-letter country code. |
zipcode | string | Pincode. |
latitude | string | Latitude of the matched place. |
longitude | string | Longitude of the matched place. |
confidence_score | number | How confident the match is. |
Errors
Every failure has the same shape. A call that fails on our side or at the data source is refunded to your wallet; a "no record found" answer is charged. See the error reference.