{
  "openapi": "3.0.1",
  "info": {
    "title": "INE España: Estadísticas Oficiales & Series Temporales",
    "description": "Scraper y API del INE (Instituto Nacional de Estadística de España). Extrae IPC, Inflación, Empleo/EPA, Precios Vivienda (IPV), Hipotecas, Población, PIB y series temporales normalizadas.",
    "version": "0.0",
    "x-build-id": "5EWiEOq2A568TwEox"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datacraft_studio~ine-spain-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datacraft_studio-ine-spain-scraper",
        "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/datacraft_studio~ine-spain-scraper/runs": {
      "post": {
        "operationId": "runs-sync-datacraft_studio-ine-spain-scraper",
        "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/datacraft_studio~ine-spain-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-datacraft_studio-ine-spain-scraper",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Modo de Extracción",
            "enum": [
              "PRESET",
              "SEARCH",
              "CUSTOM_OPERATION",
              "CUSTOM_TABLE",
              "DIRECT_URLS",
              "OPERATIONS_CATALOG"
            ],
            "type": "string",
            "description": "Selecciona cómo deseas obtener los datos del INE: por presets de alto impacto, búsqueda semántica, código de operación/tabla o catálogo.",
            "default": "PRESET"
          },
          "presetOperation": {
            "title": "Indicador Preconfigurado (Preset)",
            "enum": [
              "IPC",
              "EPA",
              "IPV",
              "HIPOTECAS",
              "PADRON",
              "PIB",
              "TRANSMISIONES",
              "TURISMO",
              "SALARIOS",
              "EMPRESAS"
            ],
            "type": "string",
            "description": "Elige el indicador económico o demográfico clave que deseas extraer.",
            "default": "IPC"
          },
          "searchQuery": {
            "title": "Búsqueda por Palabras Clave",
            "type": "string",
            "description": "Términos de búsqueda para descubrir operaciones y tablas estadísticas (ej: 'alquiler', 'vehículos', 'natalidad', 'comercio', 'hoteles')."
          },
          "operationCode": {
            "title": "Código de Operación Tempus3",
            "type": "string",
            "description": "Código alfanumérico oficial de la operación en INE (ej: 'IPC', 'IPV', 'EPA', 'ETDP', 'EI', 'ICLA')."
          },
          "tableId": {
            "title": "ID de Tabla Específica",
            "type": "string",
            "description": "Identificador numérico de tabla estadística del INE (ej: 24077 para IPC general, 50902 para precios de vivienda)."
          },
          "directUrls": {
            "title": "URLs Directas de INE",
            "type": "array",
            "description": "Lista de enlaces de tablas o datos de ine.es (ej: https://www.ine.es/jaxiT3/Tabla.htm?t=50902)."
          },
          "periodsCount": {
            "title": "Número de Últimos Periodos (nult)",
            "minimum": 0,
            "maximum": 1200,
            "type": "integer",
            "description": "Cantidad de últimos periodos cronológicos a extraer para cada serie (ej: 12 para el último año mensual, 4 para últimos 4 trimestres, 0 para todo el histórico).",
            "default": 12
          },
          "dateFrom": {
            "title": "Fecha Desde (Opcional - YYYY-MM-DD)",
            "type": "string",
            "description": "Filtrar observaciones a partir de esta fecha en formato YYYY-MM-DD (ej: 2023-01-01)."
          },
          "dateTo": {
            "title": "Fecha Hasta (Opcional - YYYY-MM-DD)",
            "type": "string",
            "description": "Filtrar observaciones hasta esta fecha en formato YYYY-MM-DD (ej: 2026-12-31)."
          },
          "maxTables": {
            "title": "Límite Máximo de Tablas por Operación",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Límite de tablas estadísticas a procesar por operación para evitar consumos desmedidos en operaciones gigantescas.",
            "default": 5
          },
          "maxItems": {
            "title": "Límite Máximo de Registros (Dataset Items)",
            "minimum": 0,
            "type": "integer",
            "description": "Número máximo de observaciones a guardar en el dataset (0 para sin límite).",
            "default": 1000
          },
          "proxyConfiguration": {
            "title": "Configuración de Proxies",
            "type": "object",
            "description": "Configuración de Proxies de Apify para rotación de IPs y máxima estabilidad.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}