{
  "openapi": "3.0.1",
  "info": {
    "title": "Panama Open Data Scraper - Datos Abiertos",
    "description": "Extract all 5,661 datasets from Panama's national open data portal with files, DataStore schemas and publisher contacts.",
    "version": "0.1",
    "x-build-id": "Ldq0c4OghGojzvmcA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parseforge~panama-open-data-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parseforge-panama-open-data-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/parseforge~panama-open-data-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parseforge-panama-open-data-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/parseforge~panama-open-data-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parseforge-panama-open-data-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",
        "properties": {
          "dataset": {
            "title": "What to scrape",
            "enum": [
              "datasets",
              "resources",
              "datastore-tables",
              "contacts",
              "organizations",
              "categories",
              "tags",
              "formats",
              "licenses",
              "frequencies"
            ],
            "type": "string",
            "description": "Which collection to extract. \"Datasets\" is the catalogue itself (one row per dataset). The other collections are the portal directories and the DataStore tables behind the files.",
            "default": "datasets"
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Full text search across titles, descriptions and tags, for example \"planilla\" or \"migracion\". Leave empty to take the whole catalogue."
          },
          "startUrls": {
            "title": "Dataset URLs",
            "type": "array",
            "description": "Optional. Paste datosabiertos.gob.pa dataset links to scrape exactly those datasets and skip the search. Overrides the query and the filters.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Free users: limited to 10 items (preview). Paid users: up to 1,000,000."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "modified-desc",
              "modified-asc",
              "created-desc",
              "created-asc",
              "title-asc",
              "title-desc",
              "name-asc",
              "name-desc"
            ],
            "type": "string",
            "description": "Result order. Only these orders are honoured by the portal; anything else silently falls back to relevance.",
            "default": "relevance"
          },
          "organizations": {
            "title": "Publishing organizations",
            "type": "array",
            "description": "Keep only datasets published by these bodies. The number in brackets is the live dataset count.",
            "items": {
              "type": "string",
              "enum": [
                "caja-de-seguro-social",
                "servicio-nacional-de-migracion",
                "autoridad-maritima-de-panama-amp",
                "autoridad-nacional-para-la-innovacion-gubernamental-aig",
                "instituto-panameno-de-habilitacion-especial-iphe",
                "ministerio-de-gobierno",
                "autoridad-de-los-recursos-acuaticos-de-panama",
                "autoridad-nacional-de-los-servicios-publicos",
                "sistema-estatal-de-radio-y-television",
                "instituto-nacional-de-estadistica-y-censo",
                "contraloria-general-de-la-republica",
                "tocumen-aeropuerto-internacional-de-panama",
                "superintendencia-de-seguros-y-reaseguros-de-panama",
                "fiscalia-general-de-cuentas",
                "registro-publico",
                "municipio-de-panama",
                "autoridad-de-proteccion-al-consumidor-y-defensa-de-la-competencia",
                "municipio-de-san-carlos",
                "superintendencia-de-bancos-de-panama-sbp",
                "procuraduria-general-de-la-nacion",
                "tribunal-electoral",
                "ministerio-de-economia-y-finanzas-mef",
                "procuraduria-de-la-administracion",
                "tribunal-administrativo-tributario",
                "superintendencia-del-mercado-de-valores",
                "empresa-nacional-de-autopista",
                "instituto-para-la-formacion-y-aprovechamiento-de-recursos-humanos-ifarhu",
                "hospital-del-nino",
                "instituto-de-mercadeo-agropecuario-ima",
                "municipio-de-tonosi",
                "municipio-de-nata",
                "autoridad-de-pasaportes-de-panama-apap",
                "organo-judicial",
                "ministerio-de-vivienda-y-ordenamiento-territorial",
                "universidad-maritima-internacional-de-panama-umip",
                "autoridad-nacional-de-transparencia-y-acceso-a-la-informacion-antai",
                "mercados-nacionales-de-la-cadena-de-frio-s-a",
                "municipio-de-la-chorrera",
                "municipio-de-chitre",
                "metro-de-panama",
                "caja-de-ahorros-ca",
                "autoridad-de-aseo-urbano-y-domiciliario-aaud",
                "ministerio-de-desarrollo-social-mides",
                "ministerio-de-desarrollo-agropecuario-mida",
                "secretaria-nacional-de-ciencia-tecnologia-e-innovacion-senacyt",
                "ministerio-de-educacion-meduca",
                "universidad-tecnologica-de-panama-utp",
                "ministerio-de-la-presidencia",
                "autoridad-de-aeronautica-civil-de-panama",
                "universidad-de-panama",
                "instituto-de-acueductos-y-alcantarillados-nacionales",
                "instituto-oncologico-nacional-ion",
                "tribunal-de-cuentas",
                "sistema-de-ahorro-y-capitalizacion-de-pensiones-de-los-servidores-publicos",
                "ministerio-de-ambiente-de-panama-miambiente",
                "asamblea-nacional-de-panama",
                "ministerio-de-trabajo-y-desarrollo-laboral-mitradel",
                "instituto-de-investigacion-agropecuaria-de-panama-idiap",
                "instituto-nacional-de-formacion-profesional-y-capacitacion-para-el-desarrollo-humano",
                "defensoria-del-pueblo",
                "autoridad-de-la-micro-pequena-y-mediana-empresa-ampyme",
                "municipio-de-chepo",
                "municipio-de-chame",
                "fiscalia-general-electoral",
                "benemerito-cuerpo-de-bomberos-de-panama",
                "municipio-de-anton",
                "ministerio-de-obras-publicas-mop",
                "junta-comunal-de-parque-lefevre",
                "municipio-de-montijo",
                "institugraf",
                "banco-hipotecario-nacional"
              ],
              "enumTitles": [
                "Caja de Seguro Social (688)",
                "Servicio Nacional de Migración (531)",
                "Autoridad Maritima de Panamá (353)",
                "Autoridad Nacional para la Innovación Gubernamental - AIG (304)",
                "Instituto Panameño de Habilitacion Especial (IPHE) (297)",
                "Ministerio de Gobierno (230)",
                "Autoridad de los Recursos Acuaticos de Panamá (230)",
                "Autoridad Nacional de los Servicios Públicos (227)",
                "Sistema Estatal de Radio y Televisión (207)",
                "Instituto Nacional de Estadística y Censo (194)",
                "Contraloria General de la República (153)",
                "Tocumen Aeropuerto Internacional de Panamá (139)",
                "Superintendencia de Seguros y Reaseguros de Panamá (136)",
                "Fiscalía General de Cuentas (136)",
                "Registro Publico (132)",
                "Municipio de Panamá (129)",
                "Autoridad de Protección al Consumidor y Defensa de la Competencia (127)",
                "Municipio de San Carlos (92)",
                "Superintendencia de Bancos de Panamá (76)",
                "Procuraduria General de la Nación (75)",
                "Tribunal Electoral (72)",
                "Ministerio de Económia y Finanzas (MEF) (71)",
                "Procuraduria de la Administración (70)",
                "Tribunal Administrativo Tributario (69)",
                "Superintendencia del Mercado de Valores (67)",
                "Empresa Nacional de Autopista (67)",
                "Instituto para la Formación y Aprovechamiento de Recursos Humanos (IFARHU) (65)",
                "Hospital del Niño (63)",
                "Instituto de Mercadeo Agropecuario (60)",
                "Municipio de Tonosí (46)",
                "Municipio de Nata (45)",
                "Autoridad de Pasaportes de Panamá (44)",
                "Organo Judicial (40)",
                "Ministerio de Vivienda y Ordenamiento Territorial (40)",
                "Universidad Maritima Internacional de Panamá - UMIP (35)",
                "Autoridad Nacional de Transparencia y Acceso a la Información - Antai (35)",
                "Mercados Nacionales de la Cadena de Frío S,A. (33)",
                "Municipio de la Chorrera (20)",
                "Municipio de Chitré (20)",
                "Metro de Panamá (20)",
                "Caja de Ahorros (19)",
                "Autoridad de Aseo Urbano y Domiciliario AAUD (18)",
                "Ministerio de Desarrollo Social (MIDES) (17)",
                "Ministerio de Desarrollo Agropecuario (16)",
                "Secretaría Nacional de Ciencia, Tecnología e Innovación - SENACYT (15)",
                "Ministerio de Educación (MEDUCA) (15)",
                "Universidad Tecnologica de Panama - UTP (13)",
                "Ministerio de la Presidencia (13)",
                "Autoridad de aeronautica civil de Panamá (12)",
                "Universidad de Panamá (8)",
                "Instituto de Acueductos y Alcantarillados Nacionales (7)",
                "Instituto Oncológico Nacional (7)",
                "Tribunal de Cuentas (6)",
                "Sistema de Ahorro y Capitalización de Pensiones de los Servidores Públicos (6)",
                "Ministerio de Ambiente (5)",
                "Asamblea Nacional de Panamá (5)",
                "Ministerio de Trabajo y Desarrollo Laboral (4)",
                "Instituto de Investigación Agropecuaria de Panama (IDIAP) (4)",
                "Instituto Nacional de Formacion Profesional y Capacitación para el Desarrollo Humano (4)",
                "Defensoría del Pueblo (4)",
                "Autoridad de la Micro, Pequeña y Mediana Empresa - Ampyme (4)",
                "Municipio de Chepo (3)",
                "Municipio de Chame (3)",
                "Fiscalia General Electoral (3)",
                "Benemerito Cuerpo de Bomberos de Panamá (3)",
                "Municipio de Antón (2)",
                "Ministerio de Obras Públicas (2)",
                "Junta Comunal de Parque Lefevre (2)",
                "Municipio de Montijo (1)",
                "Institugraf (1)",
                "Banco Hipotecario Nacional (1)"
              ]
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Keep only datasets in these portal categories (CKAN groups).",
            "items": {
              "type": "string",
              "enum": [
                "estadisticas-de-gobierno",
                "gobierno-finanzas",
                "salud",
                "transporte-y-logistica",
                "servicios-publicos",
                "municipios",
                "agropecuario",
                "centro-bancario-internacional-actividades-de-la-banca-intermediacion-financiera",
                "innovacion-y-tecnologia",
                "educacion",
                "justicia",
                "anticorrupcion-pida",
                "ambiente",
                "orden-publico-y-seguridad",
                "social-desarrollo",
                "landuse",
                "comercio-e-industrias"
              ],
              "enumTitles": [
                "Estadísticas de Gobierno (2714)",
                "Finanzas de Gobierno (1960)",
                "Salud (183)",
                "Transporte y Logística (168)",
                "Servicios Públicos (166)",
                "Gobiernos Locales (155)",
                "Agropecuario y Pesca (117)",
                "Banca y Finanzas (105)",
                "Innovación y Tecnología (96)",
                "Educación (93)",
                "Justicia (84)",
                "Anticorrupción - PIDA (19)",
                "Ambiente (19)",
                "Orden Público y Seguridad Orden Público y Seguridad (16)",
                "Desarrollo Social (16)",
                "Vivienda y Ordenamiento Territorial (7)",
                "Comercio e Industrias (5)"
              ]
            }
          },
          "tags": {
            "title": "Tags",
            "type": "array",
            "description": "Keep only datasets carrying these tags, for example \"planilla\" or \"salud\". Free text, matched exactly against the portal tag list.",
            "items": {
              "type": "string"
            }
          },
          "formats": {
            "title": "File formats",
            "type": "array",
            "description": "Keep only datasets that publish at least one file in these formats. In the Resources collection it also filters the individual files.",
            "items": {
              "type": "string",
              "enum": [
                "CSV",
                "PDF",
                "XLSX",
                "XLS"
              ],
              "enumTitles": [
                "CSV (5659)",
                "PDF (5658)",
                "XLSX (5056)",
                "XLS (674)"
              ]
            }
          },
          "licenses": {
            "title": "Licenses",
            "type": "array",
            "description": "Keep only datasets under these licenses.",
            "items": {
              "type": "string",
              "enum": [
                "cc-by",
                "cc-zero",
                "other-open",
                "cc-by-sa"
              ],
              "enumTitles": [
                "Creative Commons Attribution (3881)",
                "Creative Commons CCZero (1757)",
                "Otra (Abierta) (1)",
                "Creative Commons Attribution Share-Alike (1)"
              ]
            }
          },
          "frequencies": {
            "title": "Update frequency",
            "type": "array",
            "description": "Keep only datasets the publisher declares on this cadence. This is the portal Frecuencia de Publicacion field.",
            "items": {
              "type": "string",
              "enum": [
                "Mensual",
                "Trimestral",
                "Anual",
                "Semestral",
                "Cuatrimestral",
                "Bimensual"
              ],
              "enumTitles": [
                "Mensual (1284)",
                "Trimestral (257)",
                "Anual (189)",
                "Semestral (163)",
                "Cuatrimestral (10)",
                "Bimensual (9)"
              ]
            }
          },
          "modifiedAfter": {
            "title": "Updated after",
            "type": "string",
            "description": "Keep only datasets whose metadata changed on or after this date. Format YYYY-MM-DD."
          },
          "createdAfter": {
            "title": "Created after",
            "type": "string",
            "description": "Keep only datasets first published on or after this date. Format YYYY-MM-DD."
          },
          "minResources": {
            "title": "Minimum files per dataset",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Keep only datasets that ship at least this many downloadable files. Leave empty for no minimum."
          },
          "titleContains": {
            "title": "Title contains",
            "type": "string",
            "description": "Keep only datasets whose title matches this word, for example \"migracion\"."
          },
          "notesContains": {
            "title": "Description contains",
            "type": "string",
            "description": "Keep only datasets whose description matches this word."
          },
          "authorContains": {
            "title": "Author contains",
            "type": "string",
            "description": "Keep only datasets whose author field matches this name or department."
          },
          "onlyOpenLicense": {
            "title": "Open licenses only",
            "type": "boolean",
            "description": "Keep only datasets the portal flags as an open license (5,640 of 5,661).",
            "default": false
          },
          "onlyWithDatastore": {
            "title": "Only datasets with a queryable DataStore table",
            "type": "boolean",
            "description": "Keep only datasets with at least one file loaded into the portal DataStore, so the data is queryable row by row rather than only downloadable. Applied after the search, since the portal index does not expose this flag.",
            "default": false
          },
          "includeDatasetResources": {
            "title": "Include the file list on each dataset row",
            "type": "boolean",
            "description": "Adds a nested resources array to every dataset row with each downloadable file, its format, size and download URL. Billed as dataset-resources.",
            "default": false
          },
          "includeQualityScore": {
            "title": "Include a metadata quality score",
            "type": "boolean",
            "description": "Adds a 0 to 100 completeness score, an A to F grade and the list of failed checks (missing description, license, tags, contact, frequency, broken file entries). Billed as quality-score.",
            "default": false
          },
          "includeLinkCheck": {
            "title": "Check that each file actually downloads",
            "type": "boolean",
            "description": "Resources collection only. Sends a HEAD request per file and adds the HTTP status, content type and content length. Billed as link-check. Slower.",
            "default": false
          },
          "includeDatastoreSchema": {
            "title": "Include the DataStore table schema",
            "type": "boolean",
            "description": "Resources collection only. Adds the column names, PostgreSQL types and the exact row count for files loaded into the DataStore. Billed as datastore-schema.",
            "default": false
          },
          "includeDatastorePreview": {
            "title": "Include sample rows from the DataStore",
            "type": "boolean",
            "description": "Adds real data rows from inside each DataStore table, not just the metadata. Applies to the Resources and DataStore tables collections. Billed as datastore-preview.",
            "default": false
          },
          "datastorePreviewRows": {
            "title": "Sample rows per table",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many rows to pull when the DataStore preview block is on.",
            "default": 5
          },
          "includeOrganizationProfile": {
            "title": "Include the publishing body profile",
            "type": "boolean",
            "description": "Adds the organization total dataset count, follower count, logo and full description. Billed as organization-profile, once per organization then cached.",
            "default": false
          },
          "includeCategoryProfile": {
            "title": "Include the category profile",
            "type": "boolean",
            "description": "Adds the category description, logo and total dataset count. Billed as category-profile, once per category then cached.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}