{
  "openapi": "3.0.1",
  "info": {
    "title": "CNMC Resoluciones y Expedientes · Spain Competition Decisions",
    "description": "Resoluciones y expedientes CNMC en JSON: concentraciones (merger decisions), sancionadores, conductas y regulación de energía o telecom de la autoridad española de competencia. Número, estado, sujetos, cronología, PDF. Modo incremental.",
    "version": "0.3",
    "x-build-id": "O0rUW3pEXd5OavoFB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crispish_guava~cnmc-resoluciones/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crispish_guava-cnmc-resoluciones",
        "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/crispish_guava~cnmc-resoluciones/runs": {
      "post": {
        "operationId": "runs-sync-crispish_guava-cnmc-resoluciones",
        "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/crispish_guava~cnmc-resoluciones/run-sync": {
      "post": {
        "operationId": "run-sync-crispish_guava-cnmc-resoluciones",
        "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": {
          "numeroExpediente": {
            "title": "Número de expediente",
            "type": "string",
            "description": "Número o slug de la ficha, p.ej. \"C/1740/26\", \"c174026\", \"S/0006/24\" o \"DT 2009/1658\". Si se indica, se ignoran el descubrimiento masivo y los demás filtros."
          },
          "startUrls": {
            "title": "URLs de ficha",
            "type": "array",
            "description": "Fichas ya conocidas, p.ej. https://www.cnmc.es/expedientes/c174026 (sin parámetros). Si se indican, no se hace descubrimiento.",
            "items": {
              "type": "string"
            }
          },
          "textoLibre": {
            "title": "Texto libre (filtro local)",
            "type": "string",
            "description": "Filtra por título, número de expediente o último resultado (sin distinguir mayúsculas ni tildes). Se aplica tras descargar cada ficha: las descartadas consumen peticiones pero no se cobran."
          },
          "fechaDesde": {
            "title": "Última actualización desde",
            "type": "string",
            "description": "aaaa-mm-dd. Se compara con la «Última actualización» de la ficha (si falta, con el lastmod del sitemap)."
          },
          "fechaHasta": {
            "title": "Última actualización hasta",
            "type": "string",
            "description": "aaaa-mm-dd. Si se deja vacío, hasta hoy."
          },
          "ambito": {
            "title": "Ámbito CNMC",
            "type": "string",
            "description": "Texto contenido en el ámbito, p.ej. Competencia, Energía, Telecomunicaciones, Audiovisual, Postal, Transporte, Promoción de Competencia, Unidad de Mercado, General."
          },
          "tipoProcedimiento": {
            "title": "Tipo / procedimiento",
            "type": "string",
            "description": "Texto contenido en el tipo o tipo de procedimiento, p.ej. Concentraciones, Conductas, Sancionadores, Informes, Conflictos, Recursos, Circulares."
          },
          "fuenteDescubrimiento": {
            "title": "Fuente de descubrimiento",
            "enum": [
              "auto",
              "listado",
              "sitemap"
            ],
            "type": "string",
            "description": "auto = portada del listado de Decisiones y después el sitemap; listado = solo la portada (las decisiones más recientes); sitemap = solo el sitemap público.",
            "default": "auto"
          },
          "maxItems": {
            "title": "Máximo de expedientes",
            "minimum": 0,
            "type": "integer",
            "description": "Número máximo de expedientes a guardar (por defecto 500). 0 = sin límite: el archivo completo son ~29.000 expedientes, así que sin filtros supone miles de peticiones a la CNMC (≥ 1 s cada una) y un coste alto. Úsalo solo con filtros acotados. El ejemplo de la Store (prefill) es 5, para que la prueba automática de Apify acabe en segundos; el valor por defecto sigue siendo 500.",
            "default": 500
          },
          "incremental": {
            "title": "Modo incremental",
            "type": "boolean",
            "description": "Solo devuelve expedientes nuevos o con una «Última actualización» distinta de la ya entregada en ejecuciones anteriores con la misma clave de estado.",
            "default": false
          },
          "incrementalStateKey": {
            "title": "Clave de estado incremental",
            "type": "string",
            "description": "Usa claves distintas para seguimientos distintos (p.ej. \"concentraciones\", \"energia\").",
            "default": "default"
          },
          "incrementalLookbackDays": {
            "title": "Ventana de revisión (días)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Días hacia atrás desde la última actualización conocida que se vuelven a revisar en modo incremental.",
            "default": 30
          },
          "redactPersonalData": {
            "title": "Enmascarar datos personales",
            "type": "boolean",
            "description": "Salvaguarda adicional: sustituye NIF/DNI, NIE, emails, teléfonos e IBAN por [DATO OMITIDO] en títulos, sujetos, cronología y nombres de documentos (las resoluciones ya se publican depuradas). No se tocan nombres de empresas.",
            "default": true
          },
          "requestDelaySecs": {
            "title": "Retardo entre peticiones (s)",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Tiempo mínimo entre peticiones a www.cnmc.es. Mínimo 1 s.",
            "default": 1
          },
          "maxConcurrency": {
            "title": "Concurrencia máxima",
            "minimum": 1,
            "maximum": 2,
            "type": "integer",
            "description": "Fichas descargadas en paralelo (máx. 2 por respeto al servidor público).",
            "default": 1
          },
          "maxRequestRetries": {
            "title": "Reintentos por petición",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Reintentos con backoff exponencial + jitter ante errores transitorios (5xx, 408, 429, red). Se respeta Retry-After.",
            "default": 4
          },
          "healthCheck": {
            "title": "Fallar si no hay resultados (health check)",
            "type": "boolean",
            "description": "Si está activo, la ejecución falla cuando no se extrae ningún expediente. Útil en una comprobación diaria programada.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Normalmente no es necesario."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}