# Spain Public Tenders Scraper | PLACSP Contracts (`scrape_api/spain-public-tenders`) Actor

Search Spanish public tenders and awards from PLACSP with CPV, NUTS, budgets and deadlines. Join buyers by NIF/DIR3 and winners by Spanish NIF, with award details for each lot.

- **URL**: https://apify.com/scrape_api/spain-public-tenders.md
- **Developed by:** [Scrape_API](https://apify.com/scrape_api) (community)
- **Categories:** Business, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 tender notices

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Spain Public Tenders Scraper

Collect Spain public tenders and contract awards from the official Plataforma de Contratación del Sector Público (PLACSP). Find opportunities by CPV, location, budget, buyer, supplier or publication date, and export consistent records with identifiers that can be joined to business registers.

The Actor reads the official contracting authority syndication feed. Each delivered row represents one unique tender in its newest version within the scanned period. Updates of the same tender are deduplicated. Deleted entries suppress older versions, so a withdrawn record does not reappear simply because an earlier publication matched your filters.

### Spain public tenders input

All inputs are optional. Run with an empty object to collect the latest notices, up to the default limit of 100 results. Set `max_items` to choose a total limit between 1 and 5,000 unique tenders. `max_pages` limits the amount of source material scanned, with a default of 30 and a maximum of 250 pages.

Use `keywords` for an array of words or phrases. Any phrase can match the title, reference number or contracting authority name. Matching ignores case and accents, so `optico` also matches `óptico`. Keyword filtering is local to the published feed and does not search attached procurement documents.

Use `cpv` for classification prefixes containing two to eight digits. A prefix matches any CPV code on the notice, including codes associated with individual lots. Use `nuts` for Spanish geographic prefixes such as `ES51` or `ES300`. Geographic filtering uses the main procurement project's location as published by the authority.

`status` accepts `PRE`, `PUB`, `EV`, `ADJ`, `RES` and `ANUL`. An omitted or empty array includes every status. `contract_type` accepts the official CODICE contract type codes; commonly used values are `1` for supplies, `2` for services and `3` for works. `only_open` requires a submission deadline later than the start of the run. A missing deadline does not count as open.

`min_value` and `max_value` apply to the budget excluding VAT, in EUR. They continue to use the budget for awarded notices, allowing a consistent opportunity size filter across stages. The returned `value` for an award instead represents the actual sum of published award amounts excluding VAT. Estimated contract values are kept separately.

Use `date_from` and `date_to` to restrict the notice update time. Both accept a calendar date or an ISO 8601 timestamp. A calendar date includes the whole day in Europe/Madrid. The default upper bound is the run start; the default lower bound is 31 days earlier. Historical searches are limited to the most recent 31 days.

`buyer_nif` and `supplier_nif` accept arrays of exact Spanish tax identifiers, ignoring case and whitespace. Buyer filters match the contracting authority's own NIF. Supplier filters match winners explicitly identified with the NIF scheme. Foreign identifiers published under `OTROS` remain available in the output but do not become Spanish register identifiers.

### Output and identifiers

The dataset contains one row per unique tender. Core fields include `notice_id`, `url`, `title`, `reference_number`, `published_at`, `deadline`, `status`, `stage`, `cpv_codes`, `value` and `currency`. Dates retain publication offsets, and submission deadlines include the Europe/Madrid offset applicable on the deadline date.

`buyer` and `buyer_name` identify the contracting authority. `buyer_id` is its normalised NIF. `buyer_dir3` is that same authority's DIR3 identifier when published; it is never filled with a parent organisation's identifier. The separate `buyer_parents` array preserves the published hierarchy. These identifiers support grouping opportunities by authority and connecting procurement records with other public records.

Award records include `award_amount`, `award_date`, `awardee_name`, `suppliers` and detailed `awards`. Every tender result has its own lot identifier, result code, amounts and winners. Void lots remain present with missing amounts and an empty supplier list. A notice marked ADJ without a named winner is valid and produces an empty `suppliers` array.

Each supplier includes its published name, original `id` and `id_scheme`. Only a Spanish NIF populates `registry_id` and `jurisdiction: ES`. This distinction prevents foreign VAT identifiers from being mistaken for Spanish company registration keys. No supplier identifier is inferred from a name.

Additional fields preserve the budget including VAT, estimated overall value, procurement procedure, Spanish labels, NUTS location, province and notice type history. `description` and `ocid` are null because this feed does not publish those values. The source's structured `summary` is available separately and is not presented as a full tender description.

#### Example of an awarded tender

This is a real record from the feed, shortened to the main fields:

```json
{
  "notice_id": "20806716",
  "title": "Contrato de emergencia ruta cc420 transporte escolar 2026/27",
  "buyer_name": "Dirección del Ente Público Extremeño de Servicios Educativos Complementarios",
  "buyer_id": "S0611001I",
  "buyer_dir3": "A11003800",
  "status": "ADJ",
  "stage": "award",
  "cpv_codes": ["60130000"],
  "value": 18000.0,
  "currency": "EUR",
  "award_date": "2026-09-02",
  "awardee_name": "SOLIS AUTOCARES SL",
  "suppliers": [
    {"name": "SOLIS AUTOCARES SL", "registry_id": "B10045367", "jurisdiction": "ES", "id": "B10045367", "id_scheme": "NIF"}
  ],
  "nuts": "ES70",
  "province": "Cáceres",
  "contract_type_text": "Servicios"
}
```

### Use cases for Spain public tenders data

- **Bid monitoring for suppliers:** filter by CPV prefix, province and budget window to see new opportunities, and use `only_open` to keep only tenders that still accept offers.
- **Competitor tracking:** follow which companies win contracts in your sector by filtering on `supplier_nif`, and see the amounts and dates of their awards.
- **Buyer analysis:** group tenders by `buyer_id` or `buyer_dir3` to see how much a ministry, region or city spends and in which categories.
- **Market sizing for analysts:** combine CPV, NUTS and award amounts to estimate the size of a segment per province.
- **Company enrichment:** join winners and buyers to business registers and CRM records through the Spanish NIF.

### How this compares with other options

| | This Actor | Manual search on the portal | Generic page scrapers |
|---|---|---|---|
| Source | Official PLACSP syndication feed | Portal search form | Rendered web pages |
| Buyer NIF and DIR3 | Yes | Per page, by hand | Rarely |
| Winner NIF per lot | Yes, Spanish NIF only | Per page, by hand | Rarely |
| Updates and withdrawn entries | Deduplicated, withdrawn entries removed | Manual | Often duplicated |
| Export | JSON, CSV, Excel via dataset | Copy and paste | Varies |

### Pagination, coverage and limits

The Actor follows older feed pages automatically. A selective filter may need to scan several pages before producing a row. Empty intermediate pages are valid and are not charged. The run output records warnings, partial results and a `next_cursor` when continuation is available. For direct continuation, repeat the original filters and limits and supply that cursor; cursors expire after 24 hours.

Reaching `max_pages` ends the scan with a warning and partial results. This limit counts fully scanned pages. Newer pages skipped before a historical date window have a separate limit of 250; reaching that limit also ends with a warning. Narrow the date window or increase the scan limit in a new run to search further. Reaching `max_items` completes the requested delivery. The feed is an update log, not a complete historic snapshot or a national procurement census.

An individual notice with an unsupported or missing required source field is skipped with a warning and partial results. Other notices on the page remain available. Its identifier is retained to avoid returning an older version as the latest one. If its update date is missing, that identifier is retained regardless of the date filter.

Coverage is limited to PLACSP feed 643. Separate regional platform aggregation and the small contracts feed are outside this version. Records published only through those sources are not guaranteed to appear. Publication status can differ from labels on a tender's web page, especially where only some lots have been awarded; the output preserves the feed status.

### Pricing

Pricing is per delivered unique tender. The proposed rate is $0.002 per tender; the Actor's displayed pricing governs the actual charge. There is no start fee and no charge for empty results, skipped updates, deleted entries or source pages. Non-paying users receive at most 10 tenders and scan at most eight feed pages per run. A smaller requested result limit is respected.

### Frequently asked questions

#### Can I identify the company that won a contract?

Yes, when the feed names a winning party. Spanish winners with a published NIF include a register join key. Foreign winners retain their original identifiers and scheme. Missing winner data stays missing rather than being reconstructed.

#### Are the returned tenders all currently open?

Every status is included by default. Use `status` and `only_open` to select the opportunity stage and future submission deadlines appropriate to your workflow. A future deadline alone does not replace the published status.

#### Why can a search return partial results?

The scan may reach its page limit or encounter an unavailable source page. Delivered rows remain available, and the output explains the interruption. Where a continuation is available, the Actor resumes from a complete page boundary with deduplication preserved.

#### Does this include every public contract in Spain?

No. This version covers the official contracting authority feed 643, with a recent update window. Separate regional aggregation and small contract feeds are not included. Check the original tender page before acting on an opportunity or award.

# Actor input Schema

## `keywords` (type: `array`):

OR-match on title, reference number and buyer; case and accents are ignored.

## `cpv` (type: `array`):

CPV prefixes, 2 to 8 digits. Matches any classification, including lots.

## `nuts` (type: `array`):

Spanish NUTS prefixes, for example ES51 or ES300.

## `status` (type: `array`):

PLACSP status codes; an empty array includes all statuses.

## `contract_type` (type: `array`):

CODICE contract type codes: 1 goods, 2 services, 3 works.

## `buyer_nif` (type: `array`):

Exact buyer NIFs, ignoring whitespace and case.

## `supplier_nif` (type: `array`):

Exact Spanish winner NIFs; foreign OTROS identifiers do not match.

## `min_value` (type: `number`):

Minimum budget excluding VAT in EUR, including awarded notices.

## `max_value` (type: `number`):

Maximum budget excluding VAT in EUR, including awarded notices.

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

Inclusive updated timestamp or YYYY-MM-DD in Europe/Madrid. At most 31 days back; defaults to 31 days ago.

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

Inclusive updated timestamp or full YYYY-MM-DD in Europe/Madrid. Defaults to the start of the run.

## `only_open` (type: `boolean`):

Require a submission deadline later than the run start.

## `max_items` (type: `integer`):

Maximum unique delivered tenders across all continuation requests.

## `max_pages` (type: `integer`):

Maximum fully scanned feed pages across all continuations. Skipped newer pages have a separate limit of 250.

## `cursor` (type: `string`):

Opaque next_cursor from the previous response. Repeat all original filters and limits. Expires after 24 hours.

## Actor input object example

```json
{
  "only_open": false,
  "max_items": 100,
  "max_pages": 30
}
```

# Actor output Schema

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

Spanish tender notices and contract award details from PLACSP.

## `output` (type: `string`):

Status, counts, charges, warnings and next_cursor for this run.

# 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("scrape_api/spain-public-tenders").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("scrape_api/spain-public-tenders").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 scrape_api/spain-public-tenders --silent --output-dataset

```

## MCP server setup

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

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/qhAxYXkgPI6ZpLHRC/builds/DnQbYvGosL0EiDcjQ/openapi.json
