API Documentation
Everything you need to integrate LatLng geocoding into your application.
🔑 Authentication
All API requests require authentication using an API key. Include your key in the request header:
X-Api-Key: your_api_key_here
Get your API key from the dashboard.
🎯 Forward Geocoding
Convert an address or place name into geographic coordinates.
GET
https://api.latlng.work/api
Parameters
| Parameter | Type | Description |
|---|---|---|
q required |
string | The address or place name to geocode |
limit |
integer | Maximum number of results (default: 10) |
lang |
string | Language for results (e.g., "en", "de", "fr") |
Example Request
curl "https://api.latlng.work/api?q=Seattle,WA" \ -H "X-Api-Key: your_api_key"
Example Response
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-122.3321, 47.6062]
},
"properties": {
"name": "Seattle",
"state": "Washington",
"country": "United States",
"type": "city"
}
}
]
}
🔄 Reverse Geocoding
Convert geographic coordinates into a human-readable address.
GET
https://api.latlng.work/reverse
Parameters
| Parameter | Type | Description |
|---|---|---|
lat required |
number | Latitude coordinate |
lon required |
number | Longitude coordinate |
Example Request
curl "https://api.latlng.work/reverse?lat=47.6062&lon=-122.3321" \ -H "X-Api-Key: your_api_key"
⚠️ Rate Limits
API responses include rate limit headers:
| Header | Description |
|---|---|
X-RateLimit-Limit |
Your plan's request limit |
X-RateLimit-Remaining |
Requests remaining in current period |
❌ Error Codes
| Code | Description |
|---|---|
400 |
Bad Request - Missing or invalid parameters |
401 |
Unauthorized - Invalid or missing API key |
429 |
Too Many Requests - Rate limit exceeded |
500 |
Internal Server Error |