Python helper to query the Sirene API on api.insee.fr. Current version is 1.6, providing access to the Sirene database (companies and establishments) and links of succession. Release cadence is irregular, with recent updates in 2023.
Install & Compatibility
Where this runs
tested against v1.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.12
✕ build_error
✕ build_error
py 3.13
✕ build_error
✕ build_error
21MB installed
● package 21MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ApiInsee
✓ from api_insee import ApiInsee
Correct import after pip install
ApiInsee
✓
✗ import api_insee
api_insee is the module name, not the class; you must import the class explicitly
Initialize the API with credentials and perform a basic unit search.
from api_insee import ApiInsee
api = ApiInsee(
key=os.environ.get('INSEE_KEY', 'mon_cle'),
secret=os.environ.get('INSEE_SECRET', 'mon_secret')
)
# Request a unit (entreprise) by SIREN
response = api.sirene.units(criteria={'q': 'siren:398607333'})
print(response.text)
Audit
Dependencies
requestsrequiredHTTP library for API calls