{
  "openapi": "3.0.1",
  "info": {
    "title": "Powersports and E-Mobility Safety Monitor",
    "description": "Match new CPSC, NHTSA, and Federal Register safety and regulatory events to the brands, product categories, and keywords a customer actually sells - with evidence, severity, and a human-review flag.",
    "version": "0.2",
    "x-build-id": "3u0iupUEbAweKrYSk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/repairiq~powersports-safety-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-repairiq-powersports-safety-monitor",
        "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/repairiq~powersports-safety-monitor/runs": {
      "post": {
        "operationId": "runs-sync-repairiq-powersports-safety-monitor",
        "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/repairiq~powersports-safety-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-repairiq-powersports-safety-monitor",
        "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": {
          "brands": {
            "title": "Brands",
            "type": "array",
            "description": "Brand or manufacturer names to watch. Punctuation and spacing variants are matched automatically.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "productCategories": {
            "title": "Product categories",
            "type": "array",
            "description": "electric-motorcycle, electric-dirt-bike, dirt-bike, motorcycle, atv, side-by-side, snowmobile, battery, charger, helmet, youth-powersports.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Free-text terms searched in event titles and bodies, and used as Federal Register search terms.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "vehicles": {
            "title": "Vehicles for NHTSA lookup",
            "type": "array",
            "description": "NHTSA recall lookup requires an explicit make, model, and year, and the model must match NHTSA's catalog name exactly - it answers anything else with an error rather than an empty list. NHTSA also only carries on-road vehicles: dirt bikes, ATVs and side-by-sides are covered by CPSC instead. Either way the vehicle is reported as `VEHICLE_NOT_IN_SOURCE_CATALOG`, never as 'no recalls'. Look up valid names at https://api.nhtsa.gov/products/vehicle/models?modelYear=2024&make=ktm&issueType=r",
            "default": []
          },
          "includeCpsc": {
            "title": "Include CPSC recalls",
            "type": "boolean",
            "description": "CPSC is the agency for ATVs, side-by-sides, off-road motorcycles, e-bikes, batteries, and chargers.",
            "default": true
          },
          "includeNhtsa": {
            "title": "Include NHTSA recalls",
            "type": "boolean",
            "description": "Requires at least one vehicle make/model/year. NHTSA covers on-road vehicles only.",
            "default": false
          },
          "includeFederalRegister": {
            "title": "Include Federal Register documents",
            "type": "boolean",
            "description": "Searched with your keywords and brands, then matched like any other event.",
            "default": true
          },
          "onlyNewEvents": {
            "title": "Only new events",
            "type": "boolean",
            "description": "Emit each matched event once, then remember it in the state store. Leave this off for one-off runs and demos: with it on, a repeat run over the same lookback window correctly returns nothing, which is hard to tell apart from a broken run. Turn it on for scheduled monitoring, where you only want to hear about what changed.",
            "default": true
          },
          "lookbackDays": {
            "title": "Lookback days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "How far back to request events. Agency records are sometimes revised, so a window wider than the schedule interval is safer. Powersports recalls are infrequent: a 30-day window often has nothing in it at all.",
            "default": 30
          },
          "maximumEventsPerSource": {
            "title": "Maximum events per source",
            "minimum": 1,
            "type": "integer",
            "description": "Caps how many raw documents are pulled before matching.",
            "default": 200
          },
          "minimumMatchConfidence": {
            "title": "Minimum match confidence",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Category- or keyword-only matches score lower than brand matches. Lower this to trade precision for recall.",
            "default": 0.5
          },
          "events": {
            "title": "Supplied events",
            "type": "array",
            "description": "Pre-normalized events for testing or for a source this Actor does not yet cover.",
            "default": []
          },
          "offline": {
            "title": "Offline mode",
            "type": "boolean",
            "description": "Skip every network source and match only supplied events. Used for deterministic tests.",
            "default": false
          },
          "requestTimeoutSeconds": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Per-request timeout for agency APIs. Failed sources fail the run rather than reporting zero events, so do not set this so low that a slow agency looks like an outage: CPSC and the Federal Register regularly take more than 20 seconds for a wide lookback.",
            "default": 45
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store remembering which events have already been reported.",
            "default": "safety-event-state"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}