{
  "openapi": "3.0.1",
  "info": {
    "title": "WHO Global Health Observatory Data Search",
    "description": "Search the World Health Organization's Global Health Observatory for health statistics across 194 member countries.",
    "version": "1.0",
    "x-build-id": "i5fn8yD7bcAN3xcoK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~who-gho-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-who-gho-search",
        "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/ryanclinton~who-gho-search/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-who-gho-search",
        "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/ryanclinton~who-gho-search/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-who-gho-search",
        "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": [
          "indicator"
        ],
        "properties": {
          "indicator": {
            "title": "Indicator",
            "type": "string",
            "description": "Indicator code (e.g. 'WHOSIS_000001' for life expectancy), keyword (e.g. 'mortality'), or comma-separated codes (e.g. 'WHOSIS_000001,WHOSIS_000002'). In list mode, enter a keyword to browse matching indicators or '*' for all."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "list",
              "trend",
              "compare",
              "top",
              "benchmark",
              "scorecard",
              "dataset",
              "multi_dataset",
              "auto"
            ],
            "type": "string",
            "description": "search = raw data rows. list = browse indicators. trend = time series with CAGR. compare = country ranking. top = Top N. benchmark = vs peer group. scorecard = composite score. dataset = panel matrix (country x year). multi_dataset = cross-indicator matrix. auto = detect from WHO URL.",
            "default": "search"
          },
          "preset": {
            "title": "Preset",
            "enum": [
              "",
              "country_health_snapshot",
              "maternal_child_health",
              "infectious_disease",
              "health_system",
              "mortality_overview"
            ],
            "type": "string",
            "description": "One-click preset that auto-selects indicators and mode for common analyses. Overrides the indicator field. country_health_snapshot = life expectancy + neonatal mortality + obesity + immunization. maternal_child_health = maternal mortality + neonatal mortality + immunization + child wasting. infectious_disease = TB + malaria + measles + HIV trends. health_system = physicians + hospital beds + health spend + UHC index. mortality_overview = life expectancy + healthy life expectancy + adult mortality."
          },
          "topN": {
            "title": "Top N",
            "minimum": 1,
            "maximum": 194,
            "type": "integer",
            "description": "Number of top countries to return (only applies in 'top' mode).",
            "default": 10
          },
          "sortBy": {
            "title": "Sort By",
            "enum": [
              "value",
              "year",
              "country",
              "growth"
            ],
            "type": "string",
            "description": "Sort results by: value (highest first), year (newest first), country (alphabetical), or growth (highest YoY change first).",
            "default": "value"
          },
          "benchmark": {
            "title": "Benchmark Against",
            "enum": [
              "peer_group_mean",
              "peer_group_median",
              "top_quartile"
            ],
            "type": "string",
            "description": "In benchmark mode, compare each country against this reference point.",
            "default": "peer_group_mean"
          },
          "weights": {
            "title": "Scorecard Weights",
            "type": "array",
            "description": "Custom weights for scorecard mode. One number per indicator (in order). Numbers are normalized to sum to 1. E.g. [0.5, 0.3, 0.2] weights the first indicator at 50%. Leave empty for equal weights.",
            "items": {
              "type": "number"
            }
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "standard",
              "chart"
            ],
            "type": "string",
            "description": "standard = normal dataset rows. chart = Chart.js/Plotly-ready JSON with labels and datasets arrays.",
            "default": "standard"
          },
          "country": {
            "title": "Country Code",
            "type": "string",
            "description": "ISO 3-letter country code to filter (e.g. 'USA', 'GBR', 'JPN'). Leave empty for all countries."
          },
          "countries": {
            "title": "Multiple Countries",
            "maxItems": 50,
            "type": "array",
            "description": "Compare multiple countries side-by-side. Enter ISO 3-letter codes.",
            "items": {
              "type": "string"
            }
          },
          "countryGroup": {
            "title": "Country Group",
            "enum": [
              "",
              "EU",
              "G7",
              "G20",
              "BRICS",
              "OECD",
              "NORDIC",
              "ASEAN"
            ],
            "type": "string",
            "description": "Predefined group of countries for quick comparison. Overrides individual country fields."
          },
          "region": {
            "title": "WHO Region",
            "enum": [
              "",
              "AFR",
              "AMR",
              "SEAR",
              "EUR",
              "EMR",
              "WPR"
            ],
            "type": "string",
            "description": "Filter by WHO region instead of individual countries."
          },
          "lastNYears": {
            "title": "Last N Years",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Convenience filter: fetch data from the last N years (e.g. 5 = last 5 years). Overrides Year From if both are set."
          },
          "yearFrom": {
            "title": "Year From",
            "type": "integer",
            "description": "Start year for filtering results (e.g. 2010). Overridden by Last N Years if set."
          },
          "yearTo": {
            "title": "Year To",
            "type": "integer",
            "description": "End year for filtering results (e.g. 2023)"
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum number of raw records to fetch from WHO API (before analytics processing).",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}