n8n-nodes-sirene
v0.1.0
Published
n8n community node for the French Sirene open data API (INSEE) - companies and establishments by SIREN / SIRET
Maintainers
Readme
n8n-nodes-sirene
This is an n8n community node. It lets you interact with the INSEE Sirene open data API in your n8n workflows.
Sirene is the French national business register, maintained by INSEE. It lists every French company and every one of its establishments, identified by a 9-digit SIREN (the company) and a 14-digit SIRET (one of its establishments), and carries their name, legal form, NAF activity code, address, headcount bracket and administrative status. The open data API exposes the register free of charge, updated daily.
n8n is a fair-code licensed workflow automation platform.
Installation Credentials Operations Query syntax Pagination and rate limits Error handling No trigger node Compatibility Known limitations Resources License
Installation
Follow the installation guide in the n8n community nodes documentation.
Alternatively, install it from npm:
npm install n8n-nodes-sireneFor local development:
npm install
npm run dev # starts an n8n instance with the node hot-mountedCredentials
- Create an account on portail-api.insee.fr.
- Subscribe to the Sirene API, then copy your application's integration key.
- In n8n: Credentials → New → Sirene API → paste the key → Save.
The key is static and does not expire. It travels in the X-INSEE-Api-Key-Integration header.
The credential's test button calls GET /informations, the lightest endpoint of the API.
Operations
This node supports the following operations:
- Company (legal unit, SIREN)
- Get — a company record by its SIREN
- Search — by name, NAF code, legal category, company size category, headcount bracket, administrative status
- Establishment (SIRET)
- Get — an establishment record by its SIRET
- Get Many by Company — every establishment of a SIREN
- Search — by name, SIREN, postcode, town, NAF code, status, headquarters only
- Succession Link
- Search — predecessors and successors of establishments over a given period
- Information
- Get — API version and the register's last update dates
Query syntax
The node writes the Sirene query for you, including the historised-variable trap.
Some variables (administrative status, NAF code, company name on /siren, and so on) only exist inside a period of the record. Querying them at the top level makes the API answer 400 "Erreur de syntaxe dans le paramètre q". They have to be wrapped in periode(...), and which variables are concerned depends on the endpoint:
| Field | /siren | /siret |
|---|---|---|
| denominationUniteLegale | periode(...) | top level |
| etatAdministratif* | periode(...) | periode(...) |
| activitePrincipale* | periode(...) | periode(...) |
| categorieJuridiqueUniteLegale | periode(...) | — |
| siren, categorieEntreprise, trancheEffectifs*, codePostal*, libelleCommune*, etablissementSiege | top level | top level |
The node puts each filter on the right side and groups the historised criteria into a single periode(... AND ...), which means they have to hold true over the same period. The Raw Query field is there for everything else; it is combined with the filters using AND, but there you write the periode(...) wrappers yourself.
Phonetic search goes through the .phonetisation suffix (not .phonetique, which returns a 400). The node applies it when the phonetic option is enabled.
Pagination and rate limits
Return All walks the pages through curseur / curseurSuivant, up to 1 000 results per page. It stops on header.total: at the end of a listing the API returns a new curseurSuivant rather than repeating the last one, so stopping on "the cursor no longer moves" would cost one extra empty request.
Open data usage is capped at 30 requests per minute. The node waits 2.1 s between pages, so a Return All over a large search is slow but never gets throttled.
Requests longer than roughly 1.5 kB automatically switch to POST to avoid an HTTP 414.
Use the Fields option (under Options), a comma-separated list of fields, whenever you can: a full Sirene response carries several hundred fields per establishment.
Error handling
The API answers 404 for an unknown SIREN or SIRET. Turn on Settings → On Error → Continue on the node to get an { error: ... } item instead of a failed run.
No trigger node
The Sirene API exposes no webhook. To watch a portfolio of companies, use n8n's Schedule Trigger followed by this node, and compare against what you saw on the previous run.
Compatibility
Node.js 20+. Tested with n8n 2.x.
Known limitations
- The
tri(sort) parameter is not exposed: it is incompatible with the cursor pagination used byReturn All. - Phonetic search only covers the company name, not the trade name or the town.
- The guided filters do not yet cover trade name, creation date or geolocation. Use Raw Query in the meantime.
- The data is the Sirene register's own, updated daily — see the Information → Get operation for the exact date.
Resources
- n8n community nodes documentation
- Sirene open data API on data.gouv.fr
- INSEE API portal
- Sirene 3.11 variable reference
- Cursor pagination
License
MIT. Sirene data is published under the Open Licence 2.0. "Sirene" and "INSEE" are trademarks of the French State; this package is an unofficial client.
