# CARS-511 Traveler Info Extractor (`datamule/cars-511-traveler-extractor`) Actor

Point at ANY CARS-511 DOT deployment and extract its traveler-information collections over the public REST API: road events, incidents, construction, traffic cameras, and winter-road conditions. One normalized row per record + the full raw record. Seeded on Ontario & Alberta 511.

- **URL**: https://apify.com/datamule/cars-511-traveler-extractor.md
- **Developed by:** [Datamule](https://apify.com/datamule) (community)
- **Categories:** Developer tools, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 traveler records

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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## CARS-511 Traveler Info Extractor

Point at **any CARS-511 traveler-information deployment** and extract its
public collections — **road events, incidents, construction, traffic cameras,
and winter-road conditions** — over the CARS REST API
(`GET /api/v2/get/<collection>?format=json`). One normalized row per record,
plus the full original record preserved under `raw`.

CARS (Castle Rock Advanced Traveler Information System, the "511" platform)
backs many US-state and Canadian-province traveler-info sites, and they share
the same REST contract — so one actor reads any deployment that publishes its
collections as JSON. Verified live against **Ontario** (`https://511on.ca`) and
**Alberta** (`https://511.alberta.ca`).

### What you get

One normalized row per record, keyed on the always-present `id`, with a
best-effort common subset mapped from whatever the collection provides and the
**complete original record kept verbatim under `raw`** (so no field is ever
lost across the divergent per-authority / per-collection shapes):

| Field | Description |
|-------|-------------|
| `id` | Record ID — always present, the row key (`ID` on events, `Id` on cameras/winterroads) |
| `roadwayName` | Road / highway name (nullable) |
| `description` | Event description / location description (nullable) |
| `severity` | Severity, where the collection provides it (nullable) |
| `eventType` / `eventSubType` | Event classification (nullable) |
| `direction` | Direction of travel (nullable) |
| `organization` | Reporting organization / camera source (nullable) |
| `location` | Location text / area name (nullable) |
| `condition` | Road-surface condition, for winter roads (nullable) |
| `isFullClosure` | Full-closure flag, for events (nullable) |
| `lanesAffected` | Lanes affected text (nullable) |
| `latitude` / `longitude` | Coordinates, where present (nullable — winter-road segments carry none) |
| `reported` / `startDate` / `plannedEndDate` / `lastUpdated` | Unix epoch timestamps (nullable) |
| `imageUrls` | Camera view URLs, for the `cameras` collection (nullable) |
| `raw` | The complete original CARS record, verbatim |
| `_baseUrl` / `_collection` / `_page` / `_rowIndex` | Provenance |

### Input

| Field | Required | Description |
|-------|----------|-------------|
| `baseUrl` | ✅ | 511 / CARS base URL, e.g. `https://511on.ca` or `https://511.alberta.ca` |
| `collection` | | `event` (default) · `cameras` · `roadwork` · `winterroads` · `signs` · `ferries` |
| `maxRecords` | | Stop after N records (default 2000) |

#### Per-authority coverage

The CARS collections a site serves **vary by authority**. `event` and
`cameras` have the widest coverage; `roadwork` / `winterroads` / `signs` /
`ferries` are published by some authorities only (e.g. Alberta publishes
`winterroads`; Ontario publishes `event` + `cameras`). A collection a host does
not serve returns HTTP 404, and this actor **fails fast** for that run rather
than emitting an empty result.

### Example

```json
{
  "baseUrl": "https://511on.ca",
  "collection": "event",
  "maxRecords": 200
}
```

### Use cases

- **Logistics & fleet routing** — live road closures, construction, and
  incidents along a corridor.
- **Road-risk analysis** — winter-road conditions and full-closure flags for
  routing and safety models.
- **Traffic-camera indexing** — camera locations and their live image-view URLs.
- **Traveler-info dashboards** — a normalized feed of a region's 511 events.

### How it works

- Forces `?format=json` + `Accept: application/json` and reads the collection as
  a single JSON array (the CARS get endpoint returns the whole collection at
  once).
- Detects the record id case-insensitively (`ID` vs `Id`), maps a normalized
  common subset, and preserves the full original record under `raw`.
- **Fails fast — never a fabricated empty success** — if the base URL is
  unreachable, serves HTML instead of JSON (a 511 site without a JSON API), 404s
  the requested collection, returns a non-array body, or the collection returned
  zero records.

### Pricing

Pay-per-event: **$0.0005 per record** (tiered volume discount by subscription
tier). You pay only for records actually emitted.

# Actor input Schema

## `baseUrl` (type: `string`):

Base URL of ANY CARS-511 traveler-information deployment (Castle Rock ATIS, the platform behind many US-state and Canadian-province '511' sites). Its collections are read via the public REST API GET /api/v2/get/<collection>?format=json. Verified live: https://511on.ca (Ontario) and https://511.alberta.ca (Alberta). NOTE: not every 511 authority serves JSON — some return the HTML map or 404; this actor fails fast (never emits empty) when a host does not publish the requested collection as JSON.

## `collection` (type: `string`):

Which CARS-511 collection to extract. 'event' = road events / incidents / construction (widest coverage). 'cameras' = traffic cameras + their image-view URLs. 'roadwork' / 'winterroads' / 'signs' / 'ferries' are served by SOME authorities only (e.g. Alberta publishes 'winterroads'; Ontario publishes only event + cameras) — a collection a host does not serve returns 404 and this actor fails fast for that run.

## `maxRecords` (type: `integer`):

Stop after emitting this many records. The CARS get endpoint returns the whole collection in one JSON array, so this simply caps how many of those records are emitted. Each emitted record is billed as one record.

## `userAgent` (type: `string`):

Override the default descriptive User-Agent header. Many 511 sites are public-sector deployments — please keep a descriptive agent.

## `timeoutSecs` (type: `integer`):

Per-request timeout in seconds for the collection fetch (some collections return large arrays).

## Actor input object example

```json
{
  "baseUrl": "https://511on.ca",
  "collection": "event",
  "maxRecords": 2000,
  "timeoutSecs": 90
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "baseUrl": "https://511on.ca"
};

// Run the Actor and wait for it to finish
const run = await client.actor("datamule/cars-511-traveler-extractor").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 = { "baseUrl": "https://511on.ca" }

# Run the Actor and wait for it to finish
run = client.actor("datamule/cars-511-traveler-extractor").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 '{
  "baseUrl": "https://511on.ca"
}' |
apify call datamule/cars-511-traveler-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datamule/cars-511-traveler-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/JgKKolTOrY7tITEDn/builds/xF5u6IY5FgryJ0wuS/openapi.json
