{
  "openapi": "3.0.1",
  "info": {
    "title": "UN Comtrade Trade Data: Best Export Markets per HS Code",
    "description": "First 25 export markets free. UN Comtrade export market finder, pay per qualified market — raw rows never charged here: every country importing your HS code, ranked by demand, growth, your share vs rivals and price per kg. A Trade Map alternative with an API, MCP & AI agents. Free demo on any plan.",
    "version": "0.3",
    "x-build-id": "wlJefmyto8OdWOk2B"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rich_minds~export-market-finder-ai/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rich_minds-export-market-finder-ai",
        "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/rich_minds~export-market-finder-ai/runs": {
      "post": {
        "operationId": "runs-sync-rich_minds-export-market-finder-ai",
        "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/rich_minds~export-market-finder-ai/run-sync": {
      "post": {
        "operationId": "run-sync-rich_minds-export-market-finder-ai",
        "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": {
          "preset": {
            "title": "Start from a ready search (one click)",
            "enum": [
              "custom",
              "india-cotton-tshirts",
              "vietnam-green-coffee",
              "india-frozen-shrimp",
              "kenya-cut-roses",
              "turkiye-hazelnuts",
              "india-textiles-set"
            ],
            "type": "string",
            "description": "Replaces the sample search: pick a ready search and press Start — it fills the HS code(s) and country (the untouched sample counts as empty) and runs the live UN Comtrade search. A value you typed yourself always wins. <b>Custom</b> = fill the fields yourself.",
            "default": "custom"
          },
          "hsCodes": {
            "title": "HS code(s) of your product",
            "type": "array",
            "description": "The 6-digit HS code (or 4 / 2 digits), e.g. <code>610910</code> cotton T-shirts. Typed next to the sample, it starts the live search — built in, any Apify plan; a plan that cannot run Store Actors gets the same. ≈ 5 codes a run without a key (the run names the codes left), 10 with your free <code>comtradeKey</code>.",
            "items": {
              "type": "string"
            }
          },
          "products": {
            "title": "…or describe the product",
            "type": "array",
            "description": "Plain descriptions such as <code>frozen shrimp</code>, each matched to its 6-digit HS code (the AI, else the best text match; a low-confidence match is flagged <code>hs_guessed</code>). Any plan — a plan that cannot run Store Actors searches it the same way.",
            "items": {
              "type": "string"
            }
          },
          "exporterCountry": {
            "title": "Your country (the exporter)",
            "enum": [
              "AF",
              "AL",
              "DZ",
              "AD",
              "AO",
              "AI",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BQ",
              "BA",
              "BW",
              "VG",
              "BR",
              "BN",
              "BG",
              "BF",
              "BI",
              "CV",
              "KH",
              "CM",
              "CA",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "HK",
              "MO",
              "CO",
              "KM",
              "CG",
              "CK",
              "CR",
              "HR",
              "CU",
              "CW",
              "CY",
              "CZ",
              "CI",
              "KP",
              "CD",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "SZ",
              "ET",
              "FM",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GT",
              "GN",
              "GW",
              "GY",
              "HT",
              "VA",
              "HN",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IL",
              "IT",
              "JM",
              "JP",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LT",
              "LU",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "MP",
              "NA",
              "NR",
              "NP",
              "NL",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "MK",
              "NO",
              "OM",
              "PK",
              "PW",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PL",
              "PT",
              "QA",
              "KR",
              "MD",
              "RO",
              "RU",
              "RW",
              "RE",
              "BL",
              "SH",
              "KN",
              "LC",
              "SX",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "SS",
              "ES",
              "LK",
              "PS",
              "SD",
              "SR",
              "SE",
              "CH",
              "SY",
              "TJ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TM",
              "TC",
              "TV",
              "TR",
              "US",
              "UG",
              "UA",
              "AE",
              "GB",
              "TZ",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "WF",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string",
            "description": "The country you export from: every row shows its share, price per kg and rivals; its own market is left out.",
            "default": "IN"
          },
          "view": {
            "title": "View: ranked markets or supplier flows",
            "enum": [
              "markets",
              "flows"
            ],
            "type": "string",
            "description": "<b>Ranked markets</b> (default): one scored row per importing country. <b>Supplier flows</b>: one row per importer × supplier × period from each importer's official source — Eurostat, UK HMRC, US Census (your <code>censusApiKey</code>), UN Comtrade — with USD per tonne, share and rank. Same price per importer table.",
            "default": "markets"
          },
          "goalDescription": {
            "title": "Your brief for the AI (optional)",
            "type": "string",
            "description": "What makes a market right for you, e.g. \"mid-price cotton T-shirts; growing markets where we hold under 5 %\". The AI weighs every market against it; the rule score does not use it. No HS code or product typed? The goal's first sentence is searched as the product (its HS code in <code>OUTPUT.hsResolved</code>)."
          },
          "notifyEmail": {
            "title": "E-mail me the new export markets (optional)",
            "type": "string",
            "description": "The digest (top 10 new markets with numbers and links) is e-mailed here after every run with new markets — sent by Apify's send-mail Actor, so it needs a plan that runs Store Actors; any plan: a Slack / Teams URL in <b>Send alerts to</b>. Never sent for the free demo."
          },
          "minScore": {
            "title": "Minimum score (0–100)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "The field that decides what you pay: markets whose opportunity score is below this are discarded and <b>not charged</b>. 35 keeps the top half of a typical product's markets; raise it to pay only for the strongest. Affects what you pay.",
            "default": 35
          },
          "maxQualified": {
            "title": "Max export markets to output",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on results — and the ceiling of what <b>this Actor</b> charges: at most this many × $0.01 with AI on (× $0.0033 with AI off), e.g. 30 × $0.01 = $0.30. It also sizes the read: the 3 × this many biggest markets get the detailed supplier read (≈ 1 s per 3 markets). Affects what you pay. The best-scoring markets are output first.",
            "default": 30
          },
          "maxDiscoveryChargeUsd": {
            "title": "Max source spend (USD)",
            "minimum": 0.01,
            "maximum": 1000,
            "type": "number",
            "description": "Only for the Store-scraper fallback (Source Actor input filled, Comtrade refused): the most that Store Actor's run may charge your account — $0.50 in the form and for an API call that leaves it out. The built-in UN Comtrade reader has no source bill. Affects what you pay.",
            "default": 0.5
          },
          "enableAi": {
            "title": "AI assessment",
            "type": "boolean",
            "description": "An AI fit score per market with reasons, and an opportunity note of up to 3 sentences citing only the market's own numbers (its duty too); it also matches product descriptions to HS codes and writes the run summary. <b>On = $0.01 per export market + AI tokens (≈ $0.003); off = $0.0033</b> (rule score and a rule-based note). Every market gets the AI where your Apify plan includes model access (Apify's model access: not measured on the platform yet); otherwise your own Gemini / Groq key (a free Gemini key read 5 of 5 markets on 2026-11-21; large runs hit its rate limit), and the demo shows labelled sample verdicts. Affects what you pay.",
            "default": true
          },
          "markets": {
            "title": "Only these markets (optional)",
            "type": "array",
            "description": "Limit the ranking to these importing countries — e.g. the EU members you can ship to. Empty = every country that reports to UN Comtrade. Markets outside the list are never read in detail or charged.",
            "items": {
              "type": "string",
              "enum": [
                "AF",
                "AL",
                "DZ",
                "AD",
                "AO",
                "AI",
                "AG",
                "AR",
                "AM",
                "AW",
                "AU",
                "AT",
                "AZ",
                "BS",
                "BH",
                "BD",
                "BB",
                "BY",
                "BE",
                "BZ",
                "BJ",
                "BM",
                "BT",
                "BO",
                "BQ",
                "BA",
                "BW",
                "VG",
                "BR",
                "BN",
                "BG",
                "BF",
                "BI",
                "CV",
                "KH",
                "CM",
                "CA",
                "KY",
                "CF",
                "TD",
                "CL",
                "CN",
                "HK",
                "MO",
                "CO",
                "KM",
                "CG",
                "CK",
                "CR",
                "HR",
                "CU",
                "CW",
                "CY",
                "CZ",
                "CI",
                "KP",
                "CD",
                "DK",
                "DJ",
                "DM",
                "DO",
                "EC",
                "EG",
                "SV",
                "GQ",
                "ER",
                "EE",
                "SZ",
                "ET",
                "FM",
                "FO",
                "FJ",
                "FI",
                "FR",
                "GF",
                "PF",
                "GA",
                "GM",
                "GE",
                "DE",
                "GH",
                "GI",
                "GR",
                "GL",
                "GD",
                "GP",
                "GT",
                "GN",
                "GW",
                "GY",
                "HT",
                "VA",
                "HN",
                "HU",
                "IS",
                "IN",
                "ID",
                "IR",
                "IQ",
                "IE",
                "IL",
                "IT",
                "JM",
                "JP",
                "JO",
                "KZ",
                "KE",
                "KI",
                "KW",
                "KG",
                "LA",
                "LV",
                "LB",
                "LS",
                "LR",
                "LY",
                "LT",
                "LU",
                "MG",
                "MW",
                "MY",
                "MV",
                "ML",
                "MT",
                "MH",
                "MQ",
                "MR",
                "MU",
                "YT",
                "MX",
                "MN",
                "ME",
                "MS",
                "MA",
                "MZ",
                "MM",
                "MP",
                "NA",
                "NR",
                "NP",
                "NL",
                "NC",
                "NZ",
                "NI",
                "NE",
                "NG",
                "NU",
                "MK",
                "NO",
                "OM",
                "PK",
                "PW",
                "PA",
                "PG",
                "PY",
                "PE",
                "PH",
                "PL",
                "PT",
                "QA",
                "KR",
                "MD",
                "RO",
                "RU",
                "RW",
                "RE",
                "BL",
                "SH",
                "KN",
                "LC",
                "SX",
                "PM",
                "VC",
                "WS",
                "SM",
                "ST",
                "SA",
                "SN",
                "RS",
                "SC",
                "SL",
                "SG",
                "SK",
                "SI",
                "SB",
                "SO",
                "ZA",
                "SS",
                "ES",
                "LK",
                "PS",
                "SD",
                "SR",
                "SE",
                "CH",
                "SY",
                "TJ",
                "TH",
                "TL",
                "TG",
                "TK",
                "TO",
                "TT",
                "TN",
                "TM",
                "TC",
                "TV",
                "TR",
                "US",
                "UG",
                "UA",
                "AE",
                "GB",
                "TZ",
                "UY",
                "UZ",
                "VU",
                "VE",
                "VN",
                "WF",
                "YE",
                "ZM",
                "ZW",
                "EU27"
              ],
              "enumTitles": [
                "Afghanistan (AF)",
                "Albania (AL)",
                "Algeria (DZ)",
                "Andorra (AD)",
                "Angola (AO)",
                "Anguilla (AI)",
                "Antigua and Barbuda (AG)",
                "Argentina (AR)",
                "Armenia (AM)",
                "Aruba (AW)",
                "Australia (AU)",
                "Austria (AT)",
                "Azerbaijan (AZ)",
                "Bahamas (BS)",
                "Bahrain (BH)",
                "Bangladesh (BD)",
                "Barbados (BB)",
                "Belarus (BY)",
                "Belgium (BE)",
                "Belize (BZ)",
                "Benin (BJ)",
                "Bermuda (BM)",
                "Bhutan (BT)",
                "Bolivia (Plurinational State of) (BO)",
                "Bonaire (BQ)",
                "Bosnia Herzegovina (BA)",
                "Botswana (BW)",
                "Br. Virgin Isds (VG)",
                "Brazil (BR)",
                "Brunei Darussalam (BN)",
                "Bulgaria (BG)",
                "Burkina Faso (BF)",
                "Burundi (BI)",
                "Cabo Verde (CV)",
                "Cambodia (KH)",
                "Cameroon (CM)",
                "Canada (CA)",
                "Cayman Isds (KY)",
                "Central African Rep. (CF)",
                "Chad (TD)",
                "Chile (CL)",
                "China (CN)",
                "China, Hong Kong SAR (HK)",
                "China, Macao SAR (MO)",
                "Colombia (CO)",
                "Comoros (KM)",
                "Congo (CG)",
                "Cook Isds (CK)",
                "Costa Rica (CR)",
                "Croatia (HR)",
                "Cuba (CU)",
                "Curaçao (CW)",
                "Cyprus (CY)",
                "Czechia (CZ)",
                "Côte d'Ivoire (CI)",
                "Dem. People's Rep. of Korea (KP)",
                "Dem. Rep. of the Congo (CD)",
                "Denmark (DK)",
                "Djibouti (DJ)",
                "Dominica (DM)",
                "Dominican Rep. (DO)",
                "Ecuador (EC)",
                "Egypt (EG)",
                "El Salvador (SV)",
                "Equatorial Guinea (GQ)",
                "Eritrea (ER)",
                "Estonia (EE)",
                "Eswatini (SZ)",
                "Ethiopia (ET)",
                "FS Micronesia (FM)",
                "Faroe Isds (FO)",
                "Fiji (FJ)",
                "Finland (FI)",
                "France (FR)",
                "French Guiana (Overseas France) (GF)",
                "French Polynesia (PF)",
                "Gabon (GA)",
                "Gambia (GM)",
                "Georgia (GE)",
                "Germany (DE)",
                "Ghana (GH)",
                "Gibraltar (GI)",
                "Greece (GR)",
                "Greenland (GL)",
                "Grenada (GD)",
                "Guadeloupe (Overseas France) (GP)",
                "Guatemala (GT)",
                "Guinea (GN)",
                "Guinea-Bissau (GW)",
                "Guyana (GY)",
                "Haiti (HT)",
                "Holy See (Vatican City State) (VA)",
                "Honduras (HN)",
                "Hungary (HU)",
                "Iceland (IS)",
                "India (IN)",
                "Indonesia (ID)",
                "Iran (IR)",
                "Iraq (IQ)",
                "Ireland (IE)",
                "Israel (IL)",
                "Italy (IT)",
                "Jamaica (JM)",
                "Japan (JP)",
                "Jordan (JO)",
                "Kazakhstan (KZ)",
                "Kenya (KE)",
                "Kiribati (KI)",
                "Kuwait (KW)",
                "Kyrgyzstan (KG)",
                "Lao People's Dem. Rep. (LA)",
                "Latvia (LV)",
                "Lebanon (LB)",
                "Lesotho (LS)",
                "Liberia (LR)",
                "Libya (LY)",
                "Lithuania (LT)",
                "Luxembourg (LU)",
                "Madagascar (MG)",
                "Malawi (MW)",
                "Malaysia (MY)",
                "Maldives (MV)",
                "Mali (ML)",
                "Malta (MT)",
                "Marshall Isds (MH)",
                "Martinique (Overseas France) (MQ)",
                "Mauritania (MR)",
                "Mauritius (MU)",
                "Mayotte (Overseas France) (YT)",
                "Mexico (MX)",
                "Mongolia (MN)",
                "Montenegro (ME)",
                "Montserrat (MS)",
                "Morocco (MA)",
                "Mozambique (MZ)",
                "Myanmar (MM)",
                "N. Mariana Isds (MP)",
                "Namibia (NA)",
                "Naoero (NR)",
                "Nepal (NP)",
                "Netherlands (NL)",
                "New Caledonia (NC)",
                "New Zealand (NZ)",
                "Nicaragua (NI)",
                "Niger (NE)",
                "Nigeria (NG)",
                "Niue (NU)",
                "North Macedonia (MK)",
                "Norway (NO)",
                "Oman (OM)",
                "Pakistan (PK)",
                "Palau (PW)",
                "Panama (PA)",
                "Papua New Guinea (PG)",
                "Paraguay (PY)",
                "Peru (PE)",
                "Philippines (PH)",
                "Poland (PL)",
                "Portugal (PT)",
                "Qatar (QA)",
                "Rep. of Korea (KR)",
                "Rep. of Moldova (MD)",
                "Romania (RO)",
                "Russian Federation (RU)",
                "Rwanda (RW)",
                "Réunion (Overseas France) (RE)",
                "Saint Barthélemy (BL)",
                "Saint Helena (SH)",
                "Saint Kitts and Nevis (KN)",
                "Saint Lucia (LC)",
                "Saint Maarten (SX)",
                "Saint Pierre and Miquelon (PM)",
                "Saint Vincent and the Grenadines (VC)",
                "Samoa (WS)",
                "San Marino (SM)",
                "Sao Tome and Principe (ST)",
                "Saudi Arabia (SA)",
                "Senegal (SN)",
                "Serbia (RS)",
                "Seychelles (SC)",
                "Sierra Leone (SL)",
                "Singapore (SG)",
                "Slovakia (SK)",
                "Slovenia (SI)",
                "Solomon Isds (SB)",
                "Somalia (SO)",
                "South Africa (ZA)",
                "South Sudan (SS)",
                "Spain (ES)",
                "Sri Lanka (LK)",
                "State of Palestine (PS)",
                "Sudan (SD)",
                "Suriname (SR)",
                "Sweden (SE)",
                "Switzerland (CH)",
                "Syria (SY)",
                "Tajikistan (TJ)",
                "Thailand (TH)",
                "Timor-Leste (TL)",
                "Togo (TG)",
                "Tokelau (TK)",
                "Tonga (TO)",
                "Trinidad and Tobago (TT)",
                "Tunisia (TN)",
                "Turkmenistan (TM)",
                "Turks and Caicos Isds (TC)",
                "Tuvalu (TV)",
                "Türkiye (TR)",
                "USA (US)",
                "Uganda (UG)",
                "Ukraine (UA)",
                "United Arab Emirates (AE)",
                "United Kingdom (GB)",
                "United Rep. of Tanzania (TZ)",
                "Uruguay (UY)",
                "Uzbekistan (UZ)",
                "Vanuatu (VU)",
                "Venezuela (VE)",
                "Viet Nam (VN)",
                "Wallis and Futuna Isds (WF)",
                "Yemen (YE)",
                "Zambia (ZM)",
                "Zimbabwe (ZW)",
                "EU27 — the EU as one importer (flows view only)"
              ]
            }
          },
          "months": {
            "title": "Months to read (monthly data, API only)",
            "minimum": 1,
            "maximum": 24,
            "type": "integer",
            "description": "API only — hidden on the form. With <code>frequency: M</code>: how many months back from the newest published one each row's monthly series covers (one Comtrade call per month and HS code). Annual runs ignore it. With <code>view: flows</code> and <code>flowPeriods</code> at 1: the number of months per importer.",
            "default": 12
          },
          "flowFrequency": {
            "title": "Flows: monthly or annual (API only)",
            "type": "string",
            "description": "API only — hidden on the form. With <code>view: flows</code>: <code>M</code> (default) = the newest months where the source publishes monthly (Eurostat, UK HMRC, US Census, Comtrade where reported; an importer without monthly Comtrade data falls back to annual, the row says <code>frequency</code>); <code>A</code> = calendar years (set <code>years</code> for specific ones).",
            "default": "M"
          },
          "flowPeriods": {
            "title": "Flows: periods per importer (API only)",
            "minimum": 1,
            "maximum": 24,
            "type": "integer",
            "description": "API only — hidden on the form. With <code>view: flows</code>: the newest N months (or years) per importer; each is one supplier table (one charged event). One period before them is read for the change and never charged.",
            "default": 1
          },
          "topSuppliers": {
            "title": "Flows: suppliers per table (API only)",
            "minimum": 0,
            "maximum": 300,
            "type": "integer",
            "description": "API only — hidden on the form. With <code>view: flows</code>: keep the top N suppliers per importer and period (0 = all); your own country's row always stays. Free filter.",
            "default": 15
          },
          "minSharePct": {
            "title": "Flows: minimum supplier share % (API only)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "API only — hidden on the form. With <code>view: flows</code>: drop supplier rows below this share of the importer's total (your own row stays). Free filter.",
            "default": 0
          },
          "includeMirror": {
            "title": "Flows: mirror rows for non-reporters (API only)",
            "type": "boolean",
            "description": "API only — hidden on the form. With <code>view: flows</code>: an importer that reported nothing to UN Comtrade gets rows built from its partners' exports to it (<code>mirror: true</code>, FOB — a lower bound of the import value).",
            "default": true
          },
          "includeTariffs": {
            "title": "Add the duty each market charges you",
            "type": "boolean",
            "description": "On (default): each likely market gets its standard (MFN) duty and your preferential duty from the World Bank's WITS tariff data, your landed price per kg, and the duty in the price points and the flags <code>duty_advantage</code> / <code>duty_disadvantage</code>. Free, no key, not what you pay; adds ≈ 1 s per market to the run.",
            "default": true
          },
          "minImportValueUsd": {
            "title": "Minimum market size (USD a year)",
            "minimum": 0,
            "type": "integer",
            "description": "Markets that imported less than this in their latest year are skipped before any detailed read — never charged. 1,000,000 keeps the markets worth a sales trip; 0 keeps every reporter.",
            "default": 1000000
          },
          "frequency": {
            "title": "Annual or monthly data (API only)",
            "type": "string",
            "description": "API only — hidden on the form. <code>A</code> (default) = annual: yearly totals, every reporting country. <code>M</code> = monthly: the newest published month vs the same month a year earlier — fresher, but fewer countries report monthly.",
            "default": "A"
          },
          "rivalSuppliers": {
            "title": "Rival supplier countries per market",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "API only — hidden on the form. How many of each market's biggest supplier countries (other than yours) are listed with their value, share and price per kg.",
            "default": 5
          },
          "targetFlags": {
            "title": "Target flags (any of)",
            "type": "array",
            "description": "Only deliver markets that have at least one of these flags (e.g. <code>fast_growing</code>, <code>untapped</code>), and rank those with more of them higher. Leave empty to keep everything. An API call passes the flag names from the README's flag table (<code>fastGrowing</code> works too); an unknown name stops the run at once with the list of valid ones.",
            "items": {
              "type": "string",
              "enum": [
                "fast_growing",
                "shrinking",
                "untapped",
                "foothold",
                "you_lead",
                "price_competitive",
                "premium_market",
                "concentrated_supply",
                "mirror_data",
                "stale_period",
                "no_weight_data",
                "hs_guessed",
                "duty_advantage",
                "duty_disadvantage"
              ],
              "enumTitles": [
                "Imports grow 10 % a year or more (CAGR, else the last year)",
                "Imports fell on both the CAGR and the last year",
                "Your country sells nothing there yet",
                "You already sell there, under 5 % share — room to grow",
                "Your country is the market's biggest supplier already",
                "Your price per kg is at least 10 % below what the market pays on average",
                "The market pays at least 20 % more per kg than your price",
                "One supplier holds 50 % or more of the market",
                "Your figures come from your own country's export report (the importer did not report them)",
                "The market's newest published year is older than other markets'",
                "No weight reported, so no price per kg",
                "The HS code was matched from your product description with low confidence — check it",
                "You enter on a preferential duty below the market's standard (MFN) rate",
                "You pay 10 % duty or more there (no preference) — it eats your price edge"
              ]
            }
          },
          "suppressionList": {
            "title": "Exclude list",
            "type": "array",
            "description": "Markets to never output — country names, ISO codes (<code>CHN</code>) or dedupe keys. Skipped before any processing and never charged. With <b>Only these markets</b> and the API-only <code>excludeCountries</code>: the include lists are merged, an exclude always wins.",
            "items": {
              "type": "string"
            }
          },
          "llmProvider": {
            "title": "AI model access",
            "enum": [
              "apify",
              "byok"
            ],
            "type": "string",
            "description": "<b>Apify (no keys)</b> — the AI runs through Apify's OpenRouter proxy where your plan includes model access (Starter and up); tokens are billed to your Apify account. <b>My own key</b> — your OpenAI / Anthropic / Gemini / Groq key: with a free Gemini key expect 5 AI checks per run (5 of 5 markets, 2026-11-21); on large runs it hits its rate limit (2 calls at a time, then the 3 borderline markets retried one by one) and the rest keep their rule score; a paid key (billing on) assesses every export market. Measured 2026-10-23 and 2026-11-21: ≈ 1.1–4 s per export market (google:gemini-3.5-flash-lite, own Gemini key).",
            "default": "apify"
          },
          "llmModel": {
            "title": "AI model",
            "type": "string",
            "description": "Leave empty for the default: <code>anthropic/claude-haiku-4.5</code> through Apify, <code>google:gemini-3.5-flash-lite</code> with your own key (a free Gemini key works). Apify mode takes an OpenRouter slug such as <code>openai/gpt-4.1-mini</code>; own-key mode takes <code>provider:model</code>, e.g. <code>anthropic:claude-haiku-4-5-20251001</code>."
          },
          "llmApiKey": {
            "title": "Your API key (own-key mode only)",
            "type": "string",
            "description": "Required when <b>AI model access</b> is <i>My own API key</i>. Stored encrypted by Apify, never logged."
          },
          "aiCandidateMultiplier": {
            "title": "AI shortlist size, × max qualified (API only)",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "API only — hidden on the form. How many of the best rule-scored export markets get the AI pass, as a multiple of <b>Max qualified</b>. Higher = more thorough, slower, more tokens.",
            "default": 2
          },
          "sendAlertsTo": {
            "title": "Send alerts to (Slack, Discord, Teams, Google Chat, Telegram or webhook)",
            "type": "string",
            "description": "Paste one or more URLs, one per line — the service is detected from the address: a Slack or Discord channel webhook, a Teams Workflows or Google Chat space webhook, your Telegram bot's send link (<code>https://api.telegram.org/bot&lt;token&gt;/sendMessage?chat_id=@yourchannel</code>) or any other https URL (Zapier, Make, n8n, your CRM), which gets the export markets as JSON. After every run with at least one new export market, the digest (how many are new, the top 10 with links) is posted there. Never sent for the free demo. Headers, batching and signing: <i>Delivery details (advanced)</i>."
          },
          "dedupeAcrossRuns": {
            "title": "Never output the same export market twice",
            "type": "boolean",
            "description": "Remembers every export market you were charged for — keyed by HS code, your country, the market and its latest year — and skips it in future runs. A market comes back (and is charged once more) only when UN Comtrade publishes a newer year for it.",
            "default": true
          },
          "dedupeTtlDays": {
            "title": "Deliver an unchanged export market again after (days)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "API only — hidden on the form. 0 (default) = an export market whose latest year has not changed is never delivered or charged again. A number of days lets it reach you again after that many days — charged again.",
            "default": 0
          },
          "historyDatasetName": {
            "title": "Keep a running log (dataset name)",
            "type": "string",
            "description": "Optional. Type a name (e.g. <code>export-market-finder-ai-seen-log</code>) and every run appends its new export markets with the date to that named dataset on your account — one list across months to connect to Google Sheets or your BI tool once. Empty = off. Costs nothing extra.",
            "default": ""
          },
          "sourceMode": {
            "title": "Where do the export markets come from?",
            "enum": [
              "live",
              "actor",
              "dataset",
              "list"
            ],
            "type": "string",
            "description": "<code>{}</code> over the API runs the free demo — nothing charged. <b>live</b> (older name <code>actor</code>) — the built-in reader searches UN Comtrade for your HS codes, any plan, no source bill. <b>dataset</b> — a Comtrade scraper's dataset. <b>list</b> — raw Comtrade rows you paste in. The mode you choose always runs as chosen (over the API: the mode you send, except <code>{}</code> = the free demo); only in the Console do the untouched sample rows next to an HS code you typed switch to the live search. <code>OUTPUT.modeReason</code> says which rule picked the mode.",
            "default": "live"
          },
          "autoSwitchToLive": {
            "title": "Typed search next to the sample starts the live search",
            "type": "boolean",
            "description": "API only — hidden on the form. Console runs only: on (default), search terms typed next to the untouched sample records start the live search (<code>OUTPUT.switchedToLive</code> names them). An API call never switches — the mode you send is the mode that runs. Off: the Console keeps the sample as the free demo too.",
            "default": true
          },
          "failOnSourceError": {
            "title": "Fail the run when no export market could be loaded (API only)",
            "type": "boolean",
            "description": "API only — hidden on the form. Off (default): a plan that cannot run the source Store Actor ends SUCCEEDED with 0 rows and <code>OUTPUT.ok: false</code>. On: the same run ends FAILED with the same message, so a schedule's or an API pipeline's failed-run alert fires. Turn it on for every schedule.",
            "default": false
          },
          "comtradeKey": {
            "title": "Your UN Comtrade key (optional)",
            "type": "string",
            "description": "A free subscription key from comtradedeveloper.un.org (the 'comtrade - v1' product). With it the Actor reads the data API under your own quota: bigger calls, faster runs, and the records count against your subscription instead of the public preview. Recommended for every scheduled or repeat run: keyless reads stop at 95,000 records per account and share UN Comtrade's hourly quota per IP. A refused key falls back to the preview. Stored encrypted by Apify, never logged."
          },
          "censusApiKey": {
            "title": "Your US Census key (optional, flows view)",
            "type": "string",
            "description": "Free in a minute at api.census.gov/data/key_signup.html (name + e-mail, the key arrives by e-mail). With <code>view: flows</code> the US rows come from the Census Bureau's monthly import data under your key; without it the US comes from UN Comtrade and <code>OUTPUT.refused</code> says so. Stored encrypted by Apify, never logged or written to a row. This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau."
          },
          "datasetId": {
            "title": "Dataset",
            "type": "string",
            "description": "Only for <b>dataset</b> mode. Pick the dataset so the Actor is granted read access to it."
          },
          "itemsList": {
            "title": "Comtrade rows to analyse",
            "type": "array",
            "description": "Only for <b>list</b> mode. Raw UN Comtrade records as a JSON array — the Comtrade API's fields (<code>reporterCode</code>, <code>partnerCode</code>, <code>cmdCode</code>, <code>flowCode</code>, <code>period</code>, <code>primaryValue</code>, <code>netWgt</code>, <code>qty</code>) or another scraper's (<code>reporter_country</code>, <code>trade_value_usd</code> …). The sample: HS 610910 imports of 5 markets, 2022–2025, real Comtrade figures."
          },
          "discoveryActorId": {
            "title": "Source Actor (advanced)",
            "type": "string",
            "description": "API only — hidden on the form. The Store scraper the fallback runs (see Source Actor input) — the live search itself is the built-in UN Comtrade reader. Any Actor whose rows carry the fields listed in the README works.",
            "default": "thirdwatch/trade-data-scraper"
          },
          "discoveryInput": {
            "title": "Source Actor input",
            "type": "object",
            "description": "API only — hidden on the form. The Store-scraper fallback: leave empty (default) and a run that UN Comtrade refuses ends with the reason, nothing charged. Filled, that run starts the Store scraper (Source Actor) with this input on your Apify account instead (billed there, capped by Max source spend) — e.g. <code>{\"reporterCountry\": \"USA\", \"partnerCountry\": \"India\"}</code> for thirdwatch/trade-data-scraper — and its rows are ranked the same way. Needs a plan that runs Store Actors; a plan that cannot pastes rows into <code>itemsList</code> (<code>list</code> mode)."
          },
          "maxToProcess": {
            "title": "Max markets read in detail per HS code",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "API only — hidden on the form. How many of the biggest importing markets per run get the partner breakdown (your share, the rivals) — about 1 s of Comtrade reads per 3 markets. Default = 3 × max export markets (at least 30)."
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "Ranked export markets are POSTed here as JSON (Zapier, Make, n8n, your CRM). For Google Sheets / Slack you can also use Apify's built-in Integrations tab. Stored encrypted — Zapier / Make hook URLs carry their secret in the path."
          },
          "webhookHeaders": {
            "title": "Webhook headers (optional)",
            "type": "object",
            "description": "Extra HTTP headers for the webhook, e.g. <code>{\"Authorization\": \"Bearer …\"}</code>. Stored encrypted by Apify, never logged."
          },
          "webhookBatchSize": {
            "title": "Webhook batch size (API only)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "API only — hidden on the form. 1 = one POST per export market the moment it is ready. Higher = one POST per N export markets.",
            "default": 1
          },
          "webhookSecret": {
            "title": "Webhook signing secret (optional)",
            "type": "string",
            "description": "Any random string. Every webhook POST then carries <code>X-Signature: sha256=&lt;HMAC-SHA256 of the raw body with this secret&gt;</code>, so your endpoint can verify it came from this Actor. Stored encrypted by Apify, never logged."
          },
          "dedupeStoreName": {
            "title": "Dedupe store name (API only)",
            "type": "string",
            "description": "API only — hidden on the form. Key-value store used for cross-run memory. Left at the default, the memory is kept per search (source and search terms): rewording <code>goalDescription</code> keeps it, so a scheduled run never re-delivers what you already have, and another search starts its own list. Running it for several clients on one account, type one name per client.",
            "default": "export-market-finder-ai-seen"
          },
          "discoveryTimeoutSecs": {
            "title": "Source run timeout, seconds (API only)",
            "minimum": 60,
            "maximum": 86400,
            "type": "integer",
            "description": "API only — hidden on the form. How long the source Store Actor may run before its partial results are used — never more than 60 % of the run's time left, so the AI, the charges and the digest keep the rest. Raise it (and the run timeout) when the status says the source stopped early.",
            "default": 3600
          },
          "slackWebhookUrl": {
            "title": "Slack webhook URL (API only)",
            "type": "string",
            "description": "API only — hidden on the form, where <code>sendAlertsTo</code> takes it. Slack incoming-webhook URL for the digest."
          },
          "discordWebhookUrl": {
            "title": "Discord webhook URL (API only)",
            "type": "string",
            "description": "API only — hidden on the form, where <code>sendAlertsTo</code> takes it. Discord channel webhook URL for the digest."
          },
          "teamsWebhookUrl": {
            "title": "Microsoft Teams webhook URL (API only)",
            "type": "string",
            "description": "API only — hidden on the form, where <code>sendAlertsTo</code> takes it. Teams Workflows webhook URL for the digest."
          },
          "googleChatWebhookUrl": {
            "title": "Google Chat webhook URL (API only)",
            "type": "string",
            "description": "API only — hidden on the form, where <code>sendAlertsTo</code> takes it. Google Chat space webhook URL for the digest."
          },
          "telegramUrl": {
            "title": "Telegram sendMessage link (API only)",
            "type": "string",
            "description": "API only — hidden on the form, where <code>sendAlertsTo</code> takes it. The bot's sendMessage link with its chat_id."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}