{
  "openapi": "3.1.0",
  "info": {
    "title": "Dutyfinch API",
    "version": "1.0.0",
    "summary": "US tariff API and remote MCP server: HTS code lookup (description, general, special and column 2 rates, units), keyword search over the whole Harmonized Tariff Schedule, Section 301 China status for every code (lists 1, 2, 3, 4A, 4B, the 2024 four-year-review increases and product exclusions with end dates), the 2026 US–China tariff reduction flag, and webhook alerts when a watched code changes. Built from official USITC and Federal Register data.",
    "description": "Send an HTS code or product words and get the official US duty rates, whether Section 301 China tariffs apply (lists 1–4, the 2024 increases and exclusions), and the new US–China reduction flag the day its list is published. REST API and MCP server. 50 free calls a day; plans from $19/month.\n\nFree tier: Free tier: 50 calls a day per IP, 20 a minute, no key. Paid keys from $19/month (see Get an API key). Rates and Section 301 lists come from the current USITC HTS revision (shown as release in every answer) and are refreshed when USITC publishes a new revision. Section 301 lists are set at 8 digits; send an 8- or 10-digit code for an exact answer. Product exclusions are matched to the 10-digit lines they name; read the product text to see if yours qualifies. General information, not legal or customs advice. Section 232, IEEPA, antidumping/countervailing duties and fees are not included; confirm with CBP or a licensed customs broker. Watch alerts (Pro): up to 100 codes per key, one https webhook, checked daily and on every new HTS revision. No key needed. Remote MCP server: https://dutyfinch.cybermax-tools.workers.dev/mcp\n\nPricing: free tier 50 calls/day per IP, no key. Paid API keys: Importer $19/month = 2,500 calls/month; Broker $49/month = 7,500 calls/month; Team $149/month = 40,000 calls/month; Pay as you go $5 = 500 calls (one-time pack); Importer yearly $190/year = 2,500 calls/month; Broker yearly $490/year = 7,500 calls/month; Team yearly $1,490/year = 40,000 calls/month. Get a key: https://dutyfinch.cybermax-tools.workers.dev/docs#pricing",
    "contact": {
      "name": "CyberMax",
      "url": "https://cybermax-tools-cybermax.static.hf.space/"
    },
    "license": {
      "name": "Proprietary (free tier + paid API keys)",
      "identifier": "LicenseRef-CyberMax"
    },
    "x-pricing": {
      "api": "Dutyfinch API",
      "currency": "USD",
      "free": {
        "price": 0,
        "callsPerDayPerIp": 50,
        "perMinutePerIp": 20,
        "key": "none needed"
      },
      "plans": [
        {
          "id": "importer",
          "name": "Importer",
          "price": 19,
          "billing": "per month",
          "calls": 2500,
          "per": "calendar month (UTC)",
          "perMinute": 30,
          "buy": "https://dutyfinch.cybermax-tools.workers.dev/buy/importer?s=openapi"
        },
        {
          "id": "broker",
          "name": "Broker",
          "price": 49,
          "billing": "per month",
          "calls": 7500,
          "per": "calendar month (UTC)",
          "perMinute": 60,
          "includes": "+ watch alerts on 100 codes",
          "buy": "https://dutyfinch.cybermax-tools.workers.dev/buy/broker?s=openapi"
        },
        {
          "id": "team",
          "name": "Team",
          "price": 149,
          "billing": "per month",
          "calls": 40000,
          "per": "calendar month (UTC)",
          "perMinute": 120,
          "includes": "+ watch alerts on 100 codes",
          "buy": "https://dutyfinch.cybermax-tools.workers.dev/buy/team?s=openapi"
        },
        {
          "id": "payg",
          "name": "Pay as you go",
          "price": 5,
          "billing": "one-time",
          "calls": 500,
          "per": "until used",
          "perMinute": 30,
          "buy": "https://dutyfinch.cybermax-tools.workers.dev/buy/payg?s=openapi"
        },
        {
          "id": "importer-yearly",
          "name": "Importer yearly",
          "price": 190,
          "billing": "per year",
          "calls": 2500,
          "per": "calendar month (UTC)",
          "perMinute": 30,
          "buy": "https://dutyfinch.cybermax-tools.workers.dev/buy/importer-yearly?s=openapi"
        },
        {
          "id": "broker-yearly",
          "name": "Broker yearly",
          "price": 490,
          "billing": "per year",
          "calls": 7500,
          "per": "calendar month (UTC)",
          "perMinute": 60,
          "includes": "+ watch alerts on 100 codes",
          "buy": "https://dutyfinch.cybermax-tools.workers.dev/buy/broker-yearly?s=openapi"
        },
        {
          "id": "team-yearly",
          "name": "Team yearly",
          "price": 1490,
          "billing": "per year",
          "calls": 40000,
          "per": "calendar month (UTC)",
          "perMinute": 120,
          "includes": "+ watch alerts on 100 codes",
          "buy": "https://dutyfinch.cybermax-tools.workers.dev/buy/team-yearly?s=openapi"
        }
      ],
      "unit": "calls",
      "howToUse": {
        "header": "x-api-key: YOUR_KEY",
        "alt": [
          "Authorization: Bearer YOUR_KEY",
          "?key=YOUR_KEY"
        ],
        "mcp": "send the key as Authorization: Bearer YOUR_KEY",
        "usage": "https://dutyfinch.cybermax-tools.workers.dev/key"
      },
      "manageKey": "https://dutyfinch.cybermax-tools.workers.dev/manage",
      "allAccess": {
        "name": "CyberMax API All-Access",
        "apis": 9,
        "url": "https://api-all-access.cybermax-tools.workers.dev/?s=openapi-dutyfinch",
        "plans": [
          {
            "id": "all-access",
            "price": 119,
            "billing": "per month",
            "callsHere": 2500,
            "per": "calendar month (UTC)"
          },
          {
            "id": "all-access-pack",
            "price": 32,
            "billing": "one-time",
            "callsHere": 500,
            "per": "until used"
          }
        ],
        "note": "One key for every CyberMax API; Dutyfinch counts it separately."
      },
      "payments": "Stripe Checkout: card, Apple Pay, Google Pay, Link; sales tax/VAT handled by Stripe. Cancel any time at https://dutyfinch.cybermax-tools.workers.dev/manage."
    }
  },
  "servers": [
    {
      "url": "https://dutyfinch.cybermax-tools.workers.dev"
    }
  ],
  "paths": {
    "/api/hts": {
      "get": {
        "tags": [
          "Dutyfinch"
        ],
        "summary": "Look up one HTS code (also GET /hts/{code})",
        "description": "Description and full description path, general / special / column 2 duty rates (10-digit lines inherit from their 8-digit parent), units, footnotes, Section 301 China status (list, additional rate, status in_effect / upcoming / suspended / expired, exclusions with end dates), the 2026 US–China reduction flag, child lines and the HTS release the answer comes from.",
        "operationId": "lookupHtsCodeGet",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "description": "HTS code: 4, 6, 8 or 10 digits, dots optional (e.g. 8516.60.40, 9503000013)",
            "schema": {
              "type": "string"
            },
            "example": "8516.60.40"
          }
        ],
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (50/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Dutyfinch"
        ],
        "summary": "Look up one HTS code (also GET /hts/{code})",
        "description": "Description and full description path, general / special / column 2 duty rates (10-digit lines inherit from their 8-digit parent), units, footnotes, Section 301 China status (list, additional rate, status in_effect / upcoming / suspended / expired, exclusions with end dates), the 2026 US–China reduction flag, child lines and the HTS release the answer comes from.",
        "operationId": "lookupHtsCodePost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "code"
                ]
              },
              "example": {
                "code": "8516.60.40"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (50/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/search": {
      "get": {
        "tags": [
          "Dutyfinch"
        ],
        "summary": "Search the HTS by product words or a code prefix",
        "description": "Keyword search over every HTS line (its own text and the headings above it). Each result has the code, description, general rate, a one-line Section 301 summary and the reduction-list flag. Send a number to list the lines under that code prefix.",
        "operationId": "searchHtsGet",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Product words (e.g. \"stainless steel kettle\") or a code prefix (e.g. 8516.71)",
            "schema": {
              "type": "string"
            },
            "example": "coffee maker"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results, 1–25 (default 10)",
            "schema": {
              "type": "integer",
              "default": 10,
              "minimum": 1,
              "maximum": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "code": "8516.60.40",
                  "level": "tariff line (8-digit)",
                  "description": "Cooking stoves, ranges and ovens",
                  "fullDescription": "Electric instantaneous or storage water heaters and immersion heaters; electric space heating apparatus and soil heating apparatus; electrothermic hairdressing apparatus (for example, hair dryers, hair curlers, curling tong heaters) and hand dryers; electric flatirons; other electrothermic appliances of a kind used for domestic purposes; electric heating resistors, other than those of heading 8545; parts thereof: › Other ovens; cooking stoves, ranges, cooking plates, boiling rings, grillers and roasters: › Cooking stoves, ranges and ovens",
                  "rates": {
                    "general": "Free",
                    "special": null,
                    "column2": "35%"
                  },
                  "units": [],
                  "footnotes": [],
                  "section301": {
                    "appliesTo": "products of China",
                    "onList": true,
                    "summary": "List 3 +25%",
                    "actions": [
                      {
                        "heading": "9903.88.03",
                        "list": "List 3",
                        "additionalRate": "The duty provided in the applicable subheading + 25%",
                        "additionalPercent": 25,
                        "status": "in_effect",
                        "effectiveFrom": null,
                        "effectiveUntil": null,
                        "matchedOn": "8516.60.40"
                      }
                    ],
                    "exclusions": [],
                    "describedProducts": []
                  },
                  "chinaDeal2026": {
                    "status": "pending",
                    "announced": "2026-09-26",
                    "source": {
                      "name": "Federal Register: USTR documents mentioning China (checked daily)",
                      "url": "https://www.federalregister.gov/documents/search?conditions%5Bagencies%5D%5B%5D=trade-representative-office-of-united-states&conditions%5Bterm%5D=China"
                    },
                    "lastChecked": null,
                    "onReductionList": null,
                    "message": "The US–China reduction lists are not published yet. Dutyfinch checks the Federal Register every day and flags each code as soon as the list appears."
                  },
                  "children": [
                    {
                      "code": "8516.60.40.60",
                      "description": "Microwave oven combinations"
                    },
                    {
                      "code": "8516.60.40.70",
                      "description": "Portable"
                    },
                    {
                      "code": "8516.60.40.74",
                      "description": "Of a maximum width not exceeding 70 centimeters"
                    }
                  ],
                  "release": "2026HTSRev19",
                  "dataBuilt": "2026-09-27T15:05:29Z",
                  "source": "https://hts.usitc.gov/search?query=85166040"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (50/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Dutyfinch"
        ],
        "summary": "Search the HTS by product words or a code prefix",
        "description": "Keyword search over every HTS line (its own text and the headings above it). Each result has the code, description, general rate, a one-line Section 301 summary and the reduction-list flag. Send a number to list the lines under that code prefix.",
        "operationId": "searchHtsPost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "q": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 25
                  }
                },
                "required": [
                  "q"
                ]
              },
              "example": {
                "q": "wooden furniture",
                "limit": 5
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "code": "8516.60.40",
                  "level": "tariff line (8-digit)",
                  "description": "Cooking stoves, ranges and ovens",
                  "fullDescription": "Electric instantaneous or storage water heaters and immersion heaters; electric space heating apparatus and soil heating apparatus; electrothermic hairdressing apparatus (for example, hair dryers, hair curlers, curling tong heaters) and hand dryers; electric flatirons; other electrothermic appliances of a kind used for domestic purposes; electric heating resistors, other than those of heading 8545; parts thereof: › Other ovens; cooking stoves, ranges, cooking plates, boiling rings, grillers and roasters: › Cooking stoves, ranges and ovens",
                  "rates": {
                    "general": "Free",
                    "special": null,
                    "column2": "35%"
                  },
                  "units": [],
                  "footnotes": [],
                  "section301": {
                    "appliesTo": "products of China",
                    "onList": true,
                    "summary": "List 3 +25%",
                    "actions": [
                      {
                        "heading": "9903.88.03",
                        "list": "List 3",
                        "additionalRate": "The duty provided in the applicable subheading + 25%",
                        "additionalPercent": 25,
                        "status": "in_effect",
                        "effectiveFrom": null,
                        "effectiveUntil": null,
                        "matchedOn": "8516.60.40"
                      }
                    ],
                    "exclusions": [],
                    "describedProducts": []
                  },
                  "chinaDeal2026": {
                    "status": "pending",
                    "announced": "2026-09-26",
                    "source": {
                      "name": "Federal Register: USTR documents mentioning China (checked daily)",
                      "url": "https://www.federalregister.gov/documents/search?conditions%5Bagencies%5D%5B%5D=trade-representative-office-of-united-states&conditions%5Bterm%5D=China"
                    },
                    "lastChecked": null,
                    "onReductionList": null,
                    "message": "The US–China reduction lists are not published yet. Dutyfinch checks the Federal Register every day and flags each code as soon as the list appears."
                  },
                  "children": [
                    {
                      "code": "8516.60.40.60",
                      "description": "Microwave oven combinations"
                    },
                    {
                      "code": "8516.60.40.70",
                      "description": "Portable"
                    },
                    {
                      "code": "8516.60.40.74",
                      "description": "Of a maximum width not exceeding 70 centimeters"
                    }
                  ],
                  "release": "2026HTSRev19",
                  "dataBuilt": "2026-09-27T15:05:29Z",
                  "source": "https://hts.usitc.gov/search?query=85166040"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (50/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/section301": {
      "get": {
        "tags": [
          "Dutyfinch"
        ],
        "summary": "Section 301 China lists: headings, rates, dates, counts",
        "description": "Every Section 301 heading in Chapter 99 (lists 1, 2, 3, 4A, 4B, the 2024 four-year-review increases and the exclusion headings) with the official rate text, effective dates and how many codes each covers.",
        "operationId": "section301ListsGet",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (50/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Dutyfinch"
        ],
        "summary": "Section 301 China lists: headings, rates, dates, counts",
        "description": "Every Section 301 heading in Chapter 99 (lists 1, 2, 3, 4A, 4B, the 2024 four-year-review increases and the exclusion headings) with the official rate text, effective dates and how many codes each covers.",
        "operationId": "section301ListsPost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (50/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/china-deal": {
      "get": {
        "tags": [
          "Dutyfinch"
        ],
        "summary": "2026 US–China tariff reduction list: status and per-code flag",
        "description": "Status of the $30B-each-way US–China reduction recommended on 26 Sep 2026: pending until USTR publishes the product list, notice_published when a Federal Register notice appears (checked daily), published once per-code flags are loaded. Add code to check one product.",
        "operationId": "chinaDealStatusGet",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "description": "Optional HTS code to check",
            "schema": {
              "type": "string"
            },
            "example": "9503.00.00"
          }
        ],
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (50/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Dutyfinch"
        ],
        "summary": "2026 US–China tariff reduction list: status and per-code flag",
        "description": "Status of the $30B-each-way US–China reduction recommended on 26 Sep 2026: pending until USTR publishes the product list, notice_published when a Federal Register notice appears (checked daily), published once per-code flags are loaded. Add code to check one product.",
        "operationId": "chinaDealStatusPost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "code": "9503.00.00"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (50/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/watch": {
      "get": {
        "tags": [
          "Dutyfinch"
        ],
        "summary": "Pro: watch codes and get a webhook when a rate or China status changes",
        "description": "Pro plan. GET lists your watched codes, baselines and recent alerts. POST {\"codes\": [\"8516.60.40\", ...], \"webhook\": \"https://your.app/hook\"} adds codes (up to 100); {\"replace\": true} replaces the list; {\"test\": true} sends a test webhook; {\"remove\": [\"8516.60.40\"]} removes codes and {\"remove\": \"all\"} removes the watch. Alerts are POSTed as JSON: event tariff_change, code, changes [{field, before, after}], release, detectedAt.",
        "operationId": "watchCodesGet",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (50/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Dutyfinch"
        ],
        "summary": "Pro: watch codes and get a webhook when a rate or China status changes",
        "description": "Pro plan. GET lists your watched codes, baselines and recent alerts. POST {\"codes\": [\"8516.60.40\", ...], \"webhook\": \"https://your.app/hook\"} adds codes (up to 100); {\"replace\": true} replaces the list; {\"test\": true} sends a test webhook; {\"remove\": [\"8516.60.40\"]} removes codes and {\"remove\": \"all\"} removes the watch. Alerts are POSTed as JSON: event tariff_change, code, changes [{field, before, after}], release, detectedAt.",
        "operationId": "watchCodesPost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "codes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 100
                  },
                  "webhook": {
                    "type": "string",
                    "format": "uri"
                  },
                  "replace": {
                    "type": "boolean"
                  },
                  "test": {
                    "type": "boolean"
                  },
                  "remove": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "string",
                        "enum": [
                          "all"
                        ]
                      }
                    ]
                  }
                }
              },
              "example": {
                "codes": [
                  "8516.60.40",
                  "9503.00.00"
                ],
                "webhook": "https://example.com/tariff-hook"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (50/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "retryAfterSeconds": {
            "type": "integer"
          },
          "limits": {
            "type": "object"
          }
        },
        "required": [
          "error",
          "message"
        ]
      }
    },
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Optional. Paid plan key from https://dutyfinch.cybermax-tools.workers.dev/docs#pricing; leave out for the free tier."
      },
      "BearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Same key as a Bearer token."
      }
    }
  },
  "x-mcp-server": "https://dutyfinch.cybermax-tools.workers.dev/mcp",
  "externalDocs": {
    "description": "Get an API key (pricing)",
    "url": "https://dutyfinch.cybermax-tools.workers.dev/docs#pricing"
  },
  "security": [
    {},
    {
      "ApiKeyHeader": []
    },
    {
      "BearerKey": []
    }
  ]
}