{
  "openapi": "3.0.1",
  "info": {
    "title": "FBI Crime Data Scraper — Statistics & NIBRS Counts",
    "description": "Query FBI Crime Data Explorer summary statistics and NIBRS offense-count aggregates by year, offense, state, nation, or agency. $0.002 per stored record.",
    "version": "1.4",
    "x-build-id": "oBsFfJFm3ShigfwdZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/muhammadafzal~fbi-crime-data-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-muhammadafzal-fbi-crime-data-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~fbi-crime-data-scraper/runs": {
      "post": {
        "operationId": "runs-sync-muhammadafzal-fbi-crime-data-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~fbi-crime-data-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-muhammadafzal-fbi-crime-data-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": {
          "dataMode": {
            "title": "FBI data mode",
            "enum": [
              "summary",
              "nibrs"
            ],
            "type": "string",
            "description": "Use summary for SRS-style crime statistics by nation, state, or agency; use nibrs for state-level offense-count aggregates. Example: 'summary'. This is not a raw incident-download selector.",
            "default": "summary"
          },
          "locationLevel": {
            "title": "Geographic level",
            "enum": [
              "national",
              "state",
              "agency"
            ],
            "type": "string",
            "description": "Use national for U.S. totals, state for a two-letter stateCode such as CA, or agency for an FBI ORI such as CA0194200. NIBRS mode currently supports state only.",
            "default": "state"
          },
          "stateCode": {
            "title": "State code",
            "pattern": "^[A-Za-z]{2}$",
            "minLength": 2,
            "maxLength": 2,
            "type": "string",
            "description": "Use this for state summaries or to filter NIBRS results to one state. Enter a two-letter USPS/FBI abbreviation such as CA, TX, or NY. Defaults to CA for a working prefill; ignored for national and agency summary queries.",
            "default": "CA"
          },
          "ori": {
            "title": "Agency ORI",
            "maxLength": 12,
            "type": "string",
            "description": "Use this only when locationLevel is agency. Enter the agency's FBI Originating Agency Identifier, for example CA0194200. This is not a city name, county name, or postal code.",
            "default": ""
          },
          "offenses": {
            "title": "Offense slugs",
            "type": "array",
            "description": "Use this to select FBI offense endpoint slugs. Examples: violent-crime, property-crime, homicide, rape, robbery, aggravated-assault, burglary, larceny, motor-vehicle-theft, or arson. Up to 10 unique slugs are queried; unknown slugs are reported in OUTPUT warnings.",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 80
            },
            "default": [
              "violent-crime",
              "property-crime"
            ]
          },
          "fromYear": {
            "title": "First data year",
            "minimum": 1960,
            "maximum": 2100,
            "type": "integer",
            "description": "Use this as the inclusive first year, from 1960 through the current year. Example: 2020. The FBI may have different historical coverage by endpoint.",
            "default": 2020
          },
          "toYear": {
            "title": "Last data year",
            "minimum": 1960,
            "maximum": 2100,
            "type": "integer",
            "description": "Use this as the inclusive last year. Example: 2024. Keep it at or after fromYear and no later than the current year when the actor runs.",
            "default": 2024
          },
          "maxResults": {
            "title": "Maximum result records",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Use this to cap stored dataset rows and result-event charges. Defaults to 100 and allows 1-1,000. Each row is one normalized FBI year/offense/location observation, not one raw criminal case.",
            "default": 100
          },
          "apiKey": {
            "title": "FBI API key",
            "type": "string",
            "description": "Use a registered api.data.gov/FBI key for higher request limits. DEMO_KEY is the default for small tests; enter your own key as a secret when running larger queries. This is not an Apify token."
          },
          "requestDelayMs": {
            "title": "Delay between API requests (ms)",
            "minimum": 100,
            "maximum": 5000,
            "type": "integer",
            "description": "Use this to pace requests to the public FBI API. Enter 100-5,000 milliseconds; 250 is the default. This is not a total timeout or a proxy setting.",
            "default": 250
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}