# HTS Tariff & Trade Scraper (`taroyamada/tariff-trade-change-digest`) Actor

Extract daily Harmonized Tariff Schedule updates from USITC and USTR releases. Protect your ecommerce supply chain margins with precise docket data.

- **URL**: https://apify.com/taroyamada/tariff-trade-change-digest.md
- **Developed by:** [naoki anzai](https://apify.com/taroyamada) (community)
- **Categories:** E-commerce, News
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Tariff Trade Change Digest | Federal Register + HTS Monitor

Managing international ecommerce logistics requires constant vigilance over Harmonized Tariff Schedule (HTS) codes and import regulations. This dedicated web scraper automatically monitors USITC HTS releases, USTR notices, and the Federal Register to extract crucial trade data directly from the source. When you run this scraper, it captures every new ruling, agency update, and document type, allowing you to quickly spot policy changes that might affect your supply chain costs or shipping margins.

Designed for ecommerce operations, freight forwarders, and procurement teams, this tool eliminates the need to manually browse dense government websites to search for details on changing import rules. You can easily schedule daily digests to scrape target keywords or specific commodity updates. The scraper navigates the official pages, pulls out the vital details, and structures the data into a clean, searchable format.

Every execution delivers precise outputs, including the issuing government agency, publication dates, official docket numbers, and direct URLs to the original notices. Automating your trade compliance workflow ensures you never miss a critical update. Whether you need to integrate tariff data into your logistics dashboards or track specific goods across federal publications, this data extraction tool keeps your operations compliant and informed.

### Store Quickstart

Run this actor with your target input. Results appear in the Apify Dataset and can be piped to webhooks for real-time delivery. Use `dryRun` to validate before committing to a schedule.

### Key Features

- 🏛️ **Government-sourced** — Pulls directly from official agency feeds — no third-party aggregators
- ⏱️ **Timely digests** — Daily/weekly rollups of new filings, rulings, or actions
- 🔍 **Keyword watchlists** — Flag items matching your compliance/legal watch terms
- 📊 **Structured metadata** — Agency, date, docket, document type, link — all dataset-ready
- 📡 **Webhook alerts** — Push to legal/compliance teams the moment new items match watchlist

### Use Cases

| Who | Why |
|-----|-----|
| Developers | Automate recurring data fetches without building custom scrapers |
| Data teams | Pipe structured output into analytics warehouses |
| Ops teams | Monitor changes via webhook alerts |
| Product managers | Track competitor/market signals without engineering time |

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| topics | array | **required** | One entry = one digest row. Keep each topic narrow: one Federal Register query plus one focused HTS keyword and/or small |
| watchTerms | string | — | Comma-separated terms added to every topic for highlighting notices and context. |
| lookbackDays | integer | `7` | Default lookback for Federal Register and USTR context filtering. |
| maxDocsPerTopic | integer | `20` | Upper bound on Federal Register documents returned for each topic. |
| maxPagesPerTopic | integer | `2` | Hard page cap for the Federal Register query. Keep low for recurring runs. |
| maxHtsMatchesPerTopic | integer | `15` | Default cap for HTS evidence rows when topic.hts.maxMatches is omitted. |
| delivery | string | `"dataset"` | dataset stores the digest JSON in the Apify dataset/local output. webhook posts the full payload to webhookUrl. |
| webhookUrl | string | — | Required only when delivery=webhook. |

#### Input Example

```json
{
  "lookbackDays": 7,
  "maxDocsPerTopic": 20,
  "maxPagesPerTopic": 2,
  "maxHtsMatchesPerTopic": 15,
  "delivery": "dataset",
  "datasetMode": "all",
  "snapshotKey": "tariff-trade-change-digest-state",
  "federalRegisterApiUrl": "https://www.federalregister.gov/api/v1/documents.json",
  "htsBaseUrl": "https://hts.usitc.gov/reststop/",
  "ustrRssUrl": "https://ustr.gov/rss.xml",
  "includeUstrContext": false,
  "requestTimeoutSeconds": 30,
  "notifyOnNoChange": true,
  "dryRun": false
}
```

### Input Examples

#### Example: Single-target audit

```json
{
  "targets": [
    "example-target-1"
  ],
  "maxResultsPerTarget": 30
}
```

#### Example: Bulk portfolio

```json
{
  "targets": [
    "target-1",
    "target-2",
    "target-3"
  ],
  "maxResultsPerTarget": 50,
  "snapshotKey": "tariff-trade-change-digest-state"
}
```

#### Example: Recurring delta watch

```json
{
  "targets": [
    "target-1"
  ],
  "snapshotKey": "tariff-trade-change-digest-state",
  "emitChangedOnly": true
}
```

### Output

| Field | Type | Description |
|-------|------|-------------|
| `meta` | object |  |
| `errors` | array |  |
| `digests` | array |  |
| `digests[].topicId` | string |  |
| `digests[].topicName` | string |  |
| `digests[].checkedAt` | timestamp |  |
| `digests[].status` | string |  |
| `digests[].baselineCreated` | boolean |  |
| `digests[].changedSinceLastRun` | boolean |  |
| `digests[].actionNeeded` | boolean |  |
| `digests[].recommendedAction` | string |  |
| `digests[].summary` | string |  |
| `digests[].signalTags` | array |  |
| `digests[].watchTerms` | array |  |
| `digests[].federalRegisterQuery` | object |  |
| `digests[].htsQuery` | object |  |
| `digests[].counts` | object |  |
| `digests[].evidence` | object |  |
| `digests[].error` | null |  |

#### Output Example

```json
{
  "meta": {
    "generatedAt": "2026-04-06T05:49:00.539Z",
    "now": "2026-04-03T12:00:00.000Z",
    "topicCount": 1,
    "changedTopicCount": 1,
    "actionNeededCount": 1,
    "currentHtsRelease": "2026HTSRev4",
    "totalFederalRegisterDocs": 2,
    "newFederalRegisterDocs": 1,
    "totalHtsMatches": 3,
    "htsChangedCount": 1,
    "noticeHitCount": 1,
    "ustrContextCount": 1,
    "snapshot": {
      "key": "tariff-trade-local-proof",
      "loadedFrom": "local",
      "savedTo": "local"
    },
    "sourceCoverage": {
      "federalRegisterApiUrl": "https://www.federalregister.gov/api/v1/documents.json",
      "htsBaseUrl": "https://hts.usitc.gov/reststop/",
      "ustrRssUrl": "https://ustr.gov/rss.xml",
      "ustrContextEnabled": true
    },
    "warnings": [],
    "executiveSummary": {
      "overallStatus": "action_needed",
      "brief": "1 topic(s) have tariff/trade changes requiring follow-up.",
      "actionItems": [
        "Review 1 action-needed topic(s): Section 301 China Tariffs",
        "1 tracked HTS line(s) changed across the watchlist",
        "1 new Federal Register document(s) matched topic queries",
        "1 new USITC notice(s) matched topic terms",
        "Treat USTR RSS items as context only until Federal Register or HTS confirms the change"
      ],
      "topicStatuses": [
        {
          "topicId": "section-301",
          "topicName": "Section 301 China Tariffs",
```

### API Usage

Run this actor programmatically using the Apify API. Replace `YOUR_API_TOKEN` with your token from [Apify Console → Settings → Integrations](https://console.apify.com/account/integrations).

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/taroyamada~tariff-trade-change-digest/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "lookbackDays": 7, "maxDocsPerTopic": 20, "maxPagesPerTopic": 2, "maxHtsMatchesPerTopic": 15, "delivery": "dataset", "datasetMode": "all", "snapshotKey": "tariff-trade-change-digest-state", "federalRegisterApiUrl": "https://www.federalregister.gov/api/v1/documents.json", "htsBaseUrl": "https://hts.usitc.gov/reststop/", "ustrRssUrl": "https://ustr.gov/rss.xml", "includeUstrContext": false, "requestTimeoutSeconds": 30, "notifyOnNoChange": true, "dryRun": false }'
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("taroyamada/tariff-trade-change-digest").call(run_input={
  "lookbackDays": 7,
  "maxDocsPerTopic": 20,
  "maxPagesPerTopic": 2,
  "maxHtsMatchesPerTopic": 15,
  "delivery": "dataset",
  "datasetMode": "all",
  "snapshotKey": "tariff-trade-change-digest-state",
  "federalRegisterApiUrl": "https://www.federalregister.gov/api/v1/documents.json",
  "htsBaseUrl": "https://hts.usitc.gov/reststop/",
  "ustrRssUrl": "https://ustr.gov/rss.xml",
  "includeUstrContext": false,
  "requestTimeoutSeconds": 30,
  "notifyOnNoChange": true,
  "dryRun": false
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### JavaScript / Node.js

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('taroyamada/tariff-trade-change-digest').call({
  "lookbackDays": 7,
  "maxDocsPerTopic": 20,
  "maxPagesPerTopic": 2,
  "maxHtsMatchesPerTopic": 15,
  "delivery": "dataset",
  "datasetMode": "all",
  "snapshotKey": "tariff-trade-change-digest-state",
  "federalRegisterApiUrl": "https://www.federalregister.gov/api/v1/documents.json",
  "htsBaseUrl": "https://hts.usitc.gov/reststop/",
  "ustrRssUrl": "https://ustr.gov/rss.xml",
  "includeUstrContext": false,
  "requestTimeoutSeconds": 30,
  "notifyOnNoChange": true,
  "dryRun": false
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Tips & Limitations

- Run daily for active watchlists; weekly for passive monitoring.
- Webhook delivery works well for compliance team Slack channels — include docket URL for 1-click access.
- Use `watchKeywords` generously — false positives are cheap to triage, false negatives miss filings.
- Pair with `regulatory-change-monitor` for cross-agency coverage.
- Archive Dataset rows weekly for long-term compliance evidence retention.

### FAQ

**How far back does history go?**

This actor monitors forward-only — new items since first run. For historical data, use the agency's own search tool.

**What timezones are used?**

All timestamps are UTC. Use your downstream pipeline to convert to agency-local time if needed.

**Does it translate non-English content?**

No — original language is preserved. Use downstream translation services if needed.

**Is the data official?**

Yes — sourced directly from official government websites and feeds. Not a third-party aggregator.

**Can I use this for legal research?**

For alerting and monitoring, yes. For litigation research, cross-verify with primary sources (agency websites) — this actor is a monitoring tool, not a legal database.

### Related Actors

Government & Regulatory cluster — explore related Apify tools:

- [EPA Enforcement Digest | ECHO Compliance Risk Monitor](https://apify.com/taroyamada/epa-enforcement-digest) — Monitor EPA ECHO all-media facility search, corporate compliance screener, and enforcement case feeds with one summary-first digest row per watched company, facility, or case feed.
- [FDA Warning Letters Digest | Summary-First Feed](https://apify.com/taroyamada/fda-warning-letter-digest) — Monitor public FDA warning letters with one summary-first digest row per configured feed.
- [Federal Register Digest | Agency Rule & Notice Monitor](https://apify.com/taroyamada/federal-register-digest) — Monitor Federal Register documents — rules, proposed rules, and notices — per configured agency feed.
- [Government Contract Award Monitor | Award & Competitor Watch](https://apify.com/taroyamada/government-contract-award-monitor) — Monitor public-sector contract award notices for new wins, notable awardees, incumbent recompetes, and competitor signals — one digest row per configured feed without brittle broad crawling.
- [Grants.gov Funding Digest | Opportunity Watch & Signal Digest](https://apify.com/taroyamada/grants-gov-funding-digest) — Monitor Grants.
- [NHTSA Vehicle Recall Digest | Recalls + Complaints Watch](https://apify.com/taroyamada/nhtsa-vehicle-recall-digest) — Monitor official NHTSA vehicle recall and complaint endpoints for watched model-family, VIN, and manufacturer feeds.
- [Product Safety Recall Digest | CPSC + openFDA Alerts](https://apify.com/taroyamada/product-safety-recall-digest) — Monitor CPSC saferproducts.
- [Regulatory Change Monitor API](https://apify.com/taroyamada/regulatory-change-monitor) — Monitor official regulator update feeds, government bulletin pages, and public compliance notices with one action-oriented digest row per monitored source.
- [OFAC Sanctions Change Digest | SDN List Monitor](https://apify.com/taroyamada/sanctions-change-digest) — Monitor the OFAC SDN (Specially Designated Nationals) sanctions list for additions and removals.
- [Treasury Fiscal Data Digest | Debt, Rates & Budget Monitor](https://apify.com/taroyamada/treasury-fiscal-data-digest) — Monitor the U.
- [USPTO Patent Monitor API | JSON + Webhook](https://apify.com/taroyamada/uspto-patent-scraper) — Search and monitor US patent filings with multi-source fallback.
- [Campaign Finance & Lobbying Digest | FEC + LDA Watch](https://apify.com/taroyamada/campaign-finance-lobbying-digest) — Monitor official FEC OpenFEC committee reports and LDA.

### Cost

**Pay Per Event**:

- `actor-start`: $0.01 (flat fee per run)
- `dataset-item`: $0.003 per output item

**Example**: 1,000 items = $0.01 + (1,000 × $0.003) = **$3.01**

No subscription required — you only pay for what you use.

### ⭐ Was this helpful?

If this actor saved you time, please [**leave a ★ rating**](https://apify.com/taroyamada/tariff-trade-change-digest/reviews) on Apify Store. It takes 10 seconds, helps other developers discover it, and keeps updates free.

Bug report or feature request? Open an issue on the [Issues tab](https://apify.com/taroyamada/tariff-trade-change-digest/issues) of this actor.

# Actor input Schema

## `topics` (type: `array`):

One entry = one digest row. Keep each topic narrow: one Federal Register query plus one focused HTS keyword and/or small HTS code set.

## `watchTerms` (type: `string`):

Comma-separated terms added to every topic for highlighting notices and context.

## `lookbackDays` (type: `integer`):

Default lookback for Federal Register and USTR context filtering.

## `maxDocsPerTopic` (type: `integer`):

Upper bound on Federal Register documents returned for each topic.

## `maxPagesPerTopic` (type: `integer`):

Hard page cap for the Federal Register query. Keep low for recurring runs.

## `maxHtsMatchesPerTopic` (type: `integer`):

Default cap for HTS evidence rows when topic.hts.maxMatches is omitted.

## `delivery` (type: `string`):

dataset stores the digest JSON in the Apify dataset/local output. webhook posts the full payload to webhookUrl.

## `webhookUrl` (type: `string`):

Required only when delivery=webhook.

## `datasetMode` (type: `string`):

all emits every topic row. action\_needed emits only action-needed rows. changed\_only emits only topics with changes since the last run.

## `snapshotKey` (type: `string`):

Stable key used to persist seen Federal Register docs plus current HTS state across recurring runs.

## `federalRegisterApiUrl` (type: `string`):

Public Federal Register documents endpoint.

## `htsBaseUrl` (type: `string`):

Public no-auth HTS REST base URL.

## `ustrRssUrl` (type: `string`):

Optional context-only RSS feed. Default: https://ustr.gov/rss.xml

## `includeUstrContext` (type: `boolean`):

Global default for topic.useUstrContext.

## `requestTimeoutSeconds` (type: `integer`):

Timeout for each public-source HTTP request.

## `notifyOnNoChange` (type: `boolean`):

When false, stable topics are omitted unless datasetMode requires them.

## `dryRun` (type: `boolean`):

Skip snapshot writes and webhook delivery.

## `nowIso` (type: `string`):

ISO timestamp used for deterministic fixture tests.

## `fixturePath` (type: `string`):

Local JSON fixture bundle for offline tests and proofs.

## Actor input object example

```json
{
  "topics": [
    {
      "id": "section-301",
      "name": "Section 301 China Tariffs",
      "watchTerms": "section 301,chapter 99,additional duties",
      "useUstrContext": true,
      "federalRegister": {
        "agencySlug": "trade-representative-office-of-united-states",
        "documentTypes": "NOTICE",
        "keywords": "tariff"
      },
      "hts": {
        "searchTerm": "9903.88",
        "htsCodes": "9903.88.01,9903.88.03,9903.88.05",
        "maxMatches": 10
      }
    }
  ],
  "lookbackDays": 7,
  "maxDocsPerTopic": 20,
  "maxPagesPerTopic": 2,
  "maxHtsMatchesPerTopic": 15,
  "delivery": "dataset",
  "datasetMode": "all",
  "snapshotKey": "tariff-trade-change-digest-state",
  "federalRegisterApiUrl": "https://www.federalregister.gov/api/v1/documents.json",
  "htsBaseUrl": "https://hts.usitc.gov/reststop/",
  "ustrRssUrl": "https://ustr.gov/rss.xml",
  "includeUstrContext": false,
  "requestTimeoutSeconds": 30,
  "notifyOnNoChange": true,
  "dryRun": false
}
```

# 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 = {
    "topics": [
        {
            "id": "section-301",
            "name": "Section 301 China Tariffs",
            "watchTerms": "section 301,chapter 99,additional duties",
            "useUstrContext": true,
            "federalRegister": {
                "agencySlug": "trade-representative-office-of-united-states",
                "documentTypes": "NOTICE",
                "keywords": "tariff"
            },
            "hts": {
                "searchTerm": "9903.88",
                "htsCodes": "9903.88.01,9903.88.03,9903.88.05",
                "maxMatches": 10
            }
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("taroyamada/tariff-trade-change-digest").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 = { "topics": [{
            "id": "section-301",
            "name": "Section 301 China Tariffs",
            "watchTerms": "section 301,chapter 99,additional duties",
            "useUstrContext": True,
            "federalRegister": {
                "agencySlug": "trade-representative-office-of-united-states",
                "documentTypes": "NOTICE",
                "keywords": "tariff",
            },
            "hts": {
                "searchTerm": "9903.88",
                "htsCodes": "9903.88.01,9903.88.03,9903.88.05",
                "maxMatches": 10,
            },
        }] }

# Run the Actor and wait for it to finish
run = client.actor("taroyamada/tariff-trade-change-digest").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 '{
  "topics": [
    {
      "id": "section-301",
      "name": "Section 301 China Tariffs",
      "watchTerms": "section 301,chapter 99,additional duties",
      "useUstrContext": true,
      "federalRegister": {
        "agencySlug": "trade-representative-office-of-united-states",
        "documentTypes": "NOTICE",
        "keywords": "tariff"
      },
      "hts": {
        "searchTerm": "9903.88",
        "htsCodes": "9903.88.01,9903.88.03,9903.88.05",
        "maxMatches": 10
      }
    }
  ]
}' |
apify call taroyamada/tariff-trade-change-digest --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=taroyamada/tariff-trade-change-digest",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/f0A4d3ZshxCWxVJJN/builds/h05rAs4QNrlCvfEJo/openapi.json
