# Spain B2B Leads & Company Data (BORME) (`spain-data-solutions/borme-scraper-pro`) Actor

Extract official company data from the Spanish Commercial Registry (BORME/BOE). Converts daily PDFs into structured JSON/Excel. Features: Filters by Province & Act Type (Constitutions, Appointments), Keyword Search, and Anti-Ban Proxy protection.

- **URL**: https://apify.com/spain-data-solutions/borme-scraper-pro.md
- **Developed by:** [Spain Data Solutions](https://apify.com/spain-data-solutions) (community)
- **Categories:** Lead generation, Automation, Real estate
- **Stats:** 10 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$8.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period. You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#rental-actors

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🇪🇸 Spain Company Data Scraper (BORME & BOE)

**The most reliable and cost-effective API to extract daily commercial registry data from Spain.**

***

### 🚀 Overview

Access the official **Boletín Oficial del Registro Mercantil (BORME)** without dealing with complex PDFs or captchas. This scraper monitors the **BOE (Official State Gazette)** daily to extract structured data about Spanish companies.

Perfect for **Lead Generation**, **KYC/KYB Automation**, and **Financial Analysis**.

#### 🌟 Why this is the Best BORME Scraper?

Unlike other generic tools, this Actor is engineered specifically for the Spanish legal framework:

- **📍 Geo-Targeting:** Filter by **Province** (e.g., *Madrid, Barcelona, Valencia*) to target specific local markets.
- **⚖️ Smart Filters:** Distinguish between **Constituciones** (New Companies) and **Nombramientos** (Management Changes).
- **🛡️ Enterprise-Grade Security:** Built-in **Proxy Rotation** prevents IP bans, ensuring 99.9% success rate.
- **⚡ High Performance:** Optimized Python engine extracts thousands of records in seconds.

***

### 🎯 Use Cases (What can you build?)

| User Persona | Use Case |
| :--- | :--- |
| **Sales Teams** | Get a daily Excel list of **newly created companies** in your city to sell B2B services (Marketing, SaaS, Real Estate). |
| **Risk Analysts** | Monitor **Insolvencies (Declaración de Insolvencia)** and **Dissolutions** to update credit scores. |
| **Recruiters** | Track **Appointments (Nombramientos)** to see who is becoming a CEO or Administrator. |
| **Developers** | Integrate official Spanish company data into your CRM or ERP via API (JSON/CSV). |

***

### 🛠️ Input Parameters & Configuration

#### 1. Target Date

- Choose a specific date. If left **EMPTY**, the scraper automatically fetches **TODAY's** data.

#### 2. Province Filter (Critical for Localization)

- Select `ALL` for nationwide data.
- Select specific regions like `MADRID`, `SEVILLA`, `MALAGA`, or `BILBAO` (Bizkaia) to narrow down your search.

#### 3. Legal Act Type (Business Logic)

- **ALL:** Downloads everything.
- **CONSTITUCIÓN (New Companies):** The holy grail for lead generation.
- **NOMBRAMIENTOS (Appointments):** Tracks changes in the Board of Directors.
- **CESES (Dismissals):** Tracks executives leaving companies.
- **AMPLIACIÓN DE CAPITAL:** Tracks companies growing financially.

***

### 📊 Data Output Schema

The data is delivered in clean **JSON** or **Excel**, ready for ingestion. Fields include:

- `id_anuncio`: Official BOE reference ID.
- `fecha_publicacion`: Date of the event.
- `provincia`: Region of the company.
- `nombre_empresa`: Validated Company Name.
- `texto_completo`: The full legal text (containing NIF/CIF, address, and CNAE details if available).
- `url_origen`: Direct link to the official signed PDF.

***

### ❓ FAQ

**Q: Does this cover all of Spain?**
A: Yes, it covers all provinces including Ceuta, Melilla, and the islands (Canarias/Baleares).

**Q: Can I use this for KYC (Know Your Customer)?**
A: Yes, the data comes from the official government source (Agencia Estatal Boletín Oficial del Estado), making it suitable for compliance verification.

**Q: Do I need to buy proxies?**
A: No, the scraper includes "Automatic Proxy" configuration to handle BOE traffic.

***

### 💰 Pricing Model

We believe in fair pricing.

- **Trial:** 7 Days **FREE**. Test the quality before you pay.
- **Subscription:** Low monthly fee for unlimited daily access. Much cheaper than buying manual DBs.

***

*Tags: spain, boe, borme, registro mercantil, companies, b2b leads, scraping, python, pdf, legal, kyc, cif, nif*

# Actor input Schema

## `targetDate` (type: `string`):

Select the publication date. If left EMPTY, it will scrape TODAY's bulletin.

## `provinceFilter` (type: `string`):

Select a specific region. Select 'ALL' for nationwide data.

## `searchQuery` (type: `string`):

Download only companies matching this word (e.g., 'CONSTRUCCION', 'HOLDING').

## `actTypeFilter` (type: `string`):

Filter by specific event type. Default is 'ALL' (No filter).

## `maxItems` (type: `integer`):

Limit the number of results to save costs (e.g., 100).

## `proxyConfiguration` (type: `object`):

Select 'Automatic' to use Apify Proxies.

## `debugMode` (type: `boolean`):

Enable verbose logging.

## Actor input object example

```json
{
  "provinceFilter": "ALL",
  "actTypeFilter": "ALL",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "debugMode": false
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("spain-data-solutions/borme-scraper-pro").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("spain-data-solutions/borme-scraper-pro").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call spain-data-solutions/borme-scraper-pro --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,spain-data-solutions/borme-scraper-pro"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/pBmw6A9MctOpoSXl2/builds/SAF1PmqJG8PrGu3wt/openapi.json
