{
  "openapi": "3.0.1",
  "info": {
    "title": "ESGF Search Harvester — CMIP6 / CORDEX Climate Data",
    "description": "Point at ANY ESGF federation node (LLNL, DKRZ, IPSL...) and harvest climate-model dataset/file records via the Search API. Facet-filter by project, model, experiment, variable, frequency. Modes: search, facets, wget file listing.",
    "version": "0.1",
    "x-build-id": "v9OWA2frRuKHXV8MQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~esgf-search-harvester/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-esgf-search-harvester",
        "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/datamule~esgf-search-harvester/runs": {
      "post": {
        "operationId": "runs-sync-datamule-esgf-search-harvester",
        "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/datamule~esgf-search-harvester/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-esgf-search-harvester",
        "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": {
          "nodes": {
            "title": "ESGF federation node(s)",
            "type": "array",
            "description": "One or more ESGF index nodes to query. Accepts a bare host or a full base URL; the '/esg-search' mount is assumed if omitted. Leave empty to query the default federation trio (LLNL, DKRZ, IPSL).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "facets",
              "wget"
            ],
            "type": "string",
            "description": "search = facet-filtered dataset/file query (paginated). facets = the controlled-vocabulary index (facet_counts) for the node. wget = the ESGF download script parsed into one row per file.",
            "default": "search"
          },
          "type": {
            "title": "Record type",
            "enum": [
              "Dataset",
              "File",
              "Any"
            ],
            "type": "string",
            "description": "Dataset = one row per dataset (aggregate). File = one row per .nc file (carries url + checksum). Any = do not constrain.",
            "default": "Dataset"
          },
          "project": {
            "title": "Project",
            "type": "array",
            "description": "e.g. CMIP6, CMIP5, CORDEX, obs4MIPs, input4MIPs, PMIP4. Empty = all projects on the node.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "experiment_id": {
            "title": "Experiment id",
            "type": "array",
            "description": "e.g. historical, ssp585, piControl, amip. CMIP experiment identifier(s).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "variable": {
            "title": "Variable",
            "type": "array",
            "description": "CMOR variable short name(s), e.g. tas, pr, psl, tos, siconc.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "frequency": {
            "title": "Frequency",
            "type": "array",
            "description": "e.g. mon, day, 6hr, yr, fx.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "source_id": {
            "title": "Source id (model)",
            "type": "array",
            "description": "Climate model identifier(s), e.g. EC-Earth3, CESM2, GFDL-ESM4, MPI-ESM1-2-HR.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "model": {
            "title": "Model (CMIP5 legacy)",
            "type": "array",
            "description": "Legacy CMIP5 model facet (use source_id for CMIP6).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "institution_id": {
            "title": "Institution id",
            "type": "array",
            "description": "Modelling-centre identifier(s), e.g. NCAR, MPI-M, EC-Earth-Consortium.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "activity_id": {
            "title": "Activity id",
            "type": "array",
            "description": "CMIP6 activity, e.g. CMIP, ScenarioMIP, DCPP, HighResMIP.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "variant_label": {
            "title": "Variant label",
            "type": "array",
            "description": "Ensemble member, e.g. r1i1p1f1.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "grid_label": {
            "title": "Grid label",
            "type": "array",
            "description": "e.g. gn, gr, gr1.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "realm": {
            "title": "Realm",
            "type": "array",
            "description": "e.g. atmos, ocean, land, seaIce.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "table_id": {
            "title": "Table id",
            "type": "array",
            "description": "CMOR table, e.g. Amon, day, Omon, fx.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "data_node": {
            "title": "Data node",
            "type": "array",
            "description": "Constrain to dataset(s) hosted on specific data node(s), e.g. esgf-data1.llnl.gov.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "Free-text query",
            "type": "string",
            "description": "Optional Solr free-text query applied on top of the facet filters.",
            "default": ""
          },
          "extraFacets": {
            "title": "Extra facet filters",
            "type": "object",
            "description": "Any additional facet constraints as {facet: [values]}, e.g. {\"nominal_resolution\": [\"100 km\"]}. Merged with the dedicated facet inputs above.",
            "default": {}
          },
          "facetFields": {
            "title": "Facet fields (facets mode)",
            "type": "array",
            "description": "Which facet fields to index when mode=facets.",
            "default": [
              "project",
              "experiment_id",
              "source_id",
              "variable",
              "frequency"
            ],
            "items": {
              "type": "string"
            }
          },
          "distrib": {
            "title": "Distributed (federated) search",
            "type": "boolean",
            "description": "If true, the node fans the query out across the whole federation (slower, can partially fail). Default false = query only the target node.",
            "default": false
          },
          "latestOnly": {
            "title": "Latest versions only",
            "type": "boolean",
            "description": "Restrict to the latest dataset version (latest=true). Recommended.",
            "default": true
          },
          "replica": {
            "title": "Replica handling",
            "enum": [
              "exclude",
              "include",
              "only"
            ],
            "type": "string",
            "description": "exclude = primary copies only (replica=false). include = both. only = replicas only.",
            "default": "exclude"
          },
          "maxRecords": {
            "title": "Max records (total)",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on total records across all nodes. 0 = no cap (harvest to completion — can be very large).",
            "default": 200
          },
          "pageSize": {
            "title": "Page size",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Records per request page (1-1000).",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}