See llms.txt for all machine-readable content.

Back to Templates

Log daily new Spanish companies to Google Sheets or CSV with BORME API

Quick overview

Every Tuesday to Saturday morning, the workflow reads the incorporations published in the previous day's BORME and keeps those matching your provinces, legal forms, keywords and minimum share capital. It adds the new companies to a Google Sheet and sends a digest to Slack or by email.

How it works

  1. A schedule trigger starts the workflow Tuesday to Saturday at 07:30 (Europe/Madrid). Each run reads the previous day's BORME, which is not published on weekends, so there is no run on Sunday or Monday.
  2. Gets the incorporations published in that BORME from BORME API, 200 per page, with your provinces and minimum share capital sent as API filters.
  3. Keeps one item per company and applies your legal form and keyword filters: the legal form (SL, SA and others) is read from the end of the company name, and keywords are matched in the name or the start of the business purpose (the API returns only its first part).
  4. Skips companies already in your Google Sheet, so each company is added once.
  5. Adds the company card (officers, NIF, LEI, website and company status, when known) for up to max_company_cards companies per run (25 by default), one request a second. After a 403 response (the plan does not include cards) or a 429 (daily quota used up), it requests no more cards in that run; card_status says why.
  6. Appends or updates the rows in your Google Sheet, matched on company_slug. On self-hosted n8n it can write a CSV file instead.
  7. Sends a digest in English or Spanish to Slack or by email: the counts (returned by the API, matching, new, with a card) and the top companies by share capital, with links.
  8. If the list of incorporations cannot be fetched, it sends an alert on the digest channel (when notify_on_error is true, the default) and marks the run as failed.

Setup

  1. Create a Header Auth credential with the header name X-API-Key and your BORME API key as the value. Select it in Get new incorporations and Get company card, and check that both nodes use it: on import, n8n may assign another Header Auth credential from your instance.
  2. Select your Google Sheets credential in Read the sheet and Append to Google Sheet, and your Slack credential in Send to Slack.
  3. In your spreadsheet, create a tab named New companies (or the name you set in sheet_name) with the header row from the Sheet columns note.
  4. In the Settings node, fill in sheet_url, your filters (provinces, legal_forms, keywords, min_capital_eur) and slack_channel. An empty filter means all.
  5. Click Execute workflow once, check the sheet and the digest, then activate the workflow. To test on a Sunday or Monday, when the previous day has no BORME, copy the default expression in borme_date, type a weekday date such as 2026-11-10, run the test, and paste the expression back before you activate.

Requirements

  • A BORME API key (https://bormeapi.com/account). The free plan (50 requests a day) is enough without company cards; the cards need the Basic plan or higher.
  • A Google Sheets account (or self-hosted n8n for the CSV output), and a Slack workspace or an SMTP account for the digest.

Customization

  • Email instead of Slack: set digest_channel to email, fill in to_email and from_email, enable Send by email and select your SMTP credential in it, then disable Send to Slack. n8n does not activate a workflow while an enabled node has no credential, so keep the node you do not use disabled.
  • CSV instead of Google Sheets (self-hosted n8n): disable Read the sheet and Append to Google Sheet, enable Build CSV file and Save CSV to disk, and set csv_folder. You get one file per BORME day; without the sheet, there is no check against earlier days.
  • In Settings, change fetch_company_card (false skips the cards), max_company_cards, top_n, digest_language, send_empty_digest (true also sends a digest on days with no new company) or notify_on_error.

Additional info

The BORME (Boletín Oficial del Registro Mercantil) is Spain's Official Gazette of the Commercial Registry. On the company cards, the NIF is linked to the company through other open sources and may need checking. Every request counts against your plan's daily quota, which resets at 00:00 UTC.