{
  "openapi": "3.0.1",
  "info": {
    "title": "NHTSA VIN Decoder & Vehicle Recalls",
    "description": "US NHTSA vehicle data (public open data, no key): decode a VIN into 69 structured fields - make, model, year, body, engine, plant, safety equipment - and pull the safety recalls for a vehicle or by campaign number, with the remedy and the recall date.",
    "version": "0.0",
    "x-build-id": "bgAIznSie6QVZ14J4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~nhtsa-vehicles/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-nhtsa-vehicles",
        "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~nhtsa-vehicles/runs": {
      "post": {
        "operationId": "runs-sync-j0401-nhtsa-vehicles",
        "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~nhtsa-vehicles/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-nhtsa-vehicles",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "rows",
              "aggregate"
            ],
            "type": "string",
            "description": "rows = one record per VIN, or per recall campaign for the queried vehicle (default). aggregate = one count row per group of the fetched recall set; available for corpus=recalls only.",
            "default": "rows"
          },
          "corpus": {
            "title": "Corpus",
            "enum": [
              "vin",
              "recalls"
            ],
            "type": "string",
            "description": "vin = decode VINs from the vins list. recalls = NHTSA safety recalls by make/model/modelYear, or by campaignNumber.",
            "default": "vin"
          },
          "vins": {
            "title": "VINs to decode",
            "type": "array",
            "description": "corpus=vin. VINs to decode, 11-17 characters each. Blank = a built-in list of 3 real VINs, so the default run always returns data. Each VIN is one request; maxVins caps how many are processed.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeRecalls": {
            "title": "Also fetch recalls for each decoded VIN",
            "type": "boolean",
            "description": "corpus=vin. After decoding, pull the safety recalls for each VIN's make/model/year and emit them alongside the decode records. Note: NHTSA returns recalls by make/model/year, not by VIN.",
            "default": false
          },
          "maxVins": {
            "title": "Max VINs per run",
            "minimum": 0,
            "type": "integer",
            "description": "corpus=vin. Cap on how many VINs are decoded (each is one HTTP request). Default 25; hard limit 500 per run. VINs beyond the cap are dropped, and the run log and record metadata name them rather than letting them vanish.",
            "default": 25
          },
          "campaignNumber": {
            "title": "NHTSA campaign number",
            "type": "string",
            "description": "corpus=recalls. A recall campaign number such as '19V182' or '19V182000' - both resolve to the same campaign. Takes precedence over make/model/modelYear when set.",
            "default": ""
          },
          "make": {
            "title": "Make",
            "type": "string",
            "description": "corpus=recalls. Vehicle make as NHTSA stores it, e.g. 'honda', 'ford', 'tesla'. Required with model and modelYear unless campaignNumber is set. Case-insensitive.",
            "default": ""
          },
          "model": {
            "title": "Model",
            "type": "string",
            "description": "corpus=recalls. Vehicle model as NHTSA stores it, e.g. 'accord', 'f-150', 'model 3'. Required with make and modelYear unless campaignNumber is set.",
            "default": ""
          },
          "modelYear": {
            "title": "Model year",
            "type": "string",
            "description": "corpus=recalls. Four-digit model year, e.g. '2003'. A range ('2003,2004') or a 2-digit year is rejected by NHTSA. Required with make and model unless campaignNumber is set.",
            "default": ""
          },
          "groupBy": {
            "title": "Aggregate by",
            "enum": [
              "component",
              "manufacturer",
              "modelYear",
              "recallMake"
            ],
            "type": "string",
            "description": "mode=aggregate, corpus=recalls only. Which field of the fetched recall set to count by. Counted over the recalls NHTSA returned for the query.",
            "default": "component"
          },
          "maxResults": {
            "title": "Max records",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on records emitted in the run, VIN decodes and recalls together. 0 = the internal ceiling. Records beyond it are not emitted.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}