Turning company registries into contacts
- First working version
- ~4 h
Goal
An agent that filters SABI by province, sector and size, drops the ones already on the list, fills in the website, the email and the decision-maker of every new company and loads it into the master spreadsheet.
How it works
First the user says which sector, province and company size they want to reach. The agent opens the master spreadsheet to see who has already been written to, and only then goes into the company database using the browser session the user already has open.
There it filters by industry code, province and headcount, and reads the results table page by page, because the export button does not respond to automation. What comes out is deduplicated against the master, so a company that has already been worked does not come back.
With the ones left it researches company by company, sixteen searches at a time: the website, the general email, the company LinkedIn and the person who decides, with their job title. It also checks that the domain really receives mail. What is not published stays blank: no address is invented.
To finish, it loads each company into its tab with a priority and the source behind every field, and hands over a summary of how many it added and which look most promising. It runs when someone asks for it, not on a schedule. The last batch produced 162 new companies, 134 with the person who decides and 94 with an email.
- Deliverable
- An .xlsx in the project folder, one tab per vertical plus a summary.
- One row per company: legal name, industry code, province, headcount, website, decision-maker and job title, email, whether the domain receives mail, and priority.
- The source URL behind every field.
- Stack
- Claude Code
- Chrome (MCP)
- SABI Informa
- Subagents in parallel
- WebFetch · empresia.es
- Python (openpyxl, dnspython)
- Project memory
Why it matters
A paid database can be walked end to end using your own session, with no API and no export button, and from there the search moves outward to find who runs each company, dozens of investigations at once.
What could come next
- 01Plug in a verified-email service (Apollo, Hunter) to go from an address guessed by pattern to a confirmed mailbox.
- 02Re-run the extraction every quarter and flag in the master sheet what is new, what is gone and which companies have drifted out of the headcount band.
- 03Check the job title is still current before writing: store the date of the source and raise a flag past eighteen months.
- 04Move the first send out to an n8n routine, so the email sequence and the opt-outs live outside the spreadsheet and keep their own log.
- 05Keep the SABI extractor as a versioned script with a test that flags it if the table identifiers change.
- 06Update the ERP with every new company and its decision-maker, so the contacts land where customers and opportunities are already managed. Today they end up in a spreadsheet someone has to copy across by hand, and that copying is where fields get lost and companies get duplicated.
Worth knowing
- legal
It handles personal data about executives (name, title, email) taken from public sources and the companies register, without those people having given it. That triggers article 14 of the GDPR: the first message has to say where their data came from and offer a way out. Commercial B2B email in Spain also falls under the LSSI.
- legal
Who gets written to, and what they get told, is decided by a person: reviewing 122 contacts turned up four stale job titles (people who had moved on years earlier) and subsidiaries of multinationals where the decision is not made in Spain at all.
- dependency
The whole universe of companies comes from SABI Informa, which is a paid service and needs a live session in Chrome. If the licence lapses or the session is closed, there is no list. The URL that works is sabi.informa.es; the bvdinfo.com one returns “no access” even though it looks like the right one.
- dependency
The extractor reads the results table by its internal HTML identifier. If SABI redesigns that page it stops finding rows and returns an empty list without raising an error. Same story with empresia.es, the only reliable source of company officers that does not block: einforma, axesor, infocif and LinkedIn return 403 or 429 every time.
- cost
The web-search quota is per session, not per hour: 200 searches burn out in one large batch with subagents running in parallel, and waiting does not top it back up. When that happens the enrichment carries on reading pages directly and the hit rate on decision-makers drops.
- future
A named address for the decision-maker barely exists in open sources: of the 94 emails in the last batch, only 7 were personal; the rest were company inboxes or inferred patterns. Scaling this properly will need Sales Navigator or Apollo. SABI’s headcount figure also comes from the last filed accounts, one or two years behind.