{
  "openapi": "3.0.1",
  "info": {
    "title": "NY DMV Traffic Tickets - Violations & Enforcement Data",
    "description": "New York DMV adjudicated traffic tickets (public open data, 13.4M tickets, 2022-2026): charged code and description, year/month/weekday, driver age and gender, licence state, police agency and court. No names, addresses or plates.",
    "version": "0.0",
    "x-build-id": "firB6MMILwgjpe82A"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~ny-dmv-tickets/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-ny-dmv-tickets",
        "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/j0401~ny-dmv-tickets/runs": {
      "post": {
        "operationId": "runs-sync-j0401-ny-dmv-tickets",
        "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/j0401~ny-dmv-tickets/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-ny-dmv-tickets",
        "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": {
          "code": {
            "title": "Violation code (contains)",
            "type": "string",
            "description": "Substring match on the charged violation code, e.g. '1180D' for speeding. 1,021 codes exist. Blank = any.",
            "default": ""
          },
          "description": {
            "title": "Violation description (contains)",
            "type": "string",
            "description": "Substring match on the plain-English description, e.g. 'SPEED', 'UNREGISTERED', 'REDLIGHT'. Blank = any.",
            "default": ""
          },
          "agency": {
            "title": "Police agency (contains)",
            "type": "string",
            "description": "Substring match on the agency that wrote the ticket, e.g. 'STATE POLICE', 'NEW YORK CITY'. 902 agencies exist. Blank = any.",
            "default": ""
          },
          "court": {
            "title": "Court (contains)",
            "type": "string",
            "description": "Substring match on the court that disposed of the ticket, e.g. 'TVB', 'Nassau County'. 1,392 courts exist. Blank = any.",
            "default": ""
          },
          "licenseState": {
            "title": "Licence state (contains)",
            "type": "string",
            "description": "Substring match on the state that issued the licence, e.g. 'NEW YORK', 'NEW JERSEY'. Blank = any.",
            "default": ""
          },
          "gender": {
            "title": "Driver gender",
            "enum": [
              "",
              "M",
              "F",
              "C",
              "U"
            ],
            "type": "string",
            "description": "Driver gender as recorded. 'C' and 'U' are the source's own codes. Blank = any.",
            "default": ""
          },
          "source": {
            "title": "Enforcement stream",
            "enum": [
              "",
              "TSLED",
              "TVB"
            ],
            "type": "string",
            "description": "'TSLED' = court dispositions (10.09M). 'TVB' = NYC / Rochester Traffic Violations Bureau administrative adjudication (3.31M). Blank = both.",
            "default": ""
          },
          "weekday": {
            "title": "Weekday of violation",
            "enum": [
              "",
              "MONDAY",
              "TUESDAY",
              "WEDNESDAY",
              "THURSDAY",
              "FRIDAY",
              "SATURDAY",
              "SUNDAY"
            ],
            "type": "string",
            "description": "Day of week the violation occurred. Blank = any.",
            "default": ""
          },
          "month": {
            "title": "Month of violation",
            "enum": [
              "",
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "7",
              "8",
              "9",
              "10",
              "11",
              "12"
            ],
            "type": "string",
            "description": "Calendar month (1-12) the violation occurred. The source has no calendar day, so day-level filtering is not possible. Blank = any.",
            "default": ""
          },
          "year": {
            "title": "Year of violation",
            "enum": [
              "",
              "2022",
              "2023",
              "2024",
              "2025",
              "2026"
            ],
            "type": "string",
            "description": "Year of violation. The register covers a rolling window only: 2022-2026. Blank = any.",
            "default": ""
          },
          "ageFrom": {
            "title": "Driver age from",
            "minimum": 0,
            "type": "integer",
            "description": "Youngest driver age to include. Values recorded as -1 (unknown) and impossible values above 100 are always excluded from a range. Blank = any."
          },
          "ageTo": {
            "title": "Driver age to",
            "minimum": 0,
            "type": "integer",
            "description": "Oldest driver age to include. Blank = any."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "rows",
              "aggregate"
            ],
            "type": "string",
            "description": "rows = tickets matching your filters (default). aggregate = one count row per group (see groupBy).",
            "default": "rows"
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "",
              "gender",
              "month",
              "source",
              "weekday",
              "year"
            ],
            "type": "string",
            "description": "Which dimension to aggregate over (mode=aggregate). Blank = year. Only low-cardinality dimensions are offered: the police agency (902 values) and court (1,392) columns are filters only, because a top-N of either would silently drop most of the tail. Every group is returned.",
            "default": ""
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the number of records pushed in rows mode (0 = default 50; up to 2,000 per run). Each record is metered individually, so there is no per-run charge cap. Aggregate mode returns every group.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}