> ## Documentation Index
> Fetch the complete documentation index at: https://docs.risk.matrisk.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Aggregated Crash Data

> Get aggregated crash statistics for a specific location and time period.
Returns statistics within the specified radius.



## OpenAPI

````yaml post /v1/crash-data/aggregate
openapi: 3.1.0
info:
  title: Vehicle Crashes API
  summary: 'This is the documentation for the Matrisk Data API. '
  version: 1.0.0
servers: []
security: []
tags:
  - name: Aggregated Crashes
    description: >-
      Provides aggregated crash data to support risk analysis and scoring
      models.
  - name: CA Garaging Risk Score
    description: >-
      Risk score derived from the garaging location of **commercial auto** (CA)
      vehicles. Helps evaluate potential risks based on where vehicles are
      stored or parked.
  - name: CA Telematics Risk Score
    description: >-
      Risk score generated using telematics data from **commercial auto**
      vehicles.
  - name: PPA Garaging Risk Score
    description: >-
      Risk score based on the garaging location of **personal passenger auto**
      (PPA) vehicles, assessing the safety and risk factors associated with
      where the vehicle is kept.
  - name: PPA Telematics Risk Score
    description: >-
      Risk score based on telematics data from **personal passenger auto** (PPA)
      vehicles.
  - name: API Key
    description: >-
      Operations related to managing API keys for authentication and
      authorization purposes.
paths:
  /v1/crash-data/aggregate:
    post:
      tags:
        - Aggregated Crashes
      summary: Get Aggregated Crash Data
      description: |-
        Get aggregated crash statistics for a specific location and time period.
        Returns statistics within the specified radius.
      operationId: get_aggregated_crash_data
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AggregatedCrashesRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AggregatedCrashesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    AggregatedCrashesRequest:
      properties:
        location:
          $ref: '#/components/schemas/LocationGPS'
          description: Address or GPS coordinates to center the aggregation on.
        start_date:
          type: string
          format: date-time
          title: Start Date
          description: Start date of the aggregation period.
          examples:
            - '2020-01-01'
        end_date:
          type: string
          format: date-time
          title: End Date
          description: End date of the aggregation period.
          examples:
            - '2021-12-31'
        radius_km:
          type: number
          maximum: 500
          exclusiveMinimum: 1
          title: Radius Km
          description: Distance in kilometers from the location for aggregation (1-500 km).
          examples:
            - 50
      type: object
      required:
        - location
        - start_date
        - end_date
        - radius_km
      title: AggregatedCrashesRequest
    AggregatedCrashesResponse:
      properties:
        latitude:
          type: number
          title: Latitude
          description: Latitude of the central location.
          examples:
            - 37.7749
        longitude:
          type: number
          title: Longitude
          description: Longitude of the central location.
          examples:
            - -104.9903
        start_date:
          type: string
          format: date-time
          title: Start Date
          description: Start date of the aggregation.
          examples:
            - '2020-01-01'
        end_date:
          type: string
          format: date-time
          title: End Date
          description: End date of the aggregation.
          examples:
            - '2021-12-31'
        radius_km:
          type: number
          title: Radius Km
          description: Distance in kilometers from the central location.
          examples:
            - 50
        total_crashes:
          type: integer
          title: Total Crashes
          description: Total number of crashes.
          examples:
            - 110
        total_injuries:
          type: integer
          title: Total Injuries
          description: Total number of injuries.
          examples:
            - 10
        total_fatalities:
          type: integer
          title: Total Fatalities
          description: Total number of fatalities.
          examples:
            - 1
        incomplete_coverage:
          type: boolean
          title: Incomplete Coverage
          description: >-
            A warning if any states without available data are within the
            provided radius.
      type: object
      required:
        - latitude
        - longitude
        - start_date
        - end_date
        - radius_km
        - total_crashes
        - total_injuries
        - total_fatalities
        - incomplete_coverage
      title: AggregatedCrashesResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LocationGPS:
      properties:
        latitude:
          type: number
          maximum: 49.384358
          minimum: 24.396308
          title: Latitude
          description: >-
            Latitude range limited to Continental U.S. boundaries (24.396308°N
            to 49.384358°N). Uses the World Geodetic System 1984 (WGS84)
            coordinate system.
        longitude:
          type: number
          maximum: -66.93457
          minimum: -125
          title: Longitude
          description: >-
            Longitude range limited to Continental U.S. boundaries (-125.0°W to
            -66.93457°W). Uses the World Geodetic System 1984 (WGS84) coordinate
            system.
      type: object
      required:
        - latitude
        - longitude
      title: GPS Coordinates
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````