{
  "openapi": "3.0.1",
  "info": {
    "title": "SDMX Statistics Extractor",
    "description": "Point at ANY SDMX 2.1 statistical service (ECB, OECD, Eurostat, IMF, BIS, World Bank, ABS…): name a dataflow + dimension key and get flat, fully labeled observation rows. Decodes the compact index-encoded SDMX-JSON (1.0 & 2.0 envelopes). Discovery mode lists dataflows. Pay per observation.",
    "version": "0.1",
    "x-build-id": "gQWsHNgF25c3QmLdh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~sdmx-statistics-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-sdmx-statistics-extractor",
        "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~sdmx-statistics-extractor/runs": {
      "post": {
        "operationId": "runs-sync-datamule-sdmx-statistics-extractor",
        "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~sdmx-statistics-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-sdmx-statistics-extractor",
        "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": [
          "serviceRoot"
        ],
        "properties": {
          "serviceRoot": {
            "title": "SDMX service root URL",
            "type": "string",
            "description": "The REST service root of ANY SDMX 2.1 statistical service, WITHOUT a trailing /data. Examples: https://data-api.ecb.europa.eu/service (European Central Bank) or https://sdmx.oecd.org/public/rest (OECD). Also works with Eurostat, IMF, BIS, World Bank, ABS and other SDMX-JSON services."
          },
          "agency": {
            "title": "Agency ID",
            "type": "string",
            "description": "The maintaining agency of the dataflow, e.g. ECB, or an OECD agency like OECD.ECO.MAD. Leave empty to let the service default it. Used to build the flow reference agency,dataflow,version."
          },
          "dataflow": {
            "title": "Dataflow ID",
            "type": "string",
            "description": "The dataflow (dataset) id to query, e.g. EXR (ECB exchange rates). Turn on \"List dataflows only\" below to discover the dataflows a service exposes. Required unless listing dataflows."
          },
          "version": {
            "title": "Dataflow version",
            "type": "string",
            "description": "The dataflow version, e.g. 1.0, or latest to always use the newest. Leave empty to omit the version slot (the service picks the default). Only meaningful together with an Agency ID."
          },
          "key": {
            "title": "Series key (dimension filter)",
            "type": "string",
            "description": "The dot-joined dimension filter that selects series, e.g. D.USD.EUR.SP00.A for ECB EXR (FREQ.CURRENCY.CURRENCY_DENOM.EXR_TYPE.EXR_SUFFIX). Leave EMPTY to fetch every series in the dataflow (can be very large). A position can be left blank to wildcard it (e.g. D..EUR.SP00.A) and + can OR values (e.g. D.USD+GBP.EUR.SP00.A)."
          },
          "startPeriod": {
            "title": "Start period",
            "type": "string",
            "description": "Optional start of the time range, in the dataflow's period format: a year (2020), quarter (2020-Q1), month (2020-01) or day (2024-01-01). Leave empty for no lower bound."
          },
          "endPeriod": {
            "title": "End period",
            "type": "string",
            "description": "Optional end of the time range (same formats as Start period). Leave empty for no upper bound."
          },
          "lastNObservations": {
            "title": "Last N observations",
            "minimum": 1,
            "type": "integer",
            "description": "Optional: keep only the most recent N observations per series (SDMX lastNObservations). Handy for \"latest value\" pulls. Leave empty to keep all in the period."
          },
          "firstNObservations": {
            "title": "First N observations",
            "minimum": 1,
            "type": "integer",
            "description": "Optional: keep only the first N observations per series (SDMX firstNObservations). Leave empty to keep all."
          },
          "detail": {
            "title": "Detail level",
            "enum": [
              "",
              "full",
              "dataonly",
              "serieskeysonly",
              "nodata"
            ],
            "type": "string",
            "description": "Optional SDMX detail level. full = data + all attributes (default), dataonly = values without attributes, serieskeysonly / nodata = structure only. Leave empty for the service default.",
            "default": ""
          },
          "dimensionAtObservation": {
            "title": "Dimension at observation",
            "type": "string",
            "description": "Advanced: how observations are grouped. Leave empty for the default (TIME_PERIOD, series-keyed). AllDimensions returns a flat observation map. Both are decoded transparently either way."
          },
          "listDataflowsOnly": {
            "title": "List dataflows only (discovery)",
            "type": "boolean",
            "description": "When on, ignore the query and instead list the dataflows the service exposes (id, agency, version, name) so you can find what to query. Hits {serviceRoot}/dataflow/{agency|all}/all/latest as SDMX-JSON. Some services only serve structure as XML — then this returns 0 rows and says so.",
            "default": false
          },
          "maxRecords": {
            "title": "Max records",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap on the number of rows emitted (observations, or dataflows in discovery mode). Each emitted observation is one billable record. Leave empty to emit everything the query returns.",
            "default": 25
          },
          "bearer": {
            "title": "Bearer token",
            "type": "string",
            "description": "Optional bearer token for gated SDMX services (sent as Authorization: Bearer <token>). Not required for public services (ECB, OECD, Eurostat…). Never logged."
          },
          "extraHeaders": {
            "title": "Extra request headers",
            "type": "object",
            "description": "Optional extra HTTP headers as a JSON object, e.g. {\"Ocp-Apim-Subscription-Key\": \"...\"} for gated services. Not required for public APIs. Header values are never logged."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}