Developer API
A free, documented REST API for forward geocoding, reverse geocoding, timezone lookup, and sun/moon times — the same privacy-respecting proxies this site runs on. Free tier: 1000 requests/day, 60/minute. No credit card; the key is issued instantly and shown once.
| Endpoint | What it does | Example |
|---|---|---|
GET /api/v1/geocode | Address / place → coordinates (top 5 matches) | ?q=Eiffel+Tower |
GET /api/v1/reverse-geocode | Coordinates → address | ?lat=48.858&lng=2.294 |
GET /api/v1/timezone | Coordinates → IANA timezone + UTC offset | ?lat=28.61&lng=77.21 |
GET /api/v1/elevation | Coordinates → terrain elevation (Copernicus DEM) | ?lat=27.99&lng=86.93 |
GET /api/v1/sun-times | Sunrise, sunset, dawn, dusk, day length | ?lat=51.5&lng=-0.12&date=2026-07-19 |
GET /api/v1/moon | Moon phase, illumination, moonrise/set | ?lat=51.5&lng=-0.12 |
Authentication: send the key as an X-Api-Key header (preferred) or ?key= parameter. Every response includes X-RateLimit-Remaining-Today. Errors are JSON with an error code. Geocoding data © OpenStreetMap contributors (ODbL) — cache results rather than re-querying, and show attribution in end-user apps.
# 1. Geocode an address
curl -H "X-Api-Key: wiml_YOURKEY" "https://whatismylocation.ai/api/v1/geocode?q=Taj+Mahal"
# 2. Reverse geocode
curl -H "X-Api-Key: wiml_YOURKEY" "https://whatismylocation.ai/api/v1/reverse-geocode?lat=27.1751&lng=78.0421"
# 3. Sun times for today
curl -H "X-Api-Key: wiml_YOURKEY" "https://whatismylocation.ai/api/v1/sun-times?lat=27.1751&lng=78.0421"
Fair use: the free tier exists for prototypes, agents, and small apps. Need more? Talk to us.
This API is the sanctioned machine endpoint for the tools on this site (also advertised in llms.txt and ai.json). Agents are welcome on the same free tier — identify your agent in the signup purpose field.
Have a CSV of addresses (or coordinates)? The batch geocoding tool runs up to 500 rows through this API right in your browser with your key — queued politely at ~1 request/second, results downloadable as CSV or GeoJSON, and your file never touches our server. For jobs beyond a few thousand rows, use a commercial geocoder rather than a free community one.