# spain-borme-scraper (`ivosandoval/spain-borme-scraper`) Actor

Scrape corporate registry data from Spain's BORME (Boletín Oficial del Registro Mercantil). Extract company incorporations, officer appointments, capital changes, mergers, and more from all 24 provinces.

- **URL**: https://apify.com/ivosandoval/spain-borme-scraper.md
- **Developed by:** [Ivo Sandoval](https://apify.com/ivosandoval) (community)
- **Categories:** Automation, Lead generation, Other
- **Stats:** 2 total users, 1 monthly users, 50.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## 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 BORME Corporate Registry Scraper

Extract structured corporate registry data from Spain's **BORME** (Boletin Oficial del Registro Mercantil), published daily on [boe.es](https://www.boe.es/diario_borme/).

The BORME is the official gazette where all Spanish commercial registry filings are published - company incorporations, capital modifications, mergers, dissolutions, insolvency proceedings, and more.

### What data does it extract?

For each published entry, the scraper returns:

- **Company name** - the registered entity
- **Act type** - Constitucion, Disolucion, Fusion, Escision, Ampliacion de capital, Reduccion de capital, Concurso de acreedores, Situacion concursal, Cambio de objeto social, Transformacion de sociedad
- **Province** - registration province (all 50 Spanish provinces)
- **Amount** - capital amount in euros (when available)
- **BORME number** - entry identifier within the gazette
- **BORME document** - official document ID (e.g. BORME-A-2026-156-01)
- **Publication date** - date of publication on BOE
- **Source URL** - direct link to the official HTML document on boe.es

### Use cases

- **Due diligence** - Track company changes, officer appointments, and capital movements
- **Competitive intelligence** - Monitor new company incorporations in your sector
- **Legal and compliance** - Verify corporate filings and changes in real time
- **Market research** - Analyze M\&A activity, dissolutions, and capital trends by province
- **Lead generation** - Identify newly incorporated companies
- **Insolvency monitoring** - Track bankruptcy proceedings and creditor claims

### Input parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `search_query` | string | Filter by company name |
| `province` | string | Filter by province (e.g. "Madrid", "Barcelona") |
| `date_from` | string | Start date (YYYY-MM-DD) |
| `date_to` | string | End date (YYYY-MM-DD) |
| `act_types` | array | Filter by act types (e.g. \["Constitucion", "Disolucion"]) |
| `max_results` | integer | Max results (default: 100, max: 10,000) |

### Output example

```json
{
    "company_name": "ALPHA JAUREGUI PARTNERS, SOCIEDAD LIMITADA",
    "borme_number": "378338",
    "publication_date": "2026-08-14",
    "province": "ARABA/ALAVA",
    "act_type": "Constitucion",
    "amount": 30000.0,
    "source_url": "https://www.boe.es/diario_borme/txt.php?id=BORME-A-2026-156-01",
    "borme_doc": "BORME-A-2026-156-01",
    "description": "ALPHA JAUREGUI PARTNERS, SOCIEDAD LIMITADA - Constitucion. Province: ARABA/ALAVA. Capital: 30,000.00 euros"
}
```

### Coverage

All 50 Spanish provinces. Published daily (weekdays) on boe.es. Historical data accessible by date range.

### Integrations

Results are stored in Apify Dataset and can be exported as JSON, CSV, Excel, or connected to any workflow via Apify integrations (Zapier, Make, Google Sheets, webhooks, API).

### Optional: PostgreSQL persistence

Pass a `database_url` parameter to automatically persist results to your own PostgreSQL database with upsert semantics (no duplicates on re-runs).

### Pricing

- **Model**: Pay per result (PPE)
- **Price**: $5.00 / 1,000 results

### Running locally

```bash
cd actors/spain-borme
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt

## Print to stdout (no DB)
.venv/bin/python runner.py --date-from 2026-08-14 --date-to 2026-08-14 --max-results 10 --no-db

## Persist to PostgreSQL
DATABASE_URL="postgresql+asyncpg://user:pass@host:5432/datamon_spain_borme" \
    .venv/bin/python runner.py --date-from 2026-08-14 --date-to 2026-08-14

## Filter by province
.venv/bin/python runner.py --province Madrid --max-results 20 --no-db
```

# Actor input Schema

## `search_query` (type: `string`):

Company name to search in BORME entries

## `province` (type: `string`):

Filter by Spanish province (e.g. 'Madrid', 'Barcelona')

## `date_from` (type: `string`):

Start date for BORME search (YYYY-MM-DD)

## `date_to` (type: `string`):

End date for BORME search (YYYY-MM-DD)

## `act_types` (type: `array`):

Filter by act types (e.g. \['Constitucion', 'Nombramientos', 'Ampliacion de capital'])

## `max_results` (type: `integer`):

Maximum number of entries to return

## `database_url` (type: `string`):

PostgreSQL connection string to persist results. Format: postgresql+asyncpg://user:pass@host:port/dbname

## `proxy_configuration` (type: `object`):

Apify proxy configuration

## Actor input object example

```json
{
  "max_results": 100
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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("ivosandoval/spain-borme-scraper").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("ivosandoval/spain-borme-scraper").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 ivosandoval/spain-borme-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/DjNs9hXZv9bjIpe7Z/builds/AAiKGYrrw9yqagyD4/openapi.json
