Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported SIRET codes - 'RequestExeption' #7

Open
RakeshJarupula opened this issue Mar 25, 2024 · 3 comments
Open

Unsupported SIRET codes - 'RequestExeption' #7

RakeshJarupula opened this issue Mar 25, 2024 · 3 comments

Comments

@RakeshJarupula
Copy link

RakeshJarupula commented Mar 25, 2024

Hello @ln-nicolas, Thank you for the amazing library :)

I was trying to get the establishment information using SIRET codes. But I was not able to get information about entities that have alphanumeric SIRET codes.

ex: 'P00042926001', 'J201000201128001' etc.

Wikipedia. ex: 'MONACOCONFO001'

How to retrieve info about these entities.
sample: api.siret('H00000082001').get()

@Fred-si
Copy link

Fred-si commented Mar 27, 2024

Hello @RakeshJarupula this is an API limitation, requesting https://api.insee.fr/entreprises/sirene/V3/siret/P00042926001 return an error

{
    "header": {
        "statut": 400,
        "message": "Erreur de format de siret (P00042926001) - Format attendu : 14 chiffres"
    }
}

Using the q url parameter seems work, you should be able to retrieve data with code like this

api.siret(q='siret:P00042926001')get()

@RakeshJarupula
Copy link
Author

RakeshJarupula commented Mar 27, 2024

Thank you @Fred-si ,
But it doesn't seems to work.

After running:
api.siret(q='siret:P00042926001').get()

Out:
HTTPError: HTTP Error 404:

which means that file doesn't exist.

I tried with many alphanumeric codes. It's the same for all.

@Fred-si
Copy link

Fred-si commented Mar 27, 2024

My bad, I have tried to request API directly before answer and it seemed to work, but I must not have been fully awake.

After verification, the English version of Wikepedia SIRET page seems to be wrong, the linked source of this section not talk about alphanumeric SIRET.

The INSEE definition of siret is "14-figure numerical identifier" https://www.insee.fr/en/metadonnees/definition/c1841

Sorry for my mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants