Using the Address Standardization API
Learn how to standardize an address by making a `POST` request to the Address Standardization API. This comprehensive document includes step-by-step instructions, an example request and response, and a helpful table outlining the necessary and optional pa
Making a request
To standardize an address, make a POST request to the Address Standardization endpoint with the address details in the request body.
Request body
The request body should contain the data object with the following fields:
| Field | Required/Optional | Type | Description |
|---|---|---|---|
| address | Required | string | The street address which you want to process. |
| pincode | Optional | string | Pincode associated with the provided address. |
| city | Optional | string | City associated with the provided address. |
| state | Optional | string | State associated with the provided address. |
Example Request:
{
"data": {
"address": "Plot 5, Sector 44, Gurgaon",
"pincode": "122003",
"city": "Gurgaon",
"state": "Haryana"
}
}
Understanding the Response
The Address Standardization API returns a JSON response with the standardized address.
Response Schema:
| Field | Type | Description |
|---|---|---|
| success | boolean | Indicates if the request was successful. true if successful, false if there was an error. |
| status_code | number | Status code of the request. |
| message | string | Information about the processed request. |
| request_id | string | A unique id for the request. |
| result | object | Contains the standardized address components. |
Example Response:
{
"success": true,
"status_code": 200,
"message": "Request has been processed",
"request_id": "geocode|cd59836e-e385-4e6e-8272-ec593468b78b",
"result": {
"country": "india",
"state": "haryana",
"city": "gurgaon",
"locality": "sector 44",
"sub_locality": "delhivery corporate office",
"entity_information": {
"sector": "44",
"building_name": "delhivery corporate"
},
"pincode": 122003
}
}
In the result object, you'll find the standardized address components, including pincode, country, state, city, locality, and sub_locality. The entity_information object will contain additional information about the address if available.
| Parameter | Required/Optional | Description | Example |
|---|---|---|---|
| data* | Required | Payload with details of address, pin code, city, and state. | N/A |
| address* | Required | The street address for which you want to get the standardized output. | Plot 5, Sector 44, Gurgaon |
| pincode | Optional | The Pincode associated with the provided address. | 122003 |
| city | Optional | City associated with the provided address. | Gurgaon |
| state | Optional | State associated with the provided address. | Haryana |