Endpoints
Geocoding API
Resolve a textual address to coordinates.
GET /api/v1/geocodeParameters
At least one is required.
| Name | Description |
|---|---|
| q | Free-text address. A six-digit PIN inside the text is detected automatically. |
| address | Alias for q. |
| locality | Locality name, if you have it separately. |
| city | City name. |
| pincode | PIN code, which sharply narrows the candidate set. |
Request
curl "https://address.s2coder.com/api/v1/geocode?q=Gomti+Nagar&pincode=226010" \
-H "X-API-Key: YOUR_API_KEY"Response
{
"success": true,
"data": {
"latitude": 26.8467,
"longitude": 80.9462,
"formatted_address": "Gomti Nagar, Lucknow, Uttar Pradesh, 226010",
"matched_on": "locality",
"precision": "approximate",
"components": {
"locality": "Gomti Nagar",
"city": "Lucknow",
"district": "Lucknow",
"state": "Uttar Pradesh",
"pincode": "226010"
}
}
}Precision levels
Always read precision before using the coordinates. A PIN centroid can
be kilometres from the actual address, which matters a great deal for a delivery
ETA and not at all for a map preview.
| Precision | Matched on | Meaning |
|---|---|---|
| rooftop | address | An exact address record with its own coordinates. |
| approximate | locality | The centre of the locality. |
| centroid | pincode | The centre of the PIN code area. Coarse. |
When nothing matches
Responds 404 with no coordinates could be resolved. This is a normal outcome, not an error condition — handle it as "unknown location" rather than as a failure.
Where coordinates come from
Only from data already in the platform: your own imported rows and the licensed reference dataset. No third-party geocoding service is called, so the addresses you send are never forwarded outside our infrastructure.