{
  "openapi": "3.0.1",
  "info": {
    "title": "Census ACS Table Downloader",
    "description": "Download Census ACS-style table variables for configured years, geographies, and table IDs into normalized rows with estimates, margins of error, labels, and geography metadata.",
    "version": "1.0",
    "x-build-id": "hfNwHRKVb1egkAXlU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/junipr~census-acs-table-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-junipr-census-acs-table-downloader",
        "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/junipr~census-acs-table-downloader/runs": {
      "post": {
        "operationId": "runs-sync-junipr-census-acs-table-downloader",
        "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/junipr~census-acs-table-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-junipr-census-acs-table-downloader",
        "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": {
          "apiKey": {
            "title": "API Key",
            "type": "string",
            "description": "Optional API key for sources that require authenticated access. Do not include secrets in public task examples.",
            "default": ""
          },
          "survey": {
            "title": "Survey",
            "type": "string",
            "description": "Survey controls Census ACS Table Downloader processing for the supplied inputs; keep values conservative for first runs.",
            "default": "acs5"
          },
          "years": {
            "title": "Years",
            "type": "array",
            "description": "Years controls Census ACS Table Downloader processing for the supplied inputs; keep values conservative for first runs.",
            "items": {
              "type": "integer"
            },
            "default": [
              2024
            ]
          },
          "tableIds": {
            "title": "Table IDs",
            "type": "array",
            "description": "Table IDs controls Census ACS Table Downloader processing for the supplied inputs; keep values conservative for first runs.",
            "items": {
              "type": "string"
            },
            "default": [
              "B01001"
            ]
          },
          "variables": {
            "title": "Variables",
            "type": "array",
            "description": "Variables controls Census ACS Table Downloader processing for the supplied inputs; keep values conservative for first runs.",
            "items": {
              "type": "string"
            },
            "default": [
              "B01001_001E"
            ]
          },
          "geographies": {
            "title": "Geographies",
            "type": "array",
            "description": "Geographies controls Census ACS Table Downloader processing for the supplied inputs; keep values conservative for first runs.",
            "items": {
              "type": "string"
            },
            "default": [
              "county:001"
            ]
          },
          "stateFips": {
            "title": "State Fips",
            "type": "array",
            "description": "State Fips controls Census ACS Table Downloader processing for the supplied inputs; keep values conservative for first runs.",
            "items": {
              "type": "string"
            },
            "default": [
              "47"
            ]
          },
          "countyFips": {
            "title": "County Fips",
            "type": "array",
            "description": "County Fips controls Census ACS Table Downloader processing for the supplied inputs; keep values conservative for first runs.",
            "items": {
              "type": "string"
            },
            "default": [
              "001"
            ]
          },
          "tracts": {
            "title": "Tracts",
            "type": "array",
            "description": "Tracts controls Census ACS Table Downloader processing for the supplied inputs; keep values conservative for first runs.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "includeMarginsOfError": {
            "title": "Include Margins Of Error",
            "type": "boolean",
            "description": "Include margins of error in output rows or reports when available.",
            "default": false
          },
          "includeVariableLabels": {
            "title": "Include Variable Labels",
            "type": "boolean",
            "description": "Include variable labels in output rows or reports when available.",
            "default": true
          },
          "outputWideFormat": {
            "title": "Output Wide Format",
            "type": "boolean",
            "description": "Output option controlling how Census ACS Table Downloader writes results or reports.",
            "default": true
          },
          "maxRequests": {
            "title": "Max Requests",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum requests to process in one run; keep defaults low for safe first runs.",
            "default": 1
          },
          "timeoutMs": {
            "title": "Timeout ms",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum time in milliseconds allowed for the Census ACS Table Downloader operation before it is treated as timed out.",
            "default": 10000
          },
          "maxChargeUsd": {
            "title": "Max Charge USD",
            "minimum": 0,
            "maximum": 100000,
            "type": "number",
            "description": "Maximum pay-per-event charge allowed before the actor stops without emitting unpaid output.",
            "default": 1
          },
          "acsFixtures": {
            "title": "Supplied ACS fixtures",
            "type": "object",
            "description": "Optional supplied Census-compatible response evidence for deterministic analysis without an API credential.",
            "default": {
              "2024:acs5:B01001:county:001": {
                "metadata": {
                  "variables": {
                    "B01001_001E": {
                      "label": "Estimate!!Total:",
                      "concept": "Sex by Age"
                    }
                  }
                },
                "data": [
                  [
                    "NAME",
                    "B01001_001E",
                    "state",
                    "county"
                  ],
                  [
                    "Anderson County, Tennessee",
                    "81449",
                    "47",
                    "001"
                  ]
                ]
              }
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}