{
  "openapi": "3.0.1",
  "info": {
    "title": "US Census Bureau Data API Scraper",
    "description": "Query official US Census Bureau Data API datasets such as ACS and the Decennial Census by year, variables and geography. Returns structured rows with variable values, geography identifiers, the query URL and retrieval time.",
    "version": "1.0",
    "x-build-id": "VdVlbBG51sHkm0FXJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/muhammadafzal~us-census-bureau-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-muhammadafzal-us-census-bureau-scraper",
        "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/muhammadafzal~us-census-bureau-scraper/runs": {
      "post": {
        "operationId": "runs-sync-muhammadafzal-us-census-bureau-scraper",
        "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/muhammadafzal~us-census-bureau-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-muhammadafzal-us-census-bureau-scraper",
        "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": {
          "dataset": {
            "title": "Dataset path",
            "pattern": "^[A-Za-z0-9_-]+(?:/[A-Za-z0-9_-]+)*$",
            "minLength": 1,
            "maxLength": 120,
            "type": "string",
            "description": "Use this to select the Census dataset path, for example 'acs/acs5' or 'dec/pl'. Supported: acs/acs1, acs/acs5, acs/acs1/subject, acs/acs5/subject, acs/acs1/profile, acs/acs5/profile, acs/acsse, dec/pl, dec/dhc, dec/dp, dec/sf1. Defaults to 'acs/acs5'.",
            "default": "acs/acs5"
          },
          "year": {
            "title": "Vintage year",
            "minimum": 1790,
            "maximum": 2100,
            "type": "integer",
            "description": "Use this to choose the Census vintage year, for example 2023. Defaults to 2023; choose a year published by the selected dataset.",
            "default": 2023
          },
          "variables": {
            "title": "Variables",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "description": "Use this to choose Census variable codes returned in each row, for example 'NAME' and 'B01001_001E'. Codes may come from up to 10 tables. Defaults to NAME and total population. This is not a free-text search.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "pattern": "^[A-Za-z0-9_.-]+$"
            },
            "default": [
              "NAME",
              "B01001_001E"
            ]
          },
          "for": {
            "title": "Geography selector",
            "minLength": 1,
            "maxLength": 200,
            "type": "string",
            "description": "Use this to set the Census 'for' geography, for example 'state:*', 'state:06,36', 'county:*', 'tract:*' or 'zip code tabulation area:90210'. Levels: us, region, division, state, county, county subdivision, tract, block group, place, congressional district, metropolitan statistical area/micropolitan statistical area, public use microdata area, zip code tabulation area, school district (unified). Defaults to state:*.",
            "default": "state:*"
          },
          "in": {
            "title": "Parent geography filters",
            "type": "array",
            "description": "Use this to restrict results inside parent geographies, one per entry and in order with specific codes, for example 'state:06' for counties in California, or 'state:06' then 'county:037' for tracts in Los Angeles County. Defaults to no parent filter.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[A-Za-z0-9_. -]+:[A-Za-z0-9_*.-]+$"
            },
            "default": []
          },
          "predicates": {
            "title": "API predicates",
            "type": "object",
            "description": "Use this to keep only rows whose value matches exactly, for example {\"NAME\": \"California\"}. Each key must also be listed in variables. Defaults to none; do not place get, for, in, key, or ucgid here.",
            "default": {},
            "additionalProperties": true
          },
          "ucgid": {
            "title": "Uniform Census geography ID",
            "maxLength": 500,
            "type": "string",
            "description": "Use this to select geographies by Census GEO_ID, for example '0400000US24', a comma-separated list, or '0400000US06$0500000' for all counties in California. Leave blank when using for/in.",
            "default": ""
          },
          "maxResults": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Use this to cap rows returned and billed. Defaults to 1000, with a maximum of 50000. This is a client-side cap, not Census server pagination.",
            "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}