{
  "openapi": "3.0.1",
  "info": {
    "title": "Australia Open Data Studio — Gov Data Joins",
    "description": "Value layer on Australia's official open data API (data.gov.au): 6 cross-dataset join presets (Energy & Climate, Material Consumption, Innovation & Industry, Tourism & Aid, Society & Road Safety, Threatened Species) + custom joins, CSV/JSON/XLSX delivery, AI-ready output with CC BY 4.0 attribution.",
    "version": "0.1",
    "x-build-id": "V5KkQgJl2up66L4u7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/subimpact~au-open-data-studio/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-subimpact-au-open-data-studio",
        "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/subimpact~au-open-data-studio/runs": {
      "post": {
        "operationId": "runs-sync-subimpact-au-open-data-studio",
        "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/subimpact~au-open-data-studio/run-sync": {
      "post": {
        "operationId": "run-sync-subimpact-au-open-data-studio",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "studio",
              "extract"
            ],
            "type": "string",
            "description": "studio = value layer (presets, joins, AI-ready package). extract = raw data pull of 1-5 datasets by ID (cheaper per-pull event).",
            "default": "studio"
          },
          "datasetIds": {
            "title": "Extract — dataset IDs",
            "type": "array",
            "description": "For mode=extract: list of data.gov.au datastore resource ids (UUIDs) to pull raw (1-5). Leave empty to use studio mode.",
            "items": {
              "type": "string"
            }
          },
          "preset": {
            "title": "Preset bundle",
            "enum": [
              "A1",
              "A2",
              "A3",
              "A4",
              "A5",
              "A6",
              "custom"
            ],
            "type": "string",
            "description": "Join bundle. A1 = Energy & Climate by Year. A2 = Material Consumption by Year. A3 = Innovation & Industry by Year. A4 = Tourism & Aid by Year. A5 = Society & Road Safety by Year. A6 = Threatened Species by Year. custom = bring your own dataset ids.",
            "default": "A1"
          },
          "customDatasets": {
            "title": "Custom join — dataset IDs",
            "type": "array",
            "description": "For preset=custom: list of data.gov.au datastore resource ids (UUIDs) to join (2-6). Leave empty to use a preset.",
            "items": {
              "type": "string"
            }
          },
          "customKey": {
            "title": "Custom join — key columns",
            "type": "array",
            "description": "For preset=custom: key parts to join on. Use 'year' (auto-extracted from year/Calendar year/Date/FY fields) or raw field names. All datasets must share these keys.",
            "default": [
              "year"
            ],
            "items": {
              "type": "string"
            }
          },
          "customJoinType": {
            "title": "Custom join — join type",
            "enum": [
              "inner",
              "left"
            ],
            "type": "string",
            "description": "inner keeps only keys present in every dataset; left keeps all keys from the first dataset.",
            "default": "inner"
          },
          "customParams": {
            "title": "Custom join — API filters (JSON)",
            "type": "string",
            "description": "For preset=custom: JSON object of extra API params applied to every dataset, e.g. {\"filters\": {\"Servicetype\": \"LDC\"}}."
          },
          "customAgg": {
            "title": "Custom join — aggregation",
            "enum": [
              "none",
              "sum",
              "mean"
            ],
            "type": "string",
            "description": "none = keep raw rows (last value per key). sum = aggregate numeric values per key. mean = average numeric values per key.",
            "default": "none"
          },
          "format": {
            "title": "Output format",
            "enum": [
              "json",
              "csv",
              "xlsx"
            ],
            "type": "string",
            "description": "File format delivered to the key-value store (dataset records are always JSON).",
            "default": "json"
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "POST the result file to this URL after the run (3 retries with backoff). Leave empty to skip."
          },
          "aiReady": {
            "title": "AI-ready package",
            "type": "boolean",
            "description": "Also emit JSON Schema + data dictionary + sample rows for LLM/RAG ingestion.",
            "default": true
          },
          "includeAttribution": {
            "title": "Include attribution",
            "type": "boolean",
            "description": "Attach source/licence metadata sidecar to every output (CC BY 4.0).",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}