Skip to main content

Python helper to request Sirene Api on api.insee.fr

Project description

## API Insee

Python helper to request Sirene API

API Sirene give access to French companies and business database. Entities are recorded since the creation
of this administrative register in 1973. To use this API you have to create an account on <https://api.insee.fr/>

You will find the official documentation [here](https://api.insee.fr/catalogue/site/themes/wso2/subthemes/insee/pages/item-info.jag?name=Sirene&version=V3&provider=insee). All examples described here comes from the official documentation.


#### Installation

You can install the helper with pip

```
pip install api_insee
```

To use the api within a python script

```python
from api_insee import ApiInsee

api = ApiInsee(
key = # your consumer key,
secret = # your consumer secret
)

```

#### Siren and Siret service

To get information about a siren number

```python
data = api.siren('005520135').get()
```

This simple code call ```https://api.insee.fr/entreprises/sirene/V3/siren/005520135``` and return these data :

```json
{
"header": {
"statut": 200,
"message": "OK"
},
"uniteLegale": {
"siren": "005520135",
...
"periodesUniteLegale": [
{
"dateFin": null,
"dateDebut": "2007-11-19",
"etatAdministratifUniteLegale": "C",
"changementEtatAdministratifUniteLegale": true,
"nomUniteLegale": null,
...
}
...
]
}
}
```

The same logic for a siret number

```python
data = api.siret('39860733300059').get()
# call https://api.insee.fr/entreprises/sirene/V3/siret/39860733300059
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

api_insee-1.0.1.tar.gz (10.0 kB view details)

Uploaded Source

File details

Details for the file api_insee-1.0.1.tar.gz.

File metadata

  • Download URL: api_insee-1.0.1.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.9.1 setuptools/20.7.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.12

File hashes

Hashes for api_insee-1.0.1.tar.gz
Algorithm Hash digest
SHA256 297e07a7640363c636a3c4cfbe170356a1b66f728a264dd5e4bd80c204ebc837
MD5 774027582bb2801a4c5683a73ece8d30
BLAKE2b-256 76c1bc26c6b0d5fd8ccf6ad5358492ed703225a3b128ec0cd199c316fefdf370

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page