Features Pricing Docs Contact Dashboard
๐Ÿ Official Python SDK ยท Open source ยท MIT License

Geocoding for Python,
done right

The official Python client for LatLng. Forward geocoding, reverse geocoding, places search, and autosuggest โ€” with both sync and async support.

pip install latlng
PyPI version Python versions MIT License
๐ŸŽฏ

Forward Geocoding

Address or place name โ†’ lat/lon coordinates

๐Ÿ”„

Reverse Geocoding

Coordinates โ†’ human-readable address

๐Ÿ“

Places Nearby

Find POIs around any lat/lon, with radius filter

๐Ÿ”

Places Search

Full-text search across millions of places

โšก

Async Support

Native asyncio client for FastAPI & aiohttp

๐Ÿ”’

Typed Responses

Dataclass models โ€” no Pydantic required

Code Examples

python ยท forward geocoding
from latlng import LatlngClient

# Get your free key at dash.latlng.work
client = LatlngClient(api_key="latlng_xxxxx")

result = client.geocode("Eiffel Tower, Paris")
print(result.first.lat, result.first.lon)
# 48.8584  2.2945

# Iterate multiple results
for place in client.geocode("Berlin", limit=3):
    print(place.name, place.country)
python ยท reverse geocoding
result = client.reverse(48.8584, 2.2945)
print(result.first.name, result.first.city)
# Eiffel Tower  Paris
python ยท places nearby
places = client.places.nearby(lat=40.748, lon=-73.985, radius=500)
for place in places:
    print(place.name, place.category, f"{place.distance_m}m")
python ยท async / await
import asyncio
from latlng import AsyncLatlngClient

async def main():
    async with AsyncLatlngClient(api_key="latlng_xxxxx") as client:
        result = await client.geocode("Tokyo")
        print(result.first.lat, result.first.lon)

        places = await client.places.nearby(lat=35.6762, lon=139.6503)
        for place in places:
            print(place.name)

asyncio.run(main())
python ยท error handling
from latlng import LatlngClient
from latlng.exceptions import LatlngRateLimitError

client = LatlngClient()  # anonymous โ€” 30 geocodes/day
try:
    result = client.geocode("New York")
except LatlngRateLimitError:
    print("Rate limit hit โ€” get a free key at dash.latlng.work")

Available Methods

MethodDescriptionReturns
client.geocode(query)Forward geocode address or place nameGeocodingResponse
client.reverse(lat, lon)Reverse geocode coordinates to addressGeocodingResponse
client.places.nearby(lat, lon)POIs near a location, with radius filterNearbyResponse
client.places.search(q)Full-text place searchSearchResponse
client.places.autosuggest(q)Typeahead place suggestionsAutosuggestResponse
client.places.categories()List all available place categoriesCategoriesResponse
client.health()Check API availabilitybool

Ready to start?

Get a free API key in seconds โ€” 3,000 geocoding requests per day, no credit card required.

Get Free API Key โ†’ View on PyPI