# FMCSA Inspections, Violations & Crashes Scraper (`automation-lab/fmcsa-inspections-violations-crashes-scraper`) Actor

Extract official FMCSA safety events: roadside inspections, CFR violations, citation outcomes, BASIC/OOS details, vehicles, and carrier crashes. Filter by USDOT, date, state, or code; export via API, CSV, Excel, and scheduled runs.

- **URL**: https://apify.com/automation-lab/fmcsa-inspections-violations-crashes-scraper.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## FMCSA Inspections, Violations & Crashes Scraper

Extract **official FMCSA roadside inspections, safety violations, citation outcomes, and commercial-carrier crashes** from public U.S. Department of Transportation data.

Search by USDOT number, state, date range, violation code, or out-of-service status. The Actor uses anonymous HTTP APIs—no FMCSA login, browser, proxy, or API key is required.

- 🚚 Vet a carrier before tendering a load.
- ⚠️ Monitor out-of-service events and CFR violations.
- 🛡️ Build insurance, factoring, and compliance risk signals.
- 📅 Schedule recurring safety-history refreshes on Apify.

### What does FMCSA Inspections, Violations & Crashes Scraper do?

The Actor turns five official DOT Socrata datasets into clean, typed FMCSA safety-event records.

It can collect:

- roadside inspection reports and OOS totals;
- driver, vehicle, and hazmat violation totals;
- SMS BASIC inspection flags and violation counts;
- vehicle types, plates, states, and VINs where published;
- CFR parts, sections, violation codes, and descriptions;
- citation adjudication results linked to inspection violations;
- crash fatalities, injuries, tow-away status, road, weather, and severity fields.

Results keep official source dataset IDs and URLs for auditability.

### Who is this FMCSA safety data scraper for?

**Freight brokers and load boards**

- Review recent inspections and crashes during carrier onboarding.
- Flag out-of-service events before assigning freight.
- Refresh USDOT safety histories on a schedule.

**Fleet safety and compliance teams**

- Track recurring CFR violation codes.
- Compare driver, vehicle, and hazmat OOS patterns.
- Export event histories for internal safety reviews.

**Insurers, factoring companies, and risk teams**

- Add public safety events to underwriting or fraud models.
- Monitor insured or financed carriers by USDOT number.
- Use crash severity and citation outcomes as structured signals.

**Researchers and transportation analysts**

- Build state- or date-bounded FMCSA event datasets.
- Analyze violation and crash patterns without downloading bulk files manually.
- Preserve source links for reproducible analysis.

### Why use this FMCSA scraper?

- ✅ **Official sources** — records come from `data.transportation.gov`.
- ✅ **No login or API key** — anonymous access works by default.
- ✅ **Four typed outputs** — inspections, violations, citations, and crashes stay separate.
- ✅ **Reliable joins** — violation and citation context uses the official inspection ID.
- ✅ **Useful filters** — USDOT, date, state, OOS, and exact violation code.
- ✅ **Typed values** — numeric totals, booleans, and ISO dates instead of raw text.
- ✅ **Automation ready** — schedule runs, call the API, use webhooks, or connect MCP.
- ✅ **Low overhead** — pure HTTP extraction at 256 MB, with no browser or proxy.

### What FMCSA data can you extract?

| Dataset | Important fields |
|---|---|
| Inspections | inspection ID, report number, USDOT, date/state, level, carrier, location, violation/OOS totals |
| BASIC and vehicles | inspection flags, BASIC violation counts, vehicle types, makes, plates, states, VINs |
| Violations | violation ID/sequence, CFR part/section, code, description, OOS, citation number |
| Citation outcomes | inspection/violation sequence, citation code, adjudication result, matching violation context |
| Crashes | report, USDOT, date/state, fatalities, injuries, tow-away, hazmat, road, weather, light, VIN, severity |
| Traceability | record type, source dataset ID, official source URL, scrape timestamp |

The Actor does not invent joins. BASIC and vehicle detail is added only when report number and state match the primary inspection. Citation detail is linked to a violation only when inspection ID and sequence match.

### How much does it cost to scrape FMCSA safety records?

This Actor uses **pay-per-event pricing**. You pay a small run-start fee plus one record charge for each inspection, violation, citation, or crash saved.

Prices are formula-derived from measured 256 MB cloud runs and include platform compute.

| Apify plan | Start | Per safety record |
|---|---:|---:|
| Free | $0.005 | $0.00011739 |
| Starter / Bronze | $0.005 | $0.00010208 |
| Scale / Silver | $0.005 | $0.00007962 |
| Business / Gold | $0.005 | $0.000061246 |

At the Free price:

- 20 records cost about **$0.00735** including the start fee.
- 100 records cost about **$0.01674** including the start fee.
- 1,000 records cost about **$0.12239** including the start fee.

Apify's Free plan includes monthly platform credits, so you can test a small carrier lookup before scaling.

### How to scrape FMCSA inspections, violations, and crashes

1. Open the Actor in Apify Store.
2. Enter one or more **USDOT numbers**, such as `3496981`.
3. Choose record types: `inspection`, `violation`, `citation`, and/or `crash`.
4. Optionally set a date range, states, OOS-only mode, or violation codes.
5. Keep `maxItems` small for the first run.
6. Click **Start**.
7. Open the relevant dataset in the run's Storage or Output tab.
8. Export JSON, CSV, Excel, XML, or another supported format.

A carrier inspection and citation lookup:

```json
{
  "usdotNumbers": ["3496981"],
  "recordTypes": ["inspection", "violation", "citation"],
  "startDate": "2023-08-01",
  "endDate": "2023-08-31",
  "maxItems": 20
}
````

An OOS violation monitor:

```json
{
  "usdotNumbers": ["3496981", "3926944"],
  "recordTypes": ["violation", "citation"],
  "outOfServiceOnly": true,
  "maxItems": 100
}
```

A state crash search:

```json
{
  "states": ["AK"],
  "recordTypes": ["crash"],
  "startDate": "2025-07-01",
  "endDate": "2025-07-31",
  "maxItems": 100
}
```

### Input parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `usdotNumbers` | string array | `3496981` prefill | Carrier USDOT numbers without punctuation |
| `recordTypes` | string array | all four types | `inspection`, `violation`, `citation`, `crash` |
| `states` | string array | empty | Two-letter report-state codes |
| `startDate` | string | empty | Inclusive `YYYY-MM-DD` event date |
| `endDate` | string | empty | Inclusive `YYYY-MM-DD` event date |
| `outOfServiceOnly` | boolean | `false` | OOS inspections/violations and citations linked to OOS violations |
| `violationCodes` | string array | empty | Exact FMCSA violation codes |
| `maxItems` | integer | `20` | Maximum records across all requested types, up to 10,000 |
| `startUrls` | string array | empty | Advanced official DOT Socrata resource URLs |
| `appToken` | string | empty | Optional Socrata app token for higher rate limits |

When several record types are selected, the Actor shares the item budget across them so one event type does not automatically consume the entire run.

### Output datasets

The Actor declares separate datasets because the entities have different shapes:

- **Inspections** — the default dataset.
- **Violations** — the `violations` dataset alias.
- **Citation outcomes** — the `citations` dataset alias.
- **Crashes** — the `crashes` dataset alias.

This makes filtering and export cleaner than a single sparse table with dozens of unrelated columns.

### Inspection output example

```json
{
  "recordType": "inspection",
  "inspectionId": 82031157,
  "reportNumber": "I032K10112",
  "usdotNumber": 3926944,
  "inspectionDate": "2024-06-27",
  "reportState": "TN",
  "inspectionLevel": "2",
  "carrierName": "ALL IN TRANSPORTATION GROUP LLC",
  "violationTotal": 2,
  "outOfServiceTotal": 2,
  "basicViolationCount": 2,
  "vehicle1Type": "TRUCK TRACTOR",
  "vehicle1Vin": "1XKYDP9X4KJ180049",
  "sourceDatasetId": "fx4q-ay7w",
  "sourceUrl": "https://data.transportation.gov/resource/fx4q-ay7w.json?..."
}
```

Fields unavailable in a particular official record are returned as `null`, not fabricated.

### Violation and citation output examples

A violation record:

```json
{
  "recordType": "violation",
  "inspectionId": 79551653,
  "violationId": 259210494,
  "usdotNumber": 3496981,
  "inspectionDate": "2023-08-22",
  "reportState": "CA",
  "violationCode": "395.8A-ELD",
  "cfrPart": "395",
  "cfrSection": "8(a)(1)",
  "description": "ELD - No record of duty status (ELD Required)",
  "outOfService": true,
  "citationNumber": "LD05488"
}
```

Its linked citation outcome:

```json
{
  "recordType": "citation",
  "inspectionId": 79551653,
  "violationSequenceNumber": 1,
  "usdotNumber": 3496981,
  "citationCode": "3",
  "citationResult": "Not Guilty/Dismissed",
  "violationCode": "395.8A-ELD",
  "violationOutOfService": true
}
```

### Crash output example

```json
{
  "recordType": "crash",
  "reportNumber": "AK0000251915",
  "usdotNumber": 2629156,
  "crashDate": "2025-07-17",
  "reportState": "AK",
  "fatalities": 0,
  "injuries": 1,
  "towAway": true,
  "roadSurfaceCondition": "Dry",
  "weatherCondition": "Other",
  "lightCondition": "Daylight",
  "vehicleVin": "1NKDL69X2WR779688",
  "severityWeight": 2
}
```

### Tips for reliable FMCSA safety searches

- Start with one USDOT number and 20 records.
- Add a date range when searching high-volume fleets.
- Select only the event types needed by your workflow.
- Use exact FMCSA violation codes, including punctuation.
- Schedule daily or weekly runs for active carrier portfolios.
- Keep source URLs when storing results in a warehouse.
- Treat absent BASIC enrichment as unavailable source data, not a zero.
- Supply your own Socrata app token only if anonymous rate limits affect a large run.
- For carrier census, authority, and contact fields, use the related FMCSA Motor Carrier Leads Scraper instead.

### FMCSA monitoring integrations

**FMCSA → Google Sheets**

Append fresh OOS violations for a broker's approved-carrier list and let compliance staff review changes in a shared sheet.

**FMCSA → Slack or Microsoft Teams**

Send an alert when a scheduled run finds a new crash, OOS inspection, or targeted ELD violation.

**FMCSA → Make or Zapier**

Trigger carrier-review tickets, update CRM risk fields, or notify an account owner when safety history changes.

**FMCSA → data warehouse**

Load each named dataset into separate inspection, violation, citation, and crash tables. Use `inspectionId` for supported joins.

**FMCSA → webhook**

Process a completed run immediately, score new events, and route high-severity results into underwriting or onboarding workflows.

### Using the Apify API

Replace `YOUR_APIFY_TOKEN` with your Apify API token.

**Node.js**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/fmcsa-inspections-violations-crashes-scraper').call({
  usdotNumbers: ['3496981'],
  recordTypes: ['inspection', 'violation', 'citation'],
  maxItems: 20,
});

console.log(run.id, run.status);
```

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_APIFY_TOKEN')
run = client.actor('automation-lab/fmcsa-inspections-violations-crashes-scraper').call(run_input={
    'usdotNumbers': ['3496981'],
    'recordTypes': ['violation', 'citation'],
    'maxItems': 20,
})
print(run['id'], run['status'])
```

**cURL**

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~fmcsa-inspections-violations-crashes-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"usdotNumbers":["3496981"],"recordTypes":["inspection"],"maxItems":20}'
```

The Run object exposes storage references for every declared dataset. The run-page Export button exports the default inspections dataset; choose the other datasets from the Storage tab or use their output URLs.

### Use with AI agents via MCP

Use this Actor from Claude Code, Claude Desktop, Cursor, VS Code, or another Model Context Protocol client.

**Claude Code**

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=automation-lab/fmcsa-inspections-violations-crashes-scraper"
```

**Claude Desktop, Cursor, or VS Code**

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/fmcsa-inspections-violations-crashes-scraper"
    }
  }
}
```

Authenticate with your Apify account when prompted.

Example prompts:

- "Use `automation-lab/fmcsa-inspections-violations-crashes-scraper` to review inspections and OOS violations for USDOT 3496981."
- "Find Alaska commercial-carrier crashes in July 2025 and summarize injuries, tow-away status, and weather."
- "Monitor these USDOT numbers for ELD violation code 395.8A-ELD and return citation outcomes."

### Official data sources and update behavior

The Actor uses these U.S. DOT Socrata resources:

- Vehicle Inspection File — `fx4q-ay7w`
- SMS Input - Inspection — `rbkj-cgst`
- Vehicle Inspections and Violations — `876r-jsdb`
- Inspections and Citations — `qbt8-7vic`
- SMS Input - Crash — `4wxs-vbns`

FMCSA source refresh schedules differ. A successful run means the current public API records were extracted; it does not guarantee that a newly filed event has already reached every source dataset.

### Limitations

- Date fields are normalized from the source's text formats.
- Citation datasets do not contain USDOT numbers directly; the Actor resolves carrier context through inspection IDs.
- BASIC and vehicle details may be absent for older or unmatched inspection records.
- `outOfServiceOnly` does not apply to crashes because crashes do not use an inspection OOS flag.
- A citation can exist without a matching published violation row.
- Anonymous Socrata access has public rate limits; an optional user app token can raise them.
- `maxItems` is a safety cap, not a claim that the source contains that many matching events.

### Is it legal to extract FMCSA safety data?

The Actor accesses records published anonymously by the U.S. Department of Transportation. Public availability does not remove every legal or contractual obligation.

Use the data for legitimate compliance, research, underwriting, or operational purposes. Follow applicable privacy, fair-credit, insurance, employment, data-retention, and anti-discrimination laws. Do not use the Actor to harass individuals or make unsupported safety claims.

Vehicle identifiers and carrier details should be protected according to your organization's security and retention policies. When a regulated decision depends on a record, verify it against the official source and allow appropriate human review.

### Troubleshooting

**Why did my run return fewer records than `maxItems`?**

`maxItems` is only an upper bound. The selected carrier, date range, state, record types, or violation codes may have fewer matching public records.

**Why are BASIC or vehicle fields null?**

Those fields come from a separate SMS inspection dataset. They remain null when report number and state do not produce a reliable match.

**Why did I receive inspections but no citations?**

Many inspections have no published citation outcome. Citation coverage and update timing also differ from the primary inspection source.

**Why are crash results empty for a narrow date range?**

Confirm the USDOT number and report state, then broaden the date range. The source may contain no reportable crash matching all filters.

### Frequently asked questions

**Does this Actor use the FMCSA SAFER website?**

No. It uses official DOT structured datasets rather than automating SAFER web pages.

**Do I need an FMCSA account or API key?**

No. Anonymous access is the default. A Socrata app token is optional for higher request limits.

**How fast is it?**

Small USDOT lookups usually finish in seconds because the Actor uses HTTP JSON endpoints and 256 MB memory. Broad joined searches take longer.

**Can I search multiple carriers?**

Yes. Add multiple values to `usdotNumbers`, then set a sensible shared `maxItems` limit.

**Does a citation result prove a carrier is unsafe?**

No. It is one public event field. Evaluate context, data freshness, dispositions, exposure, and applicable regulatory standards.

**Can I export Excel or CSV?**

Yes. Open a dataset in Apify Storage and choose CSV, Excel, JSON, XML, or another supported export format.

### Other transportation and compliance scrapers

Combine this Actor with other Automation Lab tools:

- [FMCSA Motor Carrier Leads Scraper](https://apify.com/automation-lab/fmcsa-motor-carrier-leads-scraper) — carrier census, authority, and lead discovery.
- [NHTSA Vehicle Complaints Scraper](https://apify.com/automation-lab/nhtsa-vehicle-complaints-scraper) — public vehicle complaint intelligence.
- [OSHA Inspections & Violations Scraper](https://apify.com/automation-lab/osha-inspections-violations-scraper) — workplace inspection and violation records.
- [NOAA Storm Events Database Scraper](https://apify.com/automation-lab/noaa-storm-events-database-scraper) — weather-event data for operational risk analysis.
- [SAM.gov Entity Exclusions Scraper](https://apify.com/automation-lab/sam-gov-entity-exclusions-scraper) — public exclusion screening.

Each Actor serves a different official source and workflow. Use the FMCSA Motor Carrier Leads Scraper for carrier discovery, then this Actor for raw safety-event monitoring.

### Data quality and responsible interpretation

FMCSA event records are useful risk signals, not complete judgments about a carrier or driver.

- Compare events with fleet size and operating exposure.
- Distinguish allegations, violations, citations, and adjudicated outcomes.
- Consider reporting and source-refresh delays.
- Keep null values distinct from zero values.
- Preserve source URLs and retrieval timestamps.
- Apply human review before consequential decisions.

This approach produces more defensible compliance and analytics workflows than treating a single count as a final safety score.

# Actor input Schema

## `usdotNumbers` (type: `array`):

Enter one or more carrier USDOT numbers without punctuation.

## `recordTypes` (type: `array`):

Select inspections, violations, citation outcomes, and/or crashes.

## `states` (type: `array`):

Filter by two-letter U.S. report-state codes such as CA, TX, or IL.

## `startDate` (type: `string`):

Include records on or after this date in YYYY-MM-DD format.

## `endDate` (type: `string`):

Include records on or before this date in YYYY-MM-DD format.

## `outOfServiceOnly` (type: `boolean`):

Keep inspections with OOS totals, OOS violations, and citations linked to OOS violations. This filter does not apply to crashes.

## `violationCodes` (type: `array`):

Filter violations and linked citations by exact FMCSA codes, for example 395.8A-ELD.

## `maxItems` (type: `integer`):

Stop after this many records across all selected record types.

## `startUrls` (type: `array`):

Optionally add official data.transportation.gov `/resource/<dataset>.json` URLs with custom SoQL query parameters.

## `appToken` (type: `string`):

Optionally provide your Socrata app token for higher rate limits. Anonymous access works by default.

## Actor input object example

```json
{
  "usdotNumbers": [
    "3496981"
  ],
  "recordTypes": [
    "inspection",
    "violation",
    "citation",
    "crash"
  ],
  "states": [],
  "outOfServiceOnly": false,
  "violationCodes": [],
  "maxItems": 20,
  "startUrls": []
}
```

# Actor output Schema

## `inspections` (type: `string`):

Roadside inspection records with carrier, OOS, BASIC, and vehicle context.

## `violations` (type: `string`):

Inspection violation records with CFR, OOS, and parent carrier context.

## `citations` (type: `string`):

Citation adjudication records linked to inspections and matching violations when available.

## `crashes` (type: `string`):

Commercial-carrier crash records with injury, road, weather, vehicle, and severity fields.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "usdotNumbers": [
        "3496981"
    ],
    "recordTypes": [
        "inspection",
        "violation",
        "citation",
        "crash"
    ],
    "states": [],
    "outOfServiceOnly": false,
    "violationCodes": [],
    "maxItems": 20,
    "startUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/fmcsa-inspections-violations-crashes-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "usdotNumbers": ["3496981"],
    "recordTypes": [
        "inspection",
        "violation",
        "citation",
        "crash",
    ],
    "states": [],
    "outOfServiceOnly": False,
    "violationCodes": [],
    "maxItems": 20,
    "startUrls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/fmcsa-inspections-violations-crashes-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "usdotNumbers": [
    "3496981"
  ],
  "recordTypes": [
    "inspection",
    "violation",
    "citation",
    "crash"
  ],
  "states": [],
  "outOfServiceOnly": false,
  "violationCodes": [],
  "maxItems": 20,
  "startUrls": []
}' |
apify call automation-lab/fmcsa-inspections-violations-crashes-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=automation-lab/fmcsa-inspections-violations-crashes-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "FMCSA Inspections, Violations & Crashes Scraper",
        "description": "Extract official FMCSA safety events: roadside inspections, CFR violations, citation outcomes, BASIC/OOS details, vehicles, and carrier crashes. Filter by USDOT, date, state, or code; export via API, CSV, Excel, and scheduled runs.",
        "version": "0.1",
        "x-build-id": "06vhkBVEYdDdVs1hR"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/automation-lab~fmcsa-inspections-violations-crashes-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-automation-lab-fmcsa-inspections-violations-crashes-scraper",
                "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/automation-lab~fmcsa-inspections-violations-crashes-scraper/runs": {
            "post": {
                "operationId": "runs-sync-automation-lab-fmcsa-inspections-violations-crashes-scraper",
                "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/automation-lab~fmcsa-inspections-violations-crashes-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-automation-lab-fmcsa-inspections-violations-crashes-scraper",
                "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": {
                    "usdotNumbers": {
                        "title": "🚚 USDOT numbers",
                        "type": "array",
                        "description": "Enter one or more carrier USDOT numbers without punctuation.",
                        "items": {
                            "type": "string",
                            "pattern": "^[0-9]{1,8}$"
                        }
                    },
                    "recordTypes": {
                        "title": "📋 Record types",
                        "type": "array",
                        "description": "Select inspections, violations, citation outcomes, and/or crashes.",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "inspection",
                            "violation",
                            "citation",
                            "crash"
                        ]
                    },
                    "states": {
                        "title": "🗺️ Report states",
                        "type": "array",
                        "description": "Filter by two-letter U.S. report-state codes such as CA, TX, or IL.",
                        "items": {
                            "type": "string",
                            "pattern": "^[A-Za-z]{2}$"
                        }
                    },
                    "startDate": {
                        "title": "Start date",
                        "pattern": "^$|^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                        "type": "string",
                        "description": "Include records on or after this date in YYYY-MM-DD format."
                    },
                    "endDate": {
                        "title": "End date",
                        "pattern": "^$|^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                        "type": "string",
                        "description": "Include records on or before this date in YYYY-MM-DD format."
                    },
                    "outOfServiceOnly": {
                        "title": "⚠️ Out-of-service only",
                        "type": "boolean",
                        "description": "Keep inspections with OOS totals, OOS violations, and citations linked to OOS violations. This filter does not apply to crashes.",
                        "default": false
                    },
                    "violationCodes": {
                        "title": "Violation codes",
                        "type": "array",
                        "description": "Filter violations and linked citations by exact FMCSA codes, for example 395.8A-ELD.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxItems": {
                        "title": "Maximum safety records",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Stop after this many records across all selected record types.",
                        "default": 20
                    },
                    "startUrls": {
                        "title": "🔗 Advanced Socrata start URLs",
                        "type": "array",
                        "description": "Optionally add official data.transportation.gov `/resource/<dataset>.json` URLs with custom SoQL query parameters.",
                        "items": {
                            "type": "string",
                            "pattern": "^https://data\\.transportation\\.gov/resource/[a-z0-9-]+\\.json(?:\\?.*)?$"
                        }
                    },
                    "appToken": {
                        "title": "Socrata app token",
                        "type": "string",
                        "description": "Optionally provide your Socrata app token for higher rate limits. Anonymous access works by default."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
