Base Operations Analytics API

The Analytics API from Base Operations — 2 operation(s) for analytics.

OpenAPI Specification

base-operations-analytics-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Customer API - Base Operations Analytics API
  description: 'Welcome to the Base Operations Customer API! This API allows you to interact with our data and perform detailed analysis. In this documentation, we''ll explain how to use the API, including the available endpoints and the expected request bodies or query parameters.


    ### Authentication


    To use this API, you''ll need to authenticate using an API key. Please reach out to Base Operations to have an API key provisioned for your user. Once you have your API key, you can use it to authorize the Swagger docs.


    To authenticate on the Swagger docs, follow these steps:


    1.  Click on the "Authorize" button on the top right corner of the Swagger docs.

    2.  In the "Value" field, enter your API key.

    3.  Click "Authorize" to authenticate.


    ### Helpful Hints


    When using the API, you may see the following query parameters:


    - `savedLocationId`: This is an internal identifier for a saved location. You can acquire this identifier by using the `GET /v1/public/saved-locations` endpoint.


    - `categoryId`: This is an internal identifier for a threat category. You can acquire this identifier by using the `GET /v1/public/threat-categories` endpoint.<br><br>


    That''s it! You''re now authenticated and can start using the API. If you have any questions or issues, please contact Base Operations support.

    '
  version: '1.0'
  contact: {}
servers:
- url: https://api.baseoperationsenterprise.com/
tags:
- name: Analytics
paths:
  /v1/public/analytics/forecast:
    get:
      description: This endpoint forecasts the trendline of threats in a given location. Powered by BaseEngine.
      operationId: PublicAnalyticsController_getForecast_v1
      parameters:
      - name: locationId
        required: true
        in: query
        schema:
          type: number
      - name: types
        required: false
        in: query
        schema:
          default:
          - crime
          - unrest
          type: array
          items:
            type: string
            enum:
            - crime
            - unrest
            - customer
            - uas_sighting
      - name: categories
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: months
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: daytimes
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: isGTM
        required: false
        in: query
        schema:
          default: false
          type: boolean
      - name: forecastMonths
        required: true
        in: query
        description: Number of forecast months (between 3 and 12).
        schema:
          minimum: 3
          maximum: 12
          example: 6
          type: number
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ChartDto'
                - properties:
                    chartData:
                      type: array
                      items:
                        $ref: '#/components/schemas/ForecastData'
            text/csv:
              schema:
                type: string
                example: 'date,forecastedValue,trendValue,estimateValue,actualValue,confidenceInterval

                  2023-01-01,77,77,77,77,{"upper90":77,"upper75":77,"lower75":77,"lower90":77}'
          description: ''
        '401':
          description: Unauthorized. Your API Key may be invalid or expired.
        '404':
          description: Location not found | Boundary not found | Saved Location not found
        '432':
          description: Not enough data available
        '500':
          description: Internal Server Error
      security:
      - ApiKey: []
      summary: Get forecast for threats in a given location
      tags:
      - Analytics
  /v1/public/analytics/radius/forecast:
    get:
      description: This endpoint forecasts the trendline of threats within a specified radius. Powered by BaseEngine.
      operationId: PublicAnalyticsController_getRadiusForecast_v1
      parameters:
      - name: latitude
        required: true
        in: query
        schema:
          type: number
      - name: longitude
        required: true
        in: query
        schema:
          type: number
      - name: radius
        required: true
        in: query
        schema:
          type: number
      - name: units
        required: true
        in: query
        schema:
          type: string
          enum:
          - mi
          - km
          - m
      - name: types
        required: false
        in: query
        schema:
          default:
          - crime
          - unrest
          type: array
          items:
            type: string
            enum:
            - crime
            - unrest
            - customer
            - uas_sighting
      - name: categories
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: months
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: daytimes
        required: false
        in: query
        schema:
          type: array
          items:
            type: number
      - name: isGTM
        required: false
        in: query
        schema:
          default: false
          type: boolean
      - name: savedLocationId
        required: false
        in: query
        schema:
          type: number
      - name: forecastMonths
        required: true
        in: query
        description: Number of forecast months (between 3 and 12).
        schema:
          minimum: 3
          maximum: 12
          example: 6
          type: number
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ChartDto'
                - properties:
                    chartData:
                      type: array
                      items:
                        $ref: '#/components/schemas/ForecastData'
            text/csv:
              schema:
                type: string
                example: 'date,forecastedValue,trendValue,estimateValue,actualValue,confidenceInterval

                  2023-01-01,77,77,77,77,{"upper90":77,"upper75":77,"lower75":77,"lower90":77}'
          description: ''
        '401':
          description: Unauthorized. Your API Key may be invalid or expired.
        '404':
          description: Location not found | Boundary not found | Saved Location not found
        '432':
          description: Not enough data available
        '500':
          description: Internal Server Error
      security:
      - ApiKey: []
      summary: Get forecast for threats within a radius
      tags:
      - Analytics
components:
  schemas:
    ConfidenceInterval:
      type: object
      properties:
        upper90:
          type: number
        upper75:
          type: number
        lower75:
          type: number
        lower90:
          type: number
      required:
      - upper90
      - upper75
      - lower75
      - lower90
    ForecastData:
      type: object
      properties:
        date:
          type: string
        trendValue:
          type: number
        estimatedValue:
          type: number
        actualValue:
          type: number
        forecastedValue:
          type: number
        confidenceInterval:
          $ref: '#/components/schemas/ConfidenceInterval'
      required:
      - date
      - trendValue
      - estimatedValue
      - actualValue
      - forecastedValue
      - confidenceInterval
    ChartDto:
      type: object
      properties:
        chartData:
          type: object
        metadata:
          type: object
      required:
      - chartData
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-KEY