# DAT Freight Rates Scraper (`parseforge/dat-freight-rates-scraper`) Actor

Scrape DAT Trendlines freight data: national spot and contract rates, state load-to-truck ratios, week/month/year-over-year trends, and fuel prices. Built for freight brokers and dispatchers.

- **URL**: https://apify.com/parseforge/dat-freight-rates-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $18.75 / 1,000 result items

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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

![ParseForge Banner](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)

## 🚚 DAT Freight Rates Scraper

> 🚀 **Pull live US and Canadian freight market rates in seconds.** Filter by equipment, rate type, country, and time bucket. No API key, no registration, no manual CSV wrangling.

> 🕒 **Last updated:** 2026-05-16 · **📊 24 fields** per record · **4 datasets** in one feed · **183 state-level supply/demand rows** · **3 years of monthly rate history**

DAT Freight & Analytics runs the largest load board in North America, and the Trendlines pages it publishes are the closest thing the trucking industry has to a public price index. This scraper turns those pages into a flat Apify dataset. Every run captures the **national rate history** (spot and contract, weekly and monthly, going back roughly **three years**), the **load-to-truck ratio** for **every US state and Canadian province**, the **week, month, and year-over-year** percentage moves, and the **current national diesel reference price**. The output is one row per data point, which is the shape spreadsheets, Postgres, and pandas already speak.

Freight brokers, dispatchers, and 3PL pricing teams check DAT daily to figure out what a lane should pay. When the dashboard hangs or the iQ subscription is between renewals, the only fallback is calling carriers one by one. This actor gives you a programmatic version of the public Trendlines view, so quotes go out backed by current numbers and contract negotiations cite the same baseline both sides reference. Pair it with a scheduled Apify run and you have a daily rate sheet feeding your CRM, BI tool, or rate sheet, with zero scraping plumbing to maintain.

| 🎯 Target audience | 💡 Primary use cases |
|---|---|
| Freight brokers and dispatcher teams | Daily lane-context rate checks for shipper quotes |
| Owner-operator carriers | Verify carrier pay against published spot rates |
| 3PL pricing and procurement teams | Build a market-truth baseline for RFP responses |
| Logistics software vendors | Power rate widgets without paying a market data subscription |
| Supply chain analysts and researchers | Track freight cycle indicators alongside fuel and demand |
| Shippers verifying invoices | Spot underbid lanes and overcharged contracts |

---

### 📋 What the DAT Freight Rates Scraper does

- 📡 **National rate history.** Monthly buckets back ~3 years and weekly buckets back ~1 year, with the average rate per mile in USD plus the average fuel surcharge per trip.
- 🚚 **Load-to-truck ratio per state.** One row per US state and Canadian province for van, flatbed, and reefer, with the load count, truck count, and computed ratio.
- 📈 **Trend percentages.** Week, month, and year-over-year change for spot rate, load-to-truck ratio, load postings, truck postings, and fuel.
- ⛽ **National diesel price.** The reference price per gallon DAT publishes alongside the rates.
- 🎛️ **Smart filters.** Restrict by equipment (van, flatbed, reefer, intermodal), rate type (spot shipper-to-broker, spot broker-to-carrier, contract), country (US, CA), period type (month, week), or state code.
- 🧾 **One flat row per data point.** Every dataset writes to the same shape, so SQL joins and pandas pivots are trivial.

Every record carries its source URL on dat.com, the dataset tag, every relevant filter (equipment, rate type, country, state, period), the numeric values, and a precise scrape timestamp. The schema is stable, so daily appends stitch into a clean longitudinal store.

> 💡 **Why it matters:** A broker who avoids one underquoted load per week saves hundreds of dollars in margin. Owning a current rate feed instead of refreshing a vendor dashboard ten times an hour pays for itself within the first month.

---

### 🎬 Full Demo

🚧 Coming soon: a 3-minute walkthrough of the input form, a sample run, and a Google Sheets dashboard that consumes the dataset.

---

### ⚙️ Input

<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
</thead>
<tbody>
<tr><td><code>maxItems</code></td><td>integer</td><td>Cap on the number of records returned. Free users are limited to 10.</td><td><code>10</code></td></tr>
<tr><td><code>datasets</code></td><td>array of enum</td><td>Which Trendlines datasets to scrape: <code>national_history</code>, <code>load_truck_ratio</code>, <code>national_trends</code>, <code>fuel_price</code>.</td><td>All four</td></tr>
<tr><td><code>equipments</code></td><td>array of enum</td><td>Equipment categories to include: <code>VAN</code>, <code>FLATBED</code>, <code>REEFER</code>, <code>INTERMODAL</code>.</td><td><code>["VAN", "FLATBED", "REEFER"]</code></td></tr>
<tr><td><code>rateTypes</code></td><td>array of enum</td><td>Rate types for <code>national_history</code>: <code>SHIPPER_TO_BROKER_SPOT</code>, <code>BROKER_TO_CARRIER_SPOT</code>, <code>CONTRACT</code>.</td><td>All three</td></tr>
<tr><td><code>countries</code></td><td>array of enum</td><td>Countries for <code>national_history</code>: <code>US</code>, <code>CA</code>.</td><td><code>["US", "CA"]</code></td></tr>
<tr><td><code>periodTypes</code></td><td>array of enum</td><td>Time bucket granularity for <code>national_history</code>: <code>Month</code> (~36 buckets) or <code>Week</code> (~52 buckets).</td><td><code>["Month", "Week"]</code></td></tr>
<tr><td><code>states</code></td><td>array of enum</td><td>Optional list of state or province ISO codes to filter the <code>load_truck_ratio</code> dataset.</td><td>All states</td></tr>
</tbody>
</table>

Example: van and reefer monthly US spot rates plus load-to-truck for Texas and California.

```json
{
    "datasets": ["national_history", "load_truck_ratio"],
    "equipments": ["VAN", "REEFER"],
    "rateTypes": ["SHIPPER_TO_BROKER_SPOT"],
    "countries": ["US"],
    "periodTypes": ["Month"],
    "states": ["TX", "CA"]
}
````

Example: full national snapshot for a daily warehousing job.

```json
{
    "datasets": ["national_history", "load_truck_ratio", "national_trends", "fuel_price"],
    "equipments": ["VAN", "FLATBED", "REEFER"],
    "rateTypes": ["SHIPPER_TO_BROKER_SPOT", "BROKER_TO_CARRIER_SPOT", "CONTRACT"],
    "countries": ["US", "CA"],
    "periodTypes": ["Month", "Week"]
}
```

> ⚠️ **Good to Know:** This actor pulls from the public Trendlines API that powers dat.com/trendlines. The numbers are the same ones DAT publishes to the general public. Lane-level rates (specific origin-destination city pairs) are gated behind DAT's paid iQ subscription and are not part of this scraper's scope.

***

### 📊 Output

Every record is one flat object representing a single data point from one of the four datasets.

#### 🧾 Schema

| Field | Type | Example |
|---|---|---|
| 🆔 `recordId` | string | `national_history\|VAN\|SHIPPER_TO_BROKER_SPOT\|US\|Month\|2026-04-01` |
| 🏷️ `dataset` | string | `national_history` |
| 🚛 `equipment` | string | `VAN` |
| 💸 `rateType` | string | `SHIPPER_TO_BROKER_SPOT` |
| 🌎 `country` | string | `US` |
| 📍 `stateCode` | string | `TX` |
| ⏲️ `periodType` | string | `Month` |
| 📅 `periodStart` | string | `2026-04-01` |
| 🗓️ `year` | integer | `2026` |
| 🔢 `month` | integer | `4` |
| 💰 `rateUsd` | number | `2.24` |
| ⛽ `fuelSurchargePerTripUsd` | number | `0.71` |
| 📦 `loadCount` | number | `11842.5` |
| 🚚 `truckCount` | number | `743.1` |
| ⚖️ `loadToTruckRatio` | number | `9.915` |
| 🛢️ `fuelPricePerGallonUsd` | number | `5.64` |
| 📊 `metric` | string | `spot_rate` |
| 📈 `weekOverWeekPct` | number | `1.322` |
| 📉 `monthOverMonthPct` | number | `0` |
| 🗓️ `yearOverYearPct` | number | `4.455` |
| 🕒 `asOfDate` | string | `2026-05-11` |
| 🔗 `sourceUrl` | string | `https://www.dat.com/trendlines/van/national-rates` |
| ⏰ `scrapedAt` | string | `2026-05-16T04:56:50.643Z` |
| ❗ `error` | string | (populated only on failure) |

#### 📦 Sample records

<details>
<summary><strong>Typical: VAN spot rate for April 2026 (national_history, monthly)</strong></summary>

```json
{
    "recordId": "national_history|VAN|SHIPPER_TO_BROKER_SPOT|US|Month|2026-04-01",
    "dataset": "national_history",
    "equipment": "VAN",
    "rateType": "SHIPPER_TO_BROKER_SPOT",
    "country": "US",
    "stateCode": null,
    "periodType": "Month",
    "periodStart": "2026-04-01",
    "year": 2026,
    "month": 4,
    "rateUsd": 2.24,
    "fuelSurchargePerTripUsd": 0.71,
    "loadCount": null,
    "truckCount": null,
    "loadToTruckRatio": null,
    "fuelPricePerGallonUsd": null,
    "metric": null,
    "weekOverWeekPct": null,
    "monthOverMonthPct": null,
    "yearOverYearPct": null,
    "asOfDate": null,
    "sourceUrl": "https://www.dat.com/trendlines/van/national-rates",
    "scrapedAt": "2026-05-16T04:56:50.643Z",
    "error": null
}
```

</details>

<details>
<summary><strong>Edge case: Ontario flatbed load-to-truck ratio (cross-border supply/demand)</strong></summary>

```json
{
    "recordId": "load_truck_ratio|FLATBED|ON",
    "dataset": "load_truck_ratio",
    "equipment": "FLATBED",
    "rateType": null,
    "country": "CA",
    "stateCode": "ON",
    "periodType": null,
    "periodStart": null,
    "year": null,
    "month": null,
    "rateUsd": null,
    "fuelSurchargePerTripUsd": null,
    "loadCount": 1842.43,
    "truckCount": 27.43,
    "loadToTruckRatio": 67.17,
    "fuelPricePerGallonUsd": null,
    "metric": null,
    "weekOverWeekPct": null,
    "monthOverMonthPct": null,
    "yearOverYearPct": null,
    "asOfDate": null,
    "sourceUrl": "https://www.dat.com/trendlines/flatbed/demand-and-capacity",
    "scrapedAt": "2026-05-16T04:56:50.643Z",
    "error": null
}
```

</details>

<details>
<summary><strong>Sparse: national diesel fuel price (fuel_price, single row)</strong></summary>

```json
{
    "recordId": "fuel_price|US|2026-05-11",
    "dataset": "fuel_price",
    "equipment": null,
    "rateType": null,
    "country": "US",
    "stateCode": null,
    "periodType": null,
    "periodStart": "2026-05-11",
    "year": null,
    "month": null,
    "rateUsd": null,
    "fuelSurchargePerTripUsd": null,
    "loadCount": null,
    "truckCount": null,
    "loadToTruckRatio": null,
    "fuelPricePerGallonUsd": 5.64,
    "metric": "fuel_price",
    "weekOverWeekPct": null,
    "monthOverMonthPct": null,
    "yearOverYearPct": null,
    "asOfDate": "2026-05-11",
    "sourceUrl": "https://www.dat.com/trendlines",
    "scrapedAt": "2026-05-16T04:56:50.643Z",
    "error": null
}
```

</details>

***

### ✨ Why choose this Actor

| Capability | What you get |
|---|---|
| 🧾 | **Four datasets in one feed.** National rate history, state-level supply/demand, trend percentages, and fuel price land in the same dataset. |
| 🚛 | **Every equipment category that matters.** Van, flatbed, reefer, and intermodal in one input, no separate runs per truck type. |
| ⏳ | **Three years of rate history.** Monthly buckets back ~36 periods and weekly buckets back ~52, ready for time-series modelling. |
| 🌎 | **US and Canadian coverage.** State and provincial rows on the same schema, so cross-border lanes share a baseline. |
| 🎛️ | **Filters at every axis.** Restrict equipment, rate type, country, period, state, or dataset without writing code. |
| 🚦 | **Built-in retries.** Handles 429 and 503 from the upstream gracefully so scheduled jobs survive load spikes. |
| 🚀 | **No API key.** Public DAT Trendlines endpoints only, so you ship a market data feed without keys or contracts. |

> 📊 **A full run with default filters produces roughly 1,800 records covering three years of national rate history, current state-level supply/demand for three equipment categories, every published trend percentage, and the latest diesel reference price.**

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Filters | Setup |
|---|---|---|---|---|---|
| ⭐ **DAT Freight Rates Scraper** *(this Actor)* | Pay-per-run | 4 datasets, US and CA | On demand or scheduled | Equipment, rate type, country, period, state | Click run |
| Paid live freight market APIs | High monthly subscription | Multi-source | Streaming | Limited | API key, contract |
| Official trade publications | Free | Headlines and weekly summaries | Weekly | None | Read and copy |
| Legacy community spreadsheets | Free | Stale or partial | Quarterly at best | None | Manual joins |
| Build your own scraper | Engineering hours | Whatever you build | Whatever you build | Whatever you build | Significant engineering |

If you want a turnkey freight market data feed without paying a paid index subscription or maintaining your own crawler, this actor is the shortest path.

***

### 🚀 How to use

1. 📝 **Sign up for Apify.** Create a free account at [console.apify.com/sign-up?fpr=vmoqkp](https://console.apify.com/sign-up?fpr=vmoqkp).
2. 🎛️ **Pick your datasets.** Leave the defaults to grab everything, or narrow to just `national_history` for a pure time-series pull.
3. 🔍 **Set your filters.** Choose equipment, rate type, country, period granularity, and optional state codes.
4. ▶️ **Run.** Click Start and watch the dataset fill.
5. 📤 **Export.** Pull JSON, CSV, or XLSX, or wire the dataset into Make, Zapier, BigQuery, Postgres, or your own webhook.

> ⏱️ **Total time:** Under two minutes from sign-up to first dataset row.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%">

#### 🚚 Freight brokers

- Quote shippers with current spot rate context
- Avoid underquoting on van, flatbed, and reefer lanes
- Audit invoices against published contract rates
- Spot supply-tight states to repost loads at higher pay

</td>
<td width="50%">

#### 🛻 Owner-operators and small carriers

- Negotiate truck rate floors with confidence
- Reposition empty trucks toward high load-to-truck states
- Track fuel surcharge baselines for billing
- Validate broker-quoted pay against the published spot

</td>
</tr>
<tr>
<td width="50%">

#### 📊 3PL pricing and procurement teams

- Build RFP responses on a documented market baseline
- Compare carrier bids against contract reference rates
- Forecast budget impact when fuel surcharges shift
- Track year-over-year freight inflation by equipment

</td>
<td width="50%">

#### 🧑‍💻 Logistics software vendors

- Power a rate sheet feature without buying a paid feed
- Embed market indicators inside TMS and ERP dashboards
- Trigger pricing alerts on threshold breaches
- Differentiate analytics products with built-in baselines

</td>
</tr>
</table>

***

### 🌟 Beyond business use cases

Data like this powers more than commercial workflows. The same structured records support research, education, civic projects, and personal initiatives.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Empirical datasets for papers, thesis work, and coursework
- Longitudinal studies tracking changes across snapshots
- Reproducible research with cited, versioned data pulls
- Classroom exercises on data analysis and ethical scraping

</td>
<td width="50%">

#### 🎨 Personal and creative

- Side projects, portfolio demos, and indie app launches
- Data visualizations, dashboards, and infographics
- Content research for bloggers, YouTubers, and podcasters
- Hobbyist collections and personal trackers

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Non-profit and civic

- Transparency reporting and accountability projects
- Advocacy campaigns backed by public-interest data
- Community-run databases for local issues
- Investigative journalism on public records

</td>
<td width="50%">

#### 🧪 Experimentation

- Prototype AI and machine-learning pipelines with real data
- Validate product-market hypotheses before engineering spend
- Train small domain-specific models on niche corpora
- Test dashboard concepts with live input

</td>
</tr>
</table>

***

### 🔌 Automating DAT Freight Rates Scraper

Wire this actor into the rest of your stack with a few lines of code or a saved schedule.

- 🟢 [**Node.js client**](https://docs.apify.com/sdk/js/) for calling the actor from JavaScript or TypeScript projects.
- 🐍 [**Python client**](https://docs.apify.com/sdk/python/) for notebooks, FastAPI endpoints, or Airflow DAGs.
- 📚 [**Apify API reference**](https://docs.apify.com/api/v2) for raw REST integration in any language.

Schedules turn this actor into a low-cost market data subscription. Run it daily for an always-fresh rate sheet feeding your CRM, hourly during contract season for rapid bid reactions, or weekly for a longitudinal warehouse you can backfill into BigQuery or Postgres. The dataset chains naturally with downstream actors and webhooks, so you can branch on a load-to-truck ratio threshold or post a Slack alert when the national diesel price moves more than a configured percentage.

***

### ❓ Frequently Asked Questions

<details>
<summary><strong>🔑 Do I need a DAT account or API key?</strong></summary>

No. The actor uses only the public Trendlines endpoints that power dat.com/trendlines, which require no key, no signing, and no authentication.

</details>

<details>
<summary><strong>📊 What exactly is in the dataset?</strong></summary>

Four datasets in one feed: national rate history (monthly and weekly buckets back ~3 years), load-to-truck ratio for every US state and Canadian province, trend percentages (week, month, and year over year for spot rate, supply, demand, and fuel), and the current national diesel reference price.

</details>

<details>
<summary><strong>🛣️ Does this return lane-level rates between specific cities?</strong></summary>

No. Origin-to-destination lane rates are gated behind DAT's paid iQ subscription and are out of scope. This actor surfaces the national and state-level public data that powers the Trendlines pages. That data is still what most brokers cite when establishing a market baseline.

</details>

<details>
<summary><strong>⏱️ How fresh is the data?</strong></summary>

Every record is fetched at run time directly from the DAT Trendlines API. Monthly buckets update once per month, weekly buckets refresh weekly, the load-to-truck ratio is a rolling average, and the fuel price reflects the most recent reference survey. The `scrapedAt` field records the exact moment of capture.

</details>

<details>
<summary><strong>🚛 Which equipment categories are supported?</strong></summary>

Van, flatbed, and reefer for every dataset. Intermodal is supported for national rate history. State-level load-to-truck ratios cover the three road equipment types only, which matches what DAT publishes.

</details>

<details>
<summary><strong>🌎 Does it cover Canada?</strong></summary>

Yes. National rate history is published for both US and CA. Load-to-truck ratios include Canadian provinces alongside US states on the same schema.

</details>

<details>
<summary><strong>💼 Can I use this commercially?</strong></summary>

Yes. The dataset is yours once produced and is suitable for commercial dashboards, brokerage workflows, research products, and analytics that you resell. The underlying Trendlines data is published for general consumption.

</details>

<details>
<summary><strong>💳 Do I need a paid Apify plan?</strong></summary>

No, the free tier lets you preview up to 10 records per run. Paid plans support larger runs (up to 1,000,000 records), scheduling, and longer dataset retention. [Sign up here](https://console.apify.com/sign-up?fpr=vmoqkp).

</details>

<details>
<summary><strong>🛟 What if a run fails or returns fewer items than expected?</strong></summary>

The upstream API occasionally returns 429 or 503 under load. The actor retries with exponential backoff. If a single combination of filters fails after retries, the rest of the dataset is still saved and a warning is logged so the output remains usable.

</details>

<details>
<summary><strong>⚖️ Is scraping DAT Trendlines legal?</strong></summary>

The actor only accesses the public Trendlines API that DAT publishes for general viewing, the same endpoints that fill the dat.com/trendlines pages. You are responsible for compliance with DAT's terms and any regulations that apply to your specific use case, especially when redistributing data.

</details>

<details>
<summary><strong>🔁 Can I schedule the actor to run on an interval?</strong></summary>

Yes. Apify schedules let you run the actor every minute, hour, day, or any cron expression you write. Pair that with webhooks to push fresh records into your warehouse or alerting system automatically.

</details>

<details>
<summary><strong>🧮 How should I model rate movements over time?</strong></summary>

Each `national_history` row carries `periodStart`, `year`, and `month` (monthly) or `periodStart` (weekly), so you can group, pivot, or chart directly. Pair `rateUsd` with `fuelSurchargePerTripUsd` for an all-in cost view, and join the `national_trends` rows for built-in week-over-week and year-over-year context.

</details>

***

### 🔌 Integrate with any app

- [**Zapier**](https://zapier.com/) - route every new dataset row to spreadsheets, Slack, or your CRM.
- [**Make**](https://www.make.com/) - chain Apify runs into visual automations with conditional logic.
- [**n8n**](https://n8n.io/) - self-hosted workflows for full data ownership.
- [**Google Sheets**](https://workspace.google.com/products/sheets/) - drop CSV exports into shared sheets for rate-desk review.
- [**Airtable**](https://airtable.com/) - structured base for cross-equipment rate trackers.
- [**Slack**](https://slack.com/) - push spread alerts and tight-supply notifications straight into channels.

***

### 🔗 Recommended Actors

- [**📰 Freightwaves Scraper**](https://apify.com/parseforge/freightwaves-scraper) - freight news, analytics, and SONAR commentary alongside this rate feed.
- [**🛡️ FMCSA Carrier Safety Scraper**](https://apify.com/parseforge/fmcsa-carrier-safety-scraper) - safety ratings and inspection history for carriers you are about to dispatch.
- [**📦 UPS Package Tracking Scraper**](https://apify.com/parseforge/ups-package-tracking-scraper) - parcel-side visibility to complement truckload rates.
- [**🚚 FedEx Package Tracking Scraper**](https://apify.com/parseforge/fedex-tracking-scraper) - second parcel network for end-to-end shipment dashboards.
- [**📈 FRED Economic Data Scraper**](https://apify.com/parseforge/fred-scraper) - macro indicators (fuel CPI, freight indices, GDP) to contextualise the freight cycle.

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more logistics, freight, and market-data actors.

***

**🆘 Need Help?** [**Open our contact form**](https://tally.so/r/BzdKgA) and we will respond within one business day.

***

> ⚠️ **Disclaimer:** This actor extracts publicly available freight market data from the DAT Trendlines pages for informational purposes only. None of the data returned constitutes pricing or financial advice. You are responsible for ensuring your use complies with DAT's terms of service and any obligations that apply in your jurisdiction, especially when redistributing data.

# Actor input Schema

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

Free users: limited to 10 items (preview). Paid users: optional, up to 1,000,000.

## `datasets` (type: `array`):

Which Trendlines datasets to scrape. `national_history` is a time series of national average rates per equipment, rate type, and country. `load_truck_ratio` is the supply/demand indicator per US/Canadian state. `national_trends` is week/month/year-over-year percentages. `fuel_price` is the current national diesel reference price.

## `equipments` (type: `array`):

Equipment categories to include. Applies to `national_history` and `load_truck_ratio`.

## `rateTypes` (type: `array`):

Rate types to include for `national_history`. SPOT-shipper-to-broker is what shippers pay brokers. SPOT-broker-to-carrier is what brokers pay carriers. CONTRACT is the contractual rate.

## `countries` (type: `array`):

Countries to include for `national_history`. `load_truck_ratio` always returns the full North American grid.

## `periodTypes` (type: `array`):

Time period granularities to fetch for `national_history`. Month returns monthly buckets going back ~3 years. Week returns weekly buckets going back ~1 year.

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

Optional list of US state or Canadian province ISO codes to restrict the `load_truck_ratio` dataset. Leave empty to return every state and province DAT publishes.

## Actor input object example

```json
{
  "maxItems": 10,
  "datasets": [
    "national_history",
    "load_truck_ratio",
    "national_trends",
    "fuel_price"
  ],
  "equipments": [
    "VAN",
    "FLATBED",
    "REEFER"
  ],
  "rateTypes": [
    "SHIPPER_TO_BROKER_SPOT",
    "BROKER_TO_CARRIER_SPOT",
    "CONTRACT"
  ],
  "countries": [
    "US",
    "CA"
  ],
  "periodTypes": [
    "Month",
    "Week"
  ],
  "states": []
}
```

# Actor output Schema

## `overview` (type: `string`):

Default tabular view of every scraped record.

## `fullData` (type: `string`):

Complete dataset items.

# 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 = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/dat-freight-rates-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 = { "maxItems": 10 }

# Run the Actor and wait for it to finish
run = client.actor("parseforge/dat-freight-rates-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 '{
  "maxItems": 10
}' |
apify call parseforge/dat-freight-rates-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parseforge/dat-freight-rates-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "DAT Freight Rates Scraper",
        "description": "Scrape DAT Trendlines freight data: national spot and contract rates, state load-to-truck ratios, week/month/year-over-year trends, and fuel prices. Built for freight brokers and dispatchers.",
        "version": "0.1",
        "x-build-id": "AtsdzTCWMhpgshn0d"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~dat-freight-rates-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-dat-freight-rates-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/parseforge~dat-freight-rates-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-dat-freight-rates-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/parseforge~dat-freight-rates-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-dat-freight-rates-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": {
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: limited to 10 items (preview). Paid users: optional, up to 1,000,000."
                    },
                    "datasets": {
                        "title": "Datasets to Scrape",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Which Trendlines datasets to scrape. `national_history` is a time series of national average rates per equipment, rate type, and country. `load_truck_ratio` is the supply/demand indicator per US/Canadian state. `national_trends` is week/month/year-over-year percentages. `fuel_price` is the current national diesel reference price.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "national_history",
                                "load_truck_ratio",
                                "national_trends",
                                "fuel_price"
                            ],
                            "enumTitles": [
                                "National rate history (time series)",
                                "Load-to-truck ratio (per state)",
                                "National trend percentages",
                                "Fuel price (national diesel)"
                            ]
                        },
                        "default": [
                            "national_history",
                            "load_truck_ratio",
                            "national_trends",
                            "fuel_price"
                        ]
                    },
                    "equipments": {
                        "title": "Equipment Categories",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Equipment categories to include. Applies to `national_history` and `load_truck_ratio`.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "VAN",
                                "FLATBED",
                                "REEFER",
                                "INTERMODAL"
                            ],
                            "enumTitles": [
                                "Dry Van",
                                "Flatbed",
                                "Reefer (Refrigerated)",
                                "Intermodal"
                            ]
                        },
                        "default": [
                            "VAN",
                            "FLATBED",
                            "REEFER"
                        ]
                    },
                    "rateTypes": {
                        "title": "Rate Types",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Rate types to include for `national_history`. SPOT-shipper-to-broker is what shippers pay brokers. SPOT-broker-to-carrier is what brokers pay carriers. CONTRACT is the contractual rate.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "SHIPPER_TO_BROKER_SPOT",
                                "BROKER_TO_CARRIER_SPOT",
                                "CONTRACT"
                            ],
                            "enumTitles": [
                                "Spot (shipper to broker)",
                                "Spot (broker to carrier)",
                                "Contract"
                            ]
                        },
                        "default": [
                            "SHIPPER_TO_BROKER_SPOT",
                            "BROKER_TO_CARRIER_SPOT",
                            "CONTRACT"
                        ]
                    },
                    "countries": {
                        "title": "Countries",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Countries to include for `national_history`. `load_truck_ratio` always returns the full North American grid.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "US",
                                "CA"
                            ],
                            "enumTitles": [
                                "United States",
                                "Canada"
                            ]
                        },
                        "default": [
                            "US",
                            "CA"
                        ]
                    },
                    "periodTypes": {
                        "title": "Period Granularity",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Time period granularities to fetch for `national_history`. Month returns monthly buckets going back ~3 years. Week returns weekly buckets going back ~1 year.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "Month",
                                "Week"
                            ],
                            "enumTitles": [
                                "Monthly buckets",
                                "Weekly buckets"
                            ]
                        },
                        "default": [
                            "Month",
                            "Week"
                        ]
                    },
                    "states": {
                        "title": "State Codes (Load-to-Truck Ratio)",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Optional list of US state or Canadian province ISO codes to restrict the `load_truck_ratio` dataset. Leave empty to return every state and province DAT publishes.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "AB",
                                "AK",
                                "AL",
                                "AR",
                                "AZ",
                                "BC",
                                "CA",
                                "CO",
                                "CT",
                                "DC",
                                "DE",
                                "FL",
                                "GA",
                                "HI",
                                "IA",
                                "ID",
                                "IL",
                                "IN",
                                "KS",
                                "KY",
                                "LA",
                                "MA",
                                "MB",
                                "MD",
                                "ME",
                                "MI",
                                "MN",
                                "MO",
                                "MS",
                                "MT",
                                "NB",
                                "NC",
                                "ND",
                                "NE",
                                "NH",
                                "NJ",
                                "NL",
                                "NM",
                                "NS",
                                "NV",
                                "NY",
                                "OH",
                                "OK",
                                "ON",
                                "OR",
                                "PA",
                                "PE",
                                "QC",
                                "RI",
                                "SC",
                                "SD",
                                "SK",
                                "TN",
                                "TX",
                                "UT",
                                "VA",
                                "VT",
                                "WA",
                                "WI",
                                "WV",
                                "WY"
                            ],
                            "enumTitles": [
                                "Alberta",
                                "Alaska",
                                "Alabama",
                                "Arkansas",
                                "Arizona",
                                "British Columbia",
                                "California",
                                "Colorado",
                                "Connecticut",
                                "District of Columbia",
                                "Delaware",
                                "Florida",
                                "Georgia",
                                "Hawaii",
                                "Iowa",
                                "Idaho",
                                "Illinois",
                                "Indiana",
                                "Kansas",
                                "Kentucky",
                                "Louisiana",
                                "Massachusetts",
                                "Manitoba",
                                "Maryland",
                                "Maine",
                                "Michigan",
                                "Minnesota",
                                "Missouri",
                                "Mississippi",
                                "Montana",
                                "New Brunswick",
                                "North Carolina",
                                "North Dakota",
                                "Nebraska",
                                "New Hampshire",
                                "New Jersey",
                                "Newfoundland and Labrador",
                                "New Mexico",
                                "Nova Scotia",
                                "Nevada",
                                "New York",
                                "Ohio",
                                "Oklahoma",
                                "Ontario",
                                "Oregon",
                                "Pennsylvania",
                                "Prince Edward Island",
                                "Quebec",
                                "Rhode Island",
                                "South Carolina",
                                "South Dakota",
                                "Saskatchewan",
                                "Tennessee",
                                "Texas",
                                "Utah",
                                "Vermont",
                                "Virginia",
                                "Washington",
                                "Wisconsin",
                                "West Virginia",
                                "Wyoming"
                            ]
                        },
                        "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
