# Tariff Trade Change Digest | Federal Register + HTS Monitor (`taroyamada/tariff-trade-change-digest`) Actor

Monitor U.S. tariff and trade changes with one summary-first digest row per configured topic. Combines Federal Register trade notices, USITC HTS releases/search/notices, and optional USTR RSS context.

- **URL**: https://apify.com/taroyamada/tariff-trade-change-digest.md
- **Developed by:** [太郎 山田](https://apify.com/taroyamada) (community)
- **Categories:** Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN 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 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

## 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. 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.

Integrate these automated digests into your daily operations to ensure no tariff hike catches your business off guard. You can export the extracted data seamlessly into your existing logistics platforms or set up webhook alerts to notify your team the instant a relevant trade policy shifts. Protect your bottom line by using reliable, automated tools to extract essential regulatory data.

### 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
}
````

### 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Tariff Trade Change Digest | Federal Register + HTS Monitor",
        "description": "Monitor U.S. tariff and trade changes with one summary-first digest row per configured topic. Combines Federal Register trade notices, USITC HTS releases/search/notices, and optional USTR RSS context.",
        "version": "0.1",
        "x-build-id": "sKvOE3nq4Y8PzaGju"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/taroyamada~tariff-trade-change-digest/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-taroyamada-tariff-trade-change-digest",
                "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/taroyamada~tariff-trade-change-digest/runs": {
            "post": {
                "operationId": "runs-sync-taroyamada-tariff-trade-change-digest",
                "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/taroyamada~tariff-trade-change-digest/run-sync": {
            "post": {
                "operationId": "run-sync-taroyamada-tariff-trade-change-digest",
                "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",
                "required": [
                    "topics"
                ],
                "properties": {
                    "topics": {
                        "title": "Topics / watchlists to monitor (required)",
                        "type": "array",
                        "description": "One entry = one digest row. Keep each topic narrow: one Federal Register query plus one focused HTS keyword and/or small HTS code set.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "title": "Topic ID",
                                    "type": "string",
                                    "description": "Stable identifier used in snapshots and output rows."
                                },
                                "name": {
                                    "title": "Topic name",
                                    "type": "string",
                                    "description": "Human-readable label for this tariff/trade watchlist."
                                },
                                "description": {
                                    "title": "Topic description",
                                    "type": "string",
                                    "description": "Optional internal note about why this topic matters."
                                },
                                "watchTerms": {
                                    "title": "Topic watch terms",
                                    "type": "string",
                                    "description": "Comma-separated terms used for action-needed highlighting (e.g. section 301, chapter 99, additional duties)."
                                },
                                "useUstrContext": {
                                    "title": "Include USTR RSS context",
                                    "type": "boolean",
                                    "description": "When true, relevant USTR RSS items are attached as context only. They do not replace Federal Register or HTS evidence.",
                                    "default": false
                                },
                                "federalRegister": {
                                    "title": "Federal Register query",
                                    "type": "object",
                                    "editor": "json",
                                    "description": "Single Federal Register query for this topic. Keep it narrow and legally traceable.",
                                    "properties": {
                                        "agencySlug": {
                                            "title": "Primary agency slug",
                                            "type": "string",
                                            "description": "Defaults to trade-representative-office-of-united-states."
                                        },
                                        "agencySlugs": {
                                            "title": "Additional agency slugs",
                                            "type": "string",
                                            "description": "Comma-separated extra Federal Register agency slugs."
                                        },
                                        "documentTypes": {
                                            "title": "Document types",
                                            "type": "string",
                                            "description": "Comma-separated types: NOTICE, RULE, PRORULE, PRESDOCU. Defaults to NOTICE."
                                        },
                                        "keywords": {
                                            "title": "Federal Register keywords",
                                            "type": "string",
                                            "description": "Required comma-separated query keywords. Example: tariff, semiconductor, critical minerals."
                                        },
                                        "lookbackDays": {
                                            "title": "Topic-specific lookback window",
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 365,
                                            "description": "Optional override for the global lookbackDays."
                                        }
                                    }
                                },
                                "hts": {
                                    "title": "USITC HTS query",
                                    "type": "object",
                                    "editor": "json",
                                    "description": "Focused HTS keyword and/or small code set for this topic.",
                                    "properties": {
                                        "searchTerm": {
                                            "title": "HTS search term",
                                            "type": "string",
                                            "description": "Optional focused HTS keyword or chapter 99 code prefix such as 9903.88."
                                        },
                                        "htsCodes": {
                                            "title": "Tracked HTS codes",
                                            "type": "string",
                                            "description": "Optional comma-separated exact HTS codes or prefixes. Keep the set small (ideally <= 8)."
                                        },
                                        "maxMatches": {
                                            "title": "Max HTS matches in evidence",
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 100,
                                            "description": "Upper bound on HTS items returned in the evidence payload."
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "watchTerms": {
                        "title": "Global watch terms",
                        "type": "string",
                        "description": "Comma-separated terms added to every topic for highlighting notices and context."
                    },
                    "lookbackDays": {
                        "title": "Global lookback window (days)",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "Default lookback for Federal Register and USTR context filtering.",
                        "default": 7
                    },
                    "maxDocsPerTopic": {
                        "title": "Max Federal Register docs per topic",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Upper bound on Federal Register documents returned for each topic.",
                        "default": 20
                    },
                    "maxPagesPerTopic": {
                        "title": "Max Federal Register API pages per topic",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Hard page cap for the Federal Register query. Keep low for recurring runs.",
                        "default": 2
                    },
                    "maxHtsMatchesPerTopic": {
                        "title": "Default max HTS matches per topic",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Default cap for HTS evidence rows when topic.hts.maxMatches is omitted.",
                        "default": 15
                    },
                    "delivery": {
                        "title": "Delivery mode",
                        "enum": [
                            "dataset",
                            "webhook"
                        ],
                        "type": "string",
                        "description": "dataset stores the digest JSON in the Apify dataset/local output. webhook posts the full payload to webhookUrl.",
                        "default": "dataset"
                    },
                    "webhookUrl": {
                        "title": "Webhook URL",
                        "type": "string",
                        "description": "Required only when delivery=webhook."
                    },
                    "datasetMode": {
                        "title": "Dataset output mode",
                        "enum": [
                            "all",
                            "action_needed",
                            "changed_only"
                        ],
                        "type": "string",
                        "description": "all emits every topic row. action_needed emits only action-needed rows. changed_only emits only topics with changes since the last run.",
                        "default": "all"
                    },
                    "snapshotKey": {
                        "title": "Snapshot key",
                        "type": "string",
                        "description": "Stable key used to persist seen Federal Register docs plus current HTS state across recurring runs.",
                        "default": "tariff-trade-change-digest-state"
                    },
                    "federalRegisterApiUrl": {
                        "title": "Federal Register API URL",
                        "type": "string",
                        "description": "Public Federal Register documents endpoint.",
                        "default": "https://www.federalregister.gov/api/v1/documents.json"
                    },
                    "htsBaseUrl": {
                        "title": "USITC HTS base URL",
                        "type": "string",
                        "description": "Public no-auth HTS REST base URL.",
                        "default": "https://hts.usitc.gov/reststop/"
                    },
                    "ustrRssUrl": {
                        "title": "USTR RSS URL",
                        "type": "string",
                        "description": "Optional context-only RSS feed. Default: https://ustr.gov/rss.xml",
                        "default": "https://ustr.gov/rss.xml"
                    },
                    "includeUstrContext": {
                        "title": "Enable USTR context for all topics",
                        "type": "boolean",
                        "description": "Global default for topic.useUstrContext.",
                        "default": false
                    },
                    "requestTimeoutSeconds": {
                        "title": "HTTP request timeout (seconds)",
                        "minimum": 5,
                        "maximum": 120,
                        "type": "integer",
                        "description": "Timeout for each public-source HTTP request.",
                        "default": 30
                    },
                    "notifyOnNoChange": {
                        "title": "Emit rows even when no changes detected",
                        "type": "boolean",
                        "description": "When false, stable topics are omitted unless datasetMode requires them.",
                        "default": true
                    },
                    "dryRun": {
                        "title": "Dry run",
                        "type": "boolean",
                        "description": "Skip snapshot writes and webhook delivery.",
                        "default": false
                    },
                    "nowIso": {
                        "title": "Override current time (testing)",
                        "type": "string",
                        "description": "ISO timestamp used for deterministic fixture tests."
                    },
                    "fixturePath": {
                        "title": "Fixture file path (testing)",
                        "type": "string",
                        "description": "Local JSON fixture bundle for offline tests and proofs."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
