# USITC Trade Remedy Intelligence MCP — Section 337 & Trade (`andrew_avina/usitc-intelligence-mcp`) Actor

The USITC Trade Intelligence MCP is an Apify actor that exposes US international trade data via the Model Context Protocol. It gives AI assistants — Claude, GPT-4, and any MCP-compatible agent — structured access to two critical trade intelligence datasets:

- **URL**: https://apify.com/andrew\_avina/usitc-intelligence-mcp.md
- **Developed by:** [Andrew Avina](https://apify.com/andrew_avina) (community)
- **Categories:** MCP servers, Business
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 result item returneds

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

## USITC Trade Intelligence MCP
#### US Trade Remedies, Section 337 IP Cases & Import/Export Statistics

The **USITC Trade Intelligence MCP** is an Apify actor that exposes US international trade data via the Model Context Protocol. It gives AI assistants — Claude, GPT-4, and any MCP-compatible agent — structured access to two critical trade intelligence datasets:

1. **US Import/Export Statistics** by HTS (Harmonized Tariff Schedule) code from the US Census Bureau International Trade API — the official source for US merchandise trade data.

2. **USITC Section 337 Investigations** — the intellectual property trade remedy proceedings at the US International Trade Commission that can result in sweeping import exclusion orders blocking products at the US border.

Together these datasets cover the two questions every trade attorney, customs professional, and supply chain analyst needs to answer: *"What is actually being imported, from where, and at what value?"* and *"Is someone trying to block these imports on IP grounds?"*

---

### Why This Matters

**Section 337 is the most powerful IP remedy in US law.** A successful Section 337 complaint results in a general exclusion order — US Customs blocks every infringing import at the port of entry, from every manufacturer, forever. Unlike district court patent litigation that takes years and results only in damages, Section 337 cases move fast (typical target: 15 months) and the remedy is immediate and sweeping.

Every company that imports products — consumer electronics, medical devices, automotive parts, semiconductors, EVs, solar panels — needs to monitor Section 337 for cases that could block their supply chain.

**US trade statistics are the foundation of supply chain intelligence.** Knowing that 87% of US semiconductor imports come from Taiwan lets you quantify geopolitical risk. Knowing the monthly import value of HTS 8703 (automobiles) from Mexico lets you model tariff impact scenarios. This data is public and authoritative — it comes from the US government's own customs records — but it was only accessible through clunky web interfaces until now.

---

### Who This Is For

#### Customs and Trade Attorneys
- Monitor all active Section 337 investigations for cases affecting your clients' products
- Identify whether a new complaint covers your client's imported products
- Track case progression from institution to final determination
- Research historical 337 cases by technology area for litigation strategy

#### Import Compliance Officers
- Screen new product categories for pending Section 337 exclusion orders
- Monitor HTS codes relevant to your import portfolio for IP disputes
- Assess country-of-origin risk for supply chain diversification decisions
- Track tariff and trade remedy exposure by HTS code

#### Investment and Equity Analysts
- Identify companies that face Section 337 import bans affecting revenue
- Quantify supply chain concentration risk using country-by-HTS import data
- Monitor trade dispute escalation in semiconductor, EV, and solar sectors
- Find early signals of trade policy shifts from new investigation filings

#### Supply Chain and Procurement Teams
- Assess geographic concentration of US imports by product category
- Model tariff scenarios using actual HTS-level import values
- Identify alternative sourcing countries for supply chain resilience
- Monitor Section 337 cases that could block your current suppliers

#### International Business Development
- Find HTS codes with high US import values as market sizing data
- Identify sectors with active IP disputes as competitive intelligence
- Track trade remedy patterns by technology area
- Assess regulatory risk for new product categories before market entry

#### Policy Researchers and Trade Economists
- Analyze trends in Section 337 filings by technology sector
- Study the relationship between trade volumes and IP disputes
- Track the shift from Chinese to alternative-source imports over time
- Research the impact of trade remedies on import patterns

---

### Data Sources

#### US Census Bureau International Trade API
- **URL:** `https://api.census.gov/data/{year}/timeseries/intltrade/`
- **Coverage:** All US merchandise imports and exports by HTS commodity code
- **Granularity:** Monthly data by country of origin/destination
- **Historical depth:** 2010–present (recent years most reliable)
- **Access:** Free with Census DEMO_KEY (rate-limited) or free registered key
- **Authority:** Official US government customs declaration data

#### USITC Section 337 Investigation Dataset
- **Source:** USITC public docket records (https://www.usitc.gov/)
- **Implementation:** Hardcoded dataset of ~20 notable and recent cases (2019–2024)
- **Coverage:** Semiconductors, smartphones, EVs, solar, medical devices, AI hardware, robotics, drones
- **Full docket:** https://www.usitc.gov/intellectual_property/section_337_investigations.htm
- **Access:** Free (USITC is a public agency; all docket records are public)

---

### MCP Tools

#### 1. `search_trade_data`

Query US import or export statistics by HTS code from the Census Bureau International Trade API. Returns monthly trade flow values by country of origin or destination.

**Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `hts_code` | string | Yes | 4-10 digit HTS commodity code |
| `trade_type` | string | No | `"imports"` or `"exports"` (default: `"imports"`) |
| `year` | integer | No | Data year (default: 2023) |
| `country_code` | string | No | Census Bureau 4-char country code filter |
| `limit` | integer | No | Max results (default 20, max 100) |

**Output fields:**
| Field | Description |
|-------|-------------|
| `hts_code` | Input HTS code |
| `description` | HTS code description |
| `import_value` | Import value in USD for the period |
| `export_value` | Export value in USD for the period |
| `year` | Data year |
| `month` | Month number |
| `country_code` | Census Bureau country code |
| `country_name` | Country name |
| `trade_type` | `"imports"` or `"exports"` |
| `source` | Always `"census.gov/trade"` |

**Common HTS codes:**

| HTS Code | Product Category | 2023 US Import Scale |
|----------|-----------------|----------------------|
| `8703` | Passenger vehicles (automobiles) | ~$200B/year |
| `8471` | Computers and laptops | ~$140B/year |
| `8517` | Smartphones and phones | ~$100B/year |
| `8541` | Semiconductors and diodes | ~$80B/year |
| `2709` | Crude petroleum oils | ~$180B/year |
| `3004` | Pharmaceuticals | ~$140B/year |
| `8708` | Automotive parts | ~$70B/year |
| `6110` | Sweaters and knitwear | ~$20B/year |
| `0901` | Coffee | ~$10B/year |
| `8536` | Electrical switches/connectors | ~$40B/year |

**Example query:**
```json
{
  "name": "search_trade_data",
  "arguments": {
    "hts_code": "8541",
    "trade_type": "imports",
    "year": 2023,
    "limit": 20
  }
}
````

***

#### 2. `search_337_investigations`

Search USITC Section 337 IP trade investigations. Returns investigation ID, title, complainant, respondent, technology, status, product, and whether an import ban was issued.

**Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `query` | string | No | Keyword search across all fields |
| `status` | string | No | Filter by status (`Active`, `Terminated`, `Settlement`) |
| `respondent` | string | No | Filter by defendant company name |
| `complainant` | string | No | Filter by plaintiff company name |
| `technology` | string | No | Filter by technology area |
| `limit` | integer | No | Max results (default 20) |

**Output fields:**
| Field | Description |
|-------|-------------|
| `investigation_id` | USITC docket number (e.g. `337-TA-1395`) |
| `title` | Official investigation title |
| `complainant` | Company that filed the complaint (plaintiff) |
| `respondent` | Companies accused of importing infringing goods |
| `status` | Current case status |
| `product` | Products at issue |
| `technology` | Technology category |
| `filed_date` | Date complaint was filed |
| `institution_date` | Date ITC officially instituted the investigation |
| `import_ban` | Boolean — whether an exclusion order was issued |
| `notes` | Strategic context and key case facts |

**Example searches:**

Find all active semiconductor/AI chip cases:

```json
{
  "name": "search_337_investigations",
  "arguments": {
    "technology": "semiconductor",
    "status": "Active"
  }
}
```

Find all cases where Apple was the respondent:

```json
{
  "name": "search_337_investigations",
  "arguments": {
    "respondent": "Apple"
  }
}
```

Find cases that resulted in import bans:

```json
{
  "name": "search_337_investigations",
  "arguments": {
    "query": "import ban",
    "status": "Terminated"
  }
}
```

**Notable cases in dataset:**

| Inv. ID | Product | Parties | Status |
|---------|---------|---------|--------|
| 337-TA-1369 | Apple Watch blood oxygen sensors | Apple v. Masimo | Active |
| 337-TA-1395 | AI accelerator chips (NVIDIA, AMD) | Rambus v. NVIDIA/AMD | Active |
| 337-TA-1356 | EV battery cells | LG v. SK Innovation | $1.8B Settlement |
| 337-TA-1338 | Solar panels | Hanwha v. Chinese manufacturers | No Violation Found |
| 337-TA-1332 | Smartwatch ECG | AliveCor v. Apple | ITC Ban Reversed |
| 337-TA-1381 | Smart speakers | Jawbone v. Google/Amazon/Apple | Active |

***

#### 3. `get_top_import_countries`

For a given HTS code and year, return top import source countries ranked by total annual import value, with share of total imports.

**Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `hts_code` | string | Yes | 4-10 digit HTS code |
| `year` | integer | No | Data year (default: 2023) |
| `limit` | integer | No | Number of top countries (default 15, max 50) |

**Output fields:**
| Field | Description |
|-------|-------------|
| `hts_code` | Input HTS code |
| `country_code` | Census Bureau country code |
| `country_name` | Country name |
| `import_value` | Total annual import value in USD |
| `share_pct` | Percentage share of total imports (0–100) |
| `year` | Data year |

**Example — find semiconductor import country concentration:**

```json
{
  "name": "get_top_import_countries",
  "arguments": {
    "hts_code": "8541",
    "year": 2023,
    "limit": 10
  }
}
```

**Strategic use — China+1 analysis:**

Run `get_top_import_countries` for any HTS code to see:

- What percentage of US imports come from China
- Which countries are the next largest suppliers
- Where supply chain diversification is already occurring
- Whether ally-shoring (to Japan, South Korea, Mexico, EU) is viable

***

### Quick Start

#### Option 1: Batch Mode

**Query semiconductor import country rankings:**

```json
{
  "hts_code": "8541",
  "mode": "countries",
  "year": 2023,
  "limit": 15
}
```

**Search active Section 337 cases in EV technology:**

```json
{
  "mode": "337",
  "query": "electric vehicle",
  "status": "Active"
}
```

**Get monthly automobile import data:**

```json
{
  "hts_code": "8703",
  "mode": "trade",
  "tradeType": "imports",
  "year": 2023,
  "limit": 50
}
```

#### Option 2: MCP Server Mode

```json
{
  "serveMcp": true
}
```

**Claude Desktop config:**

```json
{
  "mcpServers": {
    "usitc-intelligence": {
      "command": "npx",
      "args": ["-y", "@apify/actor-mcp-bridge", "your-actor-run-url:4321"]
    }
  }
}
```

Once connected, Claude can answer:

- *"What percentage of US semiconductor imports came from Taiwan vs China in 2023?"*
- *"Show me all active Section 337 cases involving AI or semiconductor technology"*
- *"Is NVIDIA currently a respondent in any USITC trade remedy investigation?"*
- *"What are the top 10 source countries for US EV battery imports (HTS 8507)?"*
- *"Find all Section 337 cases that resulted in an import exclusion order"*
- *"What is the total value of US smartphone imports from China in 2023?"*

***

### Input Schema Reference

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `mode` | string | `"trade"` | Query mode: `trade`, `337`, or `countries` |
| `hts_code` | string | `"8471"` | HTS commodity code (required for trade/countries modes) |
| `tradeType` | string | `"imports"` | `"imports"` or `"exports"` |
| `year` | integer | `2023` | Data year |
| `countryCode` | string | `""` | Census country code filter |
| `query` | string | `""` | Keyword search (Section 337 mode) |
| `status` | string | `""` | Case status filter (Section 337 mode) |
| `respondent` | string | `""` | Respondent company filter (Section 337 mode) |
| `technology` | string | `""` | Technology area filter (Section 337 mode) |
| `limit` | integer | `20` | Max results (1–100) |
| `serveMcp` | boolean | `false` | Enable MCP server mode on port 4321 |

***

### Section 337 Playbook

#### When to Monitor Section 337

**You are a product importer:** Any new 337 case in your product category could result in your goods being seized at the border. You need 15 months of lead time to redesign, find alternative suppliers, or negotiate a license.

**You are a complainant's competitor:** If a 337 complaint excludes a competitor's imports, you may gain market share — or face the same complaint next.

**You are an M\&A analyst:** An acquisition target that manufactures in China and sells in the US faces existential risk from a 337 exclusion order. This is due diligence you cannot skip.

**You are an IP licensor:** Section 337 is a powerful licensing negotiation tool. The threat of an exclusion order often drives settlement faster than district court litigation.

#### Understanding Case Outcomes

| Outcome | What It Means |
|---------|---------------|
| Limited Exclusion Order (LEO) | Named respondents' goods blocked at border |
| General Exclusion Order (GEO) | All infringing goods blocked, from all sources |
| Cease and Desist Order | Domestic distributor ordered to stop selling |
| No Violation Found | Case dismissed; imports continue |
| Terminated — Settlement | Private license deal reached; investigation closed |
| Presidential Disapproval | Rare: President can override ITC order for policy reasons |

***

### Census Bureau Trade API Notes

The Census Bureau International Trade API uses a DEMO\_KEY by default which allows:

- 30 requests per IP address per hour
- 500 requests per IP address per day

For production use with high query volume, register for a free Census API key at https://api.census.gov/data/key\_signup.html and set it via the `CENSUS_API_KEY` environment variable.

**Country codes reference:**

| Census Code | Country |
|-------------|---------|
| `5700` | China |
| `2010` | Canada |
| `2030` | Mexico |
| `5880` | Japan |
| `5800` | South Korea |
| `4120` | Germany |
| `4590` | Taiwan |
| `5330` | India |
| `5550` | Vietnam |
| `4150` | United Kingdom |

***

### Technical Notes

- **Data sources:** Census Bureau ITIA API + USITC hardcoded dataset
- **Authentication:** Census DEMO\_KEY (public, rate-limited)
- **MCP port:** 4321 (GET `/mcp/tools`, POST `/mcp/call`)
- **Docker base:** `apify/actor-python:3.11`
- **Dependencies:** `apify>=2.0.0`, `httpx>=0.24.0`
- **Error handling:** All tool failures return `{"_meta": {"error": "...", "fallback_tried": true}}`
- **Section 337 dataset:** Hardcoded; covers ~20 notable 2019–2024 cases. For full docket visit USITC website.

***

### Related Actors

- **pacer-intelligence-mcp** — Federal court records including ITC district court litigation
- **edgar-fulltext-mcp** — SEC EDGAR full-text search for trade-related company disclosures
- **federal-register-mcp** — Federal regulatory activity including trade rule changes

***

### Compliance and Disclaimer

Trade data from the Census Bureau is official US government data in the public domain. Section 337 investigation records are public docket records from the USITC, a US government agency. This actor does not provide legal advice. Consult a qualified customs attorney for Section 337 compliance guidance. Import exclusion orders should be verified against current USITC records at https://www.usitc.gov/.

# Actor input Schema

## `mode` (type: `string`):

What to query: trade statistics, Section 337 IP investigations, or top import country rankings

## `hts_code` (type: `string`):

4-10 digit Harmonized Tariff Schedule code for trade data queries. Examples: '8703' (automobiles), '8471' (computers), '8517' (smartphones), '8541' (semiconductors), '2709' (petroleum), '0901' (coffee), '6110' (sweaters/knitwear). Required for modes: trade, countries.

## `tradeType` (type: `string`):

Whether to query US import data (goods entering the US) or export data (goods leaving the US)

## `year` (type: `integer`):

Year for trade statistics (e.g. 2023, 2022, 2021). Census Bureau data typically available with 1-2 year lag.

## `countryCode` (type: `string`):

Optional Census Bureau 4-character country code to filter trade data to a single country. Examples: '5700' (China), '2010' (Canada), '2030' (Mexico), '4120' (Germany), '5880' (Japan). Leave blank for all countries.

## `query` (type: `string`):

Keyword search for Section 337 investigations. Searches title, product, technology, complainant, and respondent. Examples: 'battery', 'semiconductor', 'Apple', 'OLED', 'solar', 'EV', 'AI chip'.

## `status` (type: `string`):

Filter Section 337 investigations by status: 'Active', 'Terminated', 'Settlement', 'Import Ban'

## `respondent` (type: `string`):

Filter Section 337 investigations by respondent (defendant) company name (e.g. 'Apple', 'NVIDIA', 'Samsung')

## `technology` (type: `string`):

Filter Section 337 investigations by technology area (e.g. 'semiconductor', 'battery', 'solar', 'AI', 'robotics')

## `limit` (type: `integer`):

Maximum number of records to return (max 100)

## `serveMcp` (type: `boolean`):

When enabled, starts an MCP-compatible HTTP server on port 4321 instead of returning a batch dataset. Use this to connect Claude Desktop or any MCP client directly to USITC trade intelligence.

## Actor input object example

```json
{
  "mode": "trade",
  "hts_code": "8471",
  "tradeType": "imports",
  "year": 2023,
  "countryCode": "",
  "query": "",
  "status": "",
  "respondent": "",
  "technology": "",
  "limit": 20,
  "serveMcp": 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("andrew_avina/usitc-intelligence-mcp").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("andrew_avina/usitc-intelligence-mcp").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 '{}' |
apify call andrew_avina/usitc-intelligence-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=andrew_avina/usitc-intelligence-mcp",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "USITC Trade Remedy Intelligence MCP — Section 337 & Trade",
        "description": "The USITC Trade Intelligence MCP is an Apify actor that exposes US international trade data via the Model Context Protocol. It gives AI assistants — Claude, GPT-4, and any MCP-compatible agent — structured access to two critical trade intelligence datasets:",
        "version": "0.1",
        "x-build-id": "ROcMFR2nLT7ohr5GQ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/andrew_avina~usitc-intelligence-mcp/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-andrew_avina-usitc-intelligence-mcp",
                "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/andrew_avina~usitc-intelligence-mcp/runs": {
            "post": {
                "operationId": "runs-sync-andrew_avina-usitc-intelligence-mcp",
                "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/andrew_avina~usitc-intelligence-mcp/run-sync": {
            "post": {
                "operationId": "run-sync-andrew_avina-usitc-intelligence-mcp",
                "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": {
                    "mode": {
                        "title": "Query Mode",
                        "enum": [
                            "trade",
                            "337",
                            "countries"
                        ],
                        "type": "string",
                        "description": "What to query: trade statistics, Section 337 IP investigations, or top import country rankings",
                        "default": "trade"
                    },
                    "hts_code": {
                        "title": "HTS Code",
                        "type": "string",
                        "description": "4-10 digit Harmonized Tariff Schedule code for trade data queries. Examples: '8703' (automobiles), '8471' (computers), '8517' (smartphones), '8541' (semiconductors), '2709' (petroleum), '0901' (coffee), '6110' (sweaters/knitwear). Required for modes: trade, countries.",
                        "default": "8471"
                    },
                    "tradeType": {
                        "title": "Trade Type",
                        "enum": [
                            "imports",
                            "exports"
                        ],
                        "type": "string",
                        "description": "Whether to query US import data (goods entering the US) or export data (goods leaving the US)",
                        "default": "imports"
                    },
                    "year": {
                        "title": "Data Year",
                        "minimum": 2010,
                        "maximum": 2024,
                        "type": "integer",
                        "description": "Year for trade statistics (e.g. 2023, 2022, 2021). Census Bureau data typically available with 1-2 year lag.",
                        "default": 2023
                    },
                    "countryCode": {
                        "title": "Country Code (Trade Data)",
                        "type": "string",
                        "description": "Optional Census Bureau 4-character country code to filter trade data to a single country. Examples: '5700' (China), '2010' (Canada), '2030' (Mexico), '4120' (Germany), '5880' (Japan). Leave blank for all countries.",
                        "default": ""
                    },
                    "query": {
                        "title": "Search Query (Section 337 Mode)",
                        "type": "string",
                        "description": "Keyword search for Section 337 investigations. Searches title, product, technology, complainant, and respondent. Examples: 'battery', 'semiconductor', 'Apple', 'OLED', 'solar', 'EV', 'AI chip'.",
                        "default": ""
                    },
                    "status": {
                        "title": "Investigation Status (Section 337 Mode)",
                        "type": "string",
                        "description": "Filter Section 337 investigations by status: 'Active', 'Terminated', 'Settlement', 'Import Ban'",
                        "default": ""
                    },
                    "respondent": {
                        "title": "Respondent Company (Section 337 Mode)",
                        "type": "string",
                        "description": "Filter Section 337 investigations by respondent (defendant) company name (e.g. 'Apple', 'NVIDIA', 'Samsung')",
                        "default": ""
                    },
                    "technology": {
                        "title": "Technology Area (Section 337 Mode)",
                        "type": "string",
                        "description": "Filter Section 337 investigations by technology area (e.g. 'semiconductor', 'battery', 'solar', 'AI', 'robotics')",
                        "default": ""
                    },
                    "limit": {
                        "title": "Result Limit",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of records to return (max 100)",
                        "default": 20
                    },
                    "serveMcp": {
                        "title": "MCP Server Mode",
                        "type": "boolean",
                        "description": "When enabled, starts an MCP-compatible HTTP server on port 4321 instead of returning a batch dataset. Use this to connect Claude Desktop or any MCP client directly to USITC trade intelligence.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
