# Google Sheets → SIRENE Lookup API → Google Sheets

Enrich a column of French company numbers (SIREN or SIRET) with official INSEE Sirene data, using the [French Companies SIRENE Lookup API](https://sirene-lookup-api.corinaflorea8.workers.dev), and write the results back to Google Sheets.

This package is the importable n8n workflow and the Make blueprint. The license key is **never** stored in the JSON: it comes only from a credential or a secret (`{{SIRENE_LICENSE_KEY}}`).

Buy a license: [https://corinaflorea.gumroad.com/l/xzhech](https://corinaflorea.gumroad.com/l/xzhech) (US$9.99/month). You get the key automatically from Gumroad.

## What the workflow does

1. Reads the `Input` tab of your spreadsheet (column `siren_or_siret`).
2. Keeps 9-digit SIREN and 14-digit SIRET values (other rows are skipped).
3. Calls `GET /v1/siren/{siren}` or `GET /v1/siret/{siret}` with your license key in the `X-License-Key` header.
4. Appends one row per number to the `Results` tab: **name**, **address**, **NAF code**, **status**, **creation date**, plus the input number, the SIREN, privacy flags, and any error.

For a SIRET lookup, the address is the establishment address; otherwise it is the head office address.

## Public import links

- n8n workflow: https://sirene-to-sheets.pages.dev/n8n_sirene_to_sheets.json
- Make blueprint: https://sirene-to-sheets.pages.dev/make_sirene_to_sheets.blueprint.json
- This README: https://sirene-to-sheets.pages.dev/README.md

## Prepare the spreadsheet

Create a Google Sheet with two tabs.

**Input** — header in row 1:

`siren_or_siret`

Then one 9-digit SIREN or 14-digit SIRET per row, for example `893713156`.

**Results** — header in row 1:

`input | siren | name | address | naf_code | status | creation_date | commercial_opt_out | masked | error`

Copy the spreadsheet ID from the URL: `https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/edit`.

## n8n

1. **Workflows → Import from URL** (or Import from File) and use `https://sirene-to-sheets.pages.dev/n8n_sirene_to_sheets.json`.
2. Create a **Header Auth** credential:
   - Name: `X-License-Key`
   - Value: your Gumroad license key
   - Attach it to the **SIRENE Lookup API** node. Do not paste the key into the workflow JSON.
3. Connect **Google Sheets OAuth** on both Sheets nodes (**Read SIREN list** and **Write results to Sheets**).
4. Replace `YOUR_GOOGLE_SHEET_ID` in both Sheets nodes with your spreadsheet ID. The tab names must be `Input` and `Results`.
5. Click **Test workflow** (the Start node is a manual trigger). You can later swap it for a Schedule trigger.

The HTTP node waits 1.1 seconds between calls, so a list stays under the API limit of 60 calls per minute.

## Make.com

1. **Import blueprint** → `https://sirene-to-sheets.pages.dev/make_sirene_to_sheets.blueprint.json`.
2. Put `{{SIRENE_LICENSE_KEY}}` in a Make secret or connection, and use that in the HTTP module header `X-License-Key`. Never leave a raw key in the blueprint.
3. Connect Google Sheets. Replace `YOUR_GOOGLE_SHEET_ID` and `YOUR_GOOGLE_CONNECTION_ID`. Tabs: `Input` and `Results`.
4. The scenario is scheduled at 08:00 Europe/Bucharest. Turn it on only after the credentials are set, or run it once by hand. Leave about one second between HTTP calls.

## Privacy and fair use

- **5,000** data calls per license per calendar month (UTC), max **60** calls per minute per key.
- `commercial_opt_out = true` means the record must **not** be used for commercial prospecting (cold email, cold calls, mailing lists). KYB, invoicing and compliance uses remain possible.
- `masked = true` means the person asked INSEE to limit publication: name and street address are withheld.
- Data on sole traders is personal data under the GDPR. You are the controller of what you do with it.
- Source: INSEE Sirene, via the official open API *Recherche d'entreprises* (DINUM). Licence Ouverte 2.0. This is not an official government service.

## Mapping

| Results column | API field |
| --- | --- |
| input | The value read from `Input` |
| siren | `data.siren` (or `data.company.siren` for a SIRET lookup) |
| name | `data.name` |
| address | `data.head_office.address` or `data.establishment.address` |
| naf_code | `data.naf_code` |
| status | `data.status` |
| creation_date | `data.creation_date` (YYYY-MM-DD) |
| commercial_opt_out | `data.commercial_opt_out` |
| masked | `data.diffusion.masked` |
| error | `error.code` when the lookup failed (`not_found`, `bad_siren`, …) |

API docs: https://sirene-lookup-api.corinaflorea8.workers.dev/docs
