{
  "openapi": "3.0.1",
  "info": {
    "title": "Address to Census Tract & Demographics (ACS)",
    "description": "Geocode US addresses or coordinates to Census tract and block group GEOIDs with the U.S. Census Geocoder, then append ACS 5-year demographics: population, median income, median age, poverty rate, education, housing and unemployment. Batch CSV or list input, per-row status, built for AI agents.",
    "version": "0.1",
    "x-build-id": "S3KPP5beqeYhsWjsT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/errandkit~census-tract-demographics/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-errandkit-census-tract-demographics",
        "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/errandkit~census-tract-demographics/runs": {
      "post": {
        "operationId": "runs-sync-errandkit-census-tract-demographics",
        "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/errandkit~census-tract-demographics/run-sync": {
      "post": {
        "operationId": "run-sync-errandkit-census-tract-demographics",
        "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": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "Operation",
            "enum": [
              "geocode",
              "coordinates",
              "demographics"
            ],
            "type": "string",
            "description": "geocode = US addresses to tract/block group (+ demographics); coordinates = lat/lon points to tract; demographics = known tract/block group GEOIDs to demographics."
          },
          "addresses": {
            "title": "Addresses (one per line)",
            "maxItems": 100000,
            "type": "array",
            "description": "One-line US addresses, e.g. '125 N Main St, Memphis, TN 38103'. Include city + state or ZIP for best matches.",
            "items": {
              "type": "string"
            }
          },
          "addressRecords": {
            "title": "Address records (for API / AI agents)",
            "maxItems": 100000,
            "type": "array",
            "description": "Structured addresses: [{\"id\": \"c1\", \"street\": \"125 N Main St\", \"city\": \"Memphis\", \"state\": \"TN\", \"zip\": \"38103\"}]. `id` is echoed back. You can also give {\"address\": \"one line\"}."
          },
          "csvUrl": {
            "title": "CSV file (upload or URL)",
            "type": "string",
            "description": "A CSV with a header row. Columns are detected automatically (address, street, city, state, zip, id); override with CSV columns below. Max 50 MB, 100,000 rows."
          },
          "csvText": {
            "title": "CSV text",
            "type": "string",
            "description": "Alternative to the file: paste CSV text with a header row."
          },
          "csvColumns": {
            "title": "CSV columns",
            "type": "object",
            "description": "Only if auto-detection picks the wrong columns, e.g. {\"street_column\": \"Addr 1\", \"zip_column\": \"Postal\", \"id_column\": \"Account\"}. Keys: id_column, address_column, street_column, city_column, state_column, zip_column."
          },
          "points": {
            "title": "Points (coordinates operation)",
            "maxItems": 100000,
            "type": "array",
            "description": "[{\"id\": \"a\", \"latitude\": 35.1495, \"longitude\": -90.049}]"
          },
          "geoids": {
            "title": "GEOIDs (demographics operation)",
            "maxItems": 100000,
            "type": "array",
            "description": "11-digit tract GEOIDs (e.g. 47157004200) or 12-digit block group GEOIDs.",
            "items": {
              "type": "string"
            }
          },
          "demographics": {
            "title": "Append demographics",
            "type": "boolean",
            "description": "Add ACS 5-year demographics to each matched row. Turn off for tract/block group IDs only (cheaper).",
            "default": true
          },
          "geoLevel": {
            "title": "Geography level",
            "enum": [
              "tract",
              "block_group"
            ],
            "type": "string",
            "description": "tract (default; more reliable estimates) or block_group (smaller areas, larger margins of error).",
            "default": "tract"
          },
          "fields": {
            "title": "Demographic groups or fields",
            "type": "array",
            "description": "Groups: population, income, education, housing, employment; or field names like median_household_income. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "acsYear": {
            "title": "ACS 5-year release (end year)",
            "minimum": 2017,
            "maximum": 2035,
            "type": "integer",
            "description": "2024 = the 2020-2024 release (latest as of Oct 2026). Minimum 2017.",
            "default": 2024
          },
          "includeMoe": {
            "title": "Include margins of error",
            "type": "boolean",
            "description": "Adds *_moe columns (90% confidence) for direct estimates.",
            "default": false
          },
          "outputFormat": {
            "title": "Extra output file",
            "enum": [
              "csv",
              "none"
            ],
            "type": "string",
            "description": "csv saves results.csv to the key-value store (demographics flattened into columns).",
            "default": "csv"
          },
          "censusApiKey": {
            "title": "Your Census Data API key (optional)",
            "type": "string",
            "description": "Optional. The Actor has its own key. Use yours if you prefer (free at api.census.gov/data/key_signup.html)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}