{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain New Companies Scraper: BORME Registrations & Directors",
    "description": "Spanish company registry (BORME) scraper: new companies incorporated in Spain every weekday, with business purpose, address, share capital, sole shareholder and directors as published. Filter by province, keywords, CNAE, capital. Also appointments, dissolutions, insolvency. Monitor mode + alerts.",
    "version": "0.1",
    "x-build-id": "OkxwrM3swGaxGvKcV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/euroscrape~spain-companies/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-euroscrape-spain-companies",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/euroscrape~spain-companies/runs": {
      "post": {
        "operationId": "runs-sync-euroscrape-spain-companies",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/euroscrape~spain-companies/run-sync": {
      "post": {
        "operationId": "run-sync-euroscrape-spain-companies",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "daysBack": {
            "title": "📅 Days back",
            "minimum": 1,
            "maximum": 400,
            "type": "integer",
            "description": "Read the BORME issues of the last N calendar days (it is published Monday to Friday). Ignored if 'From date' is set.",
            "default": 7
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "First BORME publication date to read (YYYY-MM-DD). Overrides 'Days back'."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Last publication date to read (YYYY-MM-DD). Default: today."
          },
          "provinces": {
            "title": "📍 Provinces",
            "type": "array",
            "description": "Spanish provinces, e.g. Madrid, Barcelona, Valencia, Sevilla, Málaga, Bizkaia, Alicante, A Coruña, Las Palmas, Illes Balears (accents and case do not matter). Empty = all of Spain.",
            "items": {
              "type": "string"
            }
          },
          "eventTypes": {
            "title": "🏢 What to return",
            "type": "array",
            "description": "Registry acts to return. Default: newly incorporated companies only. Add appointments, departures, dissolutions, insolvency… to monitor changes. Empty = every act.",
            "items": {
              "type": "string",
              "enum": [
                "incorporation",
                "appointment",
                "departure",
                "reelection",
                "revocation",
                "bylaws_change",
                "address_change",
                "purpose_change",
                "name_change",
                "capital_increase",
                "capital_reduction",
                "sole_shareholder_change",
                "dissolution",
                "extinction",
                "insolvency",
                "merger",
                "demerger",
                "transformation",
                "website",
                "registry_reopening",
                "registry_closure",
                "appointment_cancellation",
                "first_registration",
                "bond_issue",
                "power_of_attorney_change",
                "preventive_annotation",
                "accounts_not_filed",
                "other",
                "correction"
              ],
              "enumTitles": [
                "New company (Constitución)",
                "Appointment (Nombramientos)",
                "Director left (Ceses/Dimisiones)",
                "Re-election (Reelecciones)",
                "Revocation (Revocaciones)",
                "Bylaws change",
                "Address change",
                "Business purpose change",
                "Name change",
                "Capital increase",
                "Capital reduction",
                "Sole shareholder change",
                "Dissolution",
                "Extinction (closed)",
                "Insolvency (Situación concursal)",
                "Merger",
                "Demerger / spin-off",
                "Transformation (legal form)",
                "Website declared",
                "Registry sheet reopened",
                "Registry sheet closed",
                "Appointments cancelled by the registry",
                "First registration",
                "Bond issue",
                "Powers of attorney changed",
                "Preventive annotation",
                "Annual accounts not approved (art. 378.5)",
                "Other acts",
                "Correction (Fe de erratas)"
              ]
            },
            "default": [
              "incorporation"
            ]
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep only companies whose name or business purpose contains one of these words (Spanish, accents and case ignored), e.g. inmobiliaria, software, restaurante, energía solar.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop companies whose name or business purpose contains one of these words, e.g. holding.",
            "items": {
              "type": "string"
            }
          },
          "cnaeCodes": {
            "title": "CNAE codes",
            "type": "array",
            "description": "Activity codes, e.g. 6201 (software), 4121 (construction), 5610 (restaurants), 68 (real estate, prefix). Only matches companies whose deed cites a CNAE code (about 1 in 4 new companies): for wider results use keywords.",
            "items": {
              "type": "string"
            }
          },
          "legalForms": {
            "title": "Legal forms",
            "type": "array",
            "description": "Keep only these legal forms (read from the company name). Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "SL",
                "SLU",
                "SLP",
                "SLL",
                "SLNE",
                "SA",
                "SAU",
                "SAL",
                "SAD",
                "COOP",
                "AIE",
                "BRANCH"
              ],
              "enumTitles": [
                "SL (limited company)",
                "SLU (single-member SL)",
                "SLP (professional SL)",
                "SLL (employee-owned SL)",
                "SLNE",
                "SA (public limited company)",
                "SAU (single-member SA)",
                "SAL",
                "SAD (sports SA)",
                "Cooperative",
                "AIE (economic interest grouping)",
                "Branch of a foreign company"
              ]
            }
          },
          "minCapital": {
            "title": "Min share capital (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "For new companies: keep only those with at least this share capital, e.g. 10000."
          },
          "maxCapital": {
            "title": "Max share capital (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "For new companies: keep only those with at most this share capital."
          },
          "soleShareholderOnly": {
            "title": "Single-shareholder companies only",
            "type": "boolean",
            "description": "Keep only companies with a declared sole shareholder (socio único).",
            "default": false
          },
          "includeRawText": {
            "title": "Include the original BORME text",
            "type": "boolean",
            "description": "Adds the full announcement as published (rawText), so you can check every field.",
            "default": true
          },
          "maxItems": {
            "title": "Max companies",
            "minimum": 1,
            "type": "integer",
            "description": "Stops after this many companies (most recent BORME first).",
            "default": 1000
          },
          "monitorName": {
            "title": "🔔 Monitor name (only new announcements)",
            "type": "string",
            "description": "Name this search and schedule it (e.g. every weekday): each run then returns only announcements not delivered by a previous run of this monitor, so you are never charged twice for the same company. The first run is the baseline."
          },
          "telegramBotToken": {
            "title": "Telegram bot token",
            "type": "string",
            "description": "Get an instant message for each new company of your monitor. Create a bot with @BotFather."
          },
          "telegramChatId": {
            "title": "Telegram chat ID",
            "type": "string",
            "description": "Your chat or channel ID (message @userinfobot to get yours)."
          },
          "discordWebhookUrl": {
            "title": "Discord webhook URL",
            "type": "string",
            "description": "Channel settings → Integrations → Webhooks."
          },
          "slackWebhookUrl": {
            "title": "Slack webhook URL",
            "type": "string",
            "description": "Incoming webhook URL."
          },
          "webhookUrl": {
            "title": "Custom webhook URL",
            "type": "string",
            "description": "Receives one JSON POST per run with all new companies (Make, Zapier, n8n, your CRM…)."
          },
          "maxNotifications": {
            "title": "Max alerts per run",
            "minimum": 1,
            "type": "integer",
            "description": "Extra companies are summarized in one message.",
            "default": 30
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}