{
  "openapi": "3.0.1",
  "info": {
    "title": "NYS DOCCS Basic Snapshot",
    "description": "Scrapes the NYS DOCCS public incarcerated person lookup by last-name prefixes and outputs a resumable, structured basic snapshot with DIN, name, status, facility, age, race, DOB, source, page, and scrape provenance fields.",
    "version": "0.3",
    "x-build-id": "C3NfCWejratLvLOc1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jippylong12~nys-doccs-basic-snapshot/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jippylong12-nys-doccs-basic-snapshot",
        "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/jippylong12~nys-doccs-basic-snapshot/runs": {
      "post": {
        "operationId": "runs-sync-jippylong12-nys-doccs-basic-snapshot",
        "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/jippylong12~nys-doccs-basic-snapshot/run-sync": {
      "post": {
        "operationId": "run-sync-jippylong12-nys-doccs-basic-snapshot",
        "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": {
          "prefixes": {
            "title": "Last-name prefixes",
            "uniqueItems": true,
            "type": "array",
            "description": "Optional explicit prefixes to send as lastName in the SearchByName JSON request. Leave empty to auto-generate AA-ZZ from prefixDepth by default.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "prefixDepth": {
            "title": "Auto-generated prefix depth",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "Used only when prefixes is empty. Set 1 for A-Z. Set 2 for AA-ZZ. Because the API does not expose a total-result count, 2 is the safer default for broader recurring scrapes.",
            "default": 2
          },
          "requestDelayMs": {
            "title": "Delay between requests per worker (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Conservative pacing between the homepage session GET and the JSON POST requests. This delay is applied independently inside each worker session.",
            "default": 3000
          },
          "maxPagesPerPrefix": {
            "title": "Max pages per prefix",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum pages to fetch for each prefix. Use 0 to paginate until the endpoint returns no persons or repeats the last DIN cursor.",
            "default": 0
          },
          "workerCount": {
            "title": "Worker count",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "Number of parallel prefix workers to run inside one Actor. Each worker uses its own cookie-backed session and pacing window.",
            "default": 4
          },
          "proxyMode": {
            "title": "Proxy mode",
            "enum": [
              "none",
              "datacenter",
              "residential"
            ],
            "type": "string",
            "description": "Use Apify datacenter proxy first for the production basic scrape. Switch to residential only if the target starts throttling or blocking too aggressively.",
            "default": "datacenter"
          },
          "proxyCountryCode": {
            "title": "Residential proxy country code",
            "pattern": "^[A-Za-z]{2}$",
            "minLength": 2,
            "maxLength": 2,
            "type": "string",
            "description": "Optional 2-letter country code used only when proxyMode is residential."
          },
          "resumeMode": {
            "title": "Resume mode",
            "enum": [
              "auto",
              "forceNew"
            ],
            "type": "string",
            "description": "Auto resumes the current unfinished logical scrape run from named storage. Force new abandons the previous unfinished logical run and starts a fresh one.",
            "default": "auto"
          },
          "logicalRunId": {
            "title": "Logical run ID",
            "minLength": 1,
            "maxLength": 100,
            "type": "string",
            "description": "Optional stable logical run identifier for manual recovery or testing. Leave empty for an automatic timestamp-based run ID."
          },
          "retainedCompletedRuns": {
            "title": "Retained completed runs",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many completed named final datasets to keep after cleanup. Older retained copies are deleted automatically.",
            "default": 2
          },
          "sampleRowLimit": {
            "title": "Sample rows in OUTPUT",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many sample dataset rows to include in the final OUTPUT summary record.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}