opencage
Wrapper module for the OpenCage Geocoder API
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, low installation friction, and a permissive license. It provides a straightforward, well-documented interface to a reliable geocoding service. Install it if you need to integrate address-to-coordinate or coordinate-to-address lookups into a Python application and are willing to obtain an OpenCage API key.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a valid OpenCage Data API key (free tier available at opencagedata.com).
- Requires Python 3.9 or newer.
- Low friction installation with a pure-Python wheel.
License · maintenance · safety
BSD-3-Clause (permissive) — Licensed under BSD-3-Clause (permissive), allowing commercial use, modification, and distribution with minimal restrictions beyond retaining the license notice.
last release 2026-06-08 (67 days) · last repo commit 2026-06-08 · 87 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 266,791 downloads/mo, #8,301 on PyPI
Alternatives
Verify before relying
pip install opencage
from opencage.geocoder import OpenCageGeocode
geocoder = OpenCageGeocode('your-api-key')
results = geocoder.geocode('82 Clerkenwell Road, London')
print(results[0]['formatted'])- Rate limits and quota details for the free vs. paid API tiers
- Performance characteristics when making large batches of requests
- Whether the module handles edge cases like ambiguous addresses or missing results gracefully
What it is and what it does
opencage is a client library for the OpenCage Geocoding API, a web service that converts between addresses and geographic coordinates. It handles both forward geocoding (address → lat/long) and reverse geocoding (lat/long → address), and supports optional parameters like language preference and proximity hints to refine results.
The module offers both synchronous and asynchronous request methods, allowing you to make single queries or batch multiple requests efficiently. It wraps HTTP calls to the OpenCage API using Requests and aiohttp, handles authentication via API key, and raises specific exceptions (InvalidInputError, NotAuthorizedError, RateLimitExceededError, etc.) to help you diagnose problems. Context managers and async/await patterns are supported for connection reuse and parallel requests.
Use it for
- Convert user-entered addresses into map coordinates for location-based applications or services
- Reverse-geocode GPS coordinates from mobile devices or sensors into human-readable street addresses
- Build batch geocoding pipelines that process thousands of addresses while reusing HTTP connections
- Implement location search features with proximity hints to disambiguate results in crowded areas
- Run parallel geocoding requests asynchronously to speed up large-scale data processing workflows
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, low installation friction, and a permissive license. It provides a straightforward, well-documented interface to a reliable geocoding service. Install it if you need to integrate address-to-coordinate or coordinate-to-address lookups into a Python application and are willing to obtain an OpenCage API key.
Install
opencage on PyPI
Before you install
Low friction installation with a pure-Python wheel. Actively maintained with a recent release (67 days ago) and steady repository activity. Depends on three well-established libraries: Requests, backoff, and aiohttp.
Requires a valid OpenCage Data API key (free tier available at opencagedata.com). Requires Python 3.9 or newer.
License in practice
Licensed under BSD-3-Clause (permissive), allowing commercial use, modification, and distribution with minimal restrictions beyond retaining the license notice.
Quickstart
pip install opencage
from opencage.geocoder import OpenCageGeocode
geocoder = OpenCageGeocode('your-api-key')
results = geocoder.geocode('82 Clerkenwell Road, London')
print(results[0]['formatted'])
Verify before relying
- Rate limits and quota details for the free vs. paid API tiers
- Performance characteristics when making large batches of requests
- Whether the module handles edge cases like ambiguous addresses or missing results gracefully
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesRequestsbackoffaiohttp |
| Maintenance | Actively maintained 67 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 266,791 / month, #8,301 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: GISTopic :: Utilities |
Evidence: opencage-3.4.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “geocoding api wrapper”
- opencageA Python wrapper for the OpenCage Geocoding API that converts…
- pygeocodioPython client library for the Geocodio API, enabling geocoding,…
- censusgeocodeWraps the US Census Geocoder API to convert addresses to coordinates…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also geocoder · censusgeocode · geopy · reverse_geocoder · reverse-geocode · pygeocodio · azure-maps-search · googlemaps · pgeocode · shortzy