# Top Importers List Finder: Importer Names by Product, Country — API reference

The detail an integrator needs and a buyer does not, linked from the README's Integrations section.

## Tested combinations

Every row is an input the test suite and the review runs start. An input outside this table is accepted by the schema
but not tested.

| Call | What runs | Input |
|---|---|---|
| Daily test / first agent call | the free demo on the sample records, nothing charged | `{}` |
| Demo, as the form opens | the same free demo | `storage-example/INPUT.json` |
| Live search, capped | the built-in reader (Google results + articles), AI off, 5 importers | `storage-example/INPUT.live.json` |
| AI on | the same records with the AI verdict | `storage-example/INPUT.ai.json` |
| AI with your own key | the AI through your provider key | `{"enableAi": true, "llmProvider": "byok", "llmModel": "google:gemini-3.5-flash-lite", "llmApiKey": "…"}` + your records |
| Market scan | one product × 12 countries, compared in the REPORT | `{"preset": "agency-market-scan"}` |
| Your own list | your rows, no search | `{"sourceMode": "list", "itemsList": [ … ]}` (fields: README → List-mode rows) |
| A dataset you have | a dataset's items, no search | `{"sourceMode": "dataset", "datasetId": "<id>"}` |

## Which call runs what

| Input shape | `OUTPUT.mode` | Can it charge? |
|---|---|---|
| `{}` or the untouched form (the sample records) | `demo` | no — sample rows are `chargedEvent: demo` |
| the sample + a product / country / search / link typed on the Console form | `live` | yes — per qualified importer |
| the same over the API (or with `autoSwitchToLive: false`) | `demo` | no — the mode you send runs |
| `sourceMode: "live"` + `products` / `queries` / `urls` | `live` | yes — per qualified importer |
| `sourceMode: "list"` + your own `itemsList` rows | `list` | yes — per qualified importer |
| `sourceMode: "dataset"` + `datasetId` | `dataset` | yes — per qualified importer |

## How the live search works

1. Per product × country: `top <product> importers in <country>`, `<product> importers <country> list` and the
   importing country's own-language search (`Kurkuma Importeure Deutschland`, `مستوردي أرز بسمتي في الإمارات`, with
   Google's `hl` / `gl` set to that country). English-speaking countries get the English searches only.
2. Results on marketplaces, B2B platforms and paid data vendors (Alibaba, IndiaMART, LinkedIn, Volza, ImportYeti …) are
   skipped before fetching — counted in `OUTPUT.serp.skippedDirectory`, never in `refused`.
3. A pair that read fewer than 5 articles gets five more searches (`list of …`, `… buyers`, `… distributors`,
   `… wholesalers`, `top … importers in <country> <year>`) — `OUTPUT.topUp` = `{pairs, queries, newArticles}`; a pair
   still short reads page 2 of its English searches — `OUTPUT.pageTwo`, both in `OUTPUT.searchRounds`.
   `OUTPUT.namedInTwoOrMore` counts the names two or more articles share; when it is 0 the status says "ranked by
   score — no name in ≥ 2 articles yet" (measured 2026-11-23: 0 of 30 names in ≥ 2 articles on a 3-article search).
4. Every article: robots.txt honoured, ≥ 1 s between requests to one site, a 403 / 429 retried once through Apify Proxy.

## Flags (`targetFlags` values)

| Flag | Meaning |
|---|---|
| `multi_source` | named in two or more different articles (sources agree) |
| `single_source` | named in one article only |
| `no_website_found` | no website whose domain matches the name was found |
| `country_mismatch` | its legal form belongs to another country (a Ltd in a Germany list) |
| `old_article` | the best article naming it is dated more than 3 years ago |
| `undated_article` | the best article naming it carries no date |

## Every field of a row

| Field | Description |
|---|---|
| `itemId`, `name`, `url` | Identity; `url` (canonical) = the website when found, else the article with `#:~:text=<name>` |
| `country`, `companyKey` | ISO-2 country; the normalised name to merge with other sources (customs data, association lists) |
| `website`, `domain`, `websiteBasis` | The company's site and how it was found: `article_link`, `search`, `provided` |
| `articleUrl`, `articleTitle`, `articleDate`, `position`, `contextText` | The best-ranking article, its own publication date (not our read time), the rank and the list line |
| `mentions`, `articleUrls`, `positions` | How many articles name it, which, and the rank in each |
| `query` | The search that found it |
| `contactRoute` | Where to reach it: the e-mail `enrichContacts` found, else the website, else the article |
| `contactEmail`, `contactEmailRole` | The address to write to and its role, from Company Contact Finder (`enrichContacts`); `null` when off |
| `sanctionsVerdict`, `sanctionsHit` | clear / review / block from OFAC Sanctions Screening (`screenBuyers`); `null` when off |
| `buyerRole`, `fitNote`, `generatedText`, `generatedTextBy`, `recommendedNextStep`, `summary` | The AI's role, note, outreach line, next step and one-line summary (rule note, line and step when AI is off) |
| `flags`, `targetFlagsMatched` | Rule findings and which of your target flags matched |
| `score`, `ruleScore`, `fitScore`, `label`, `assessedBy`, `scoreReasons` | Sort one run by `score`; trend across runs on `ruleScore`; `assessedBy` says which scale `score` is on |
| `aiModel`, `chargedEvent`, `billedAs`, `dedupeKey` | Model, billing, upsert key |
| `fetchedAt` | When this run read the article |
| `sourceUrl`, `rowId`, `scrapedAt` | Deprecated alias of `articleUrl`, `dedupeKey` (without its prefix), `fetchedAt` — removed on 2027-02-28 |
| `source`, `sourceRun` | The article's site; provenance `{mode: live \| list \| dataset \| actor, reader, query}` |

## One dataset item

A row of the AI demo on 2026-11-23 (records cut from the tradologie and IndexBox articles; the sample verdict is cut from a real google:gemini-3.5-flash-lite run):

```json
{"itemId": "38a4071abfef", "name": "Hela Gewürzwerk Hermann Laue GmbH", "url": "https://www.hela.eu", "country": "DE",
 "website": "https://www.hela.eu", "domain": "hela.eu", "websiteBasis": "article_link",
 "articleUrl": "https://www.tradologie.com/spice-importers/spices-importers-in-germany/",
 "articleTitle": "Top 10 Spice Importers & Processors in Germany", "articleDate": null, "position": 3,
 "contextText": "Hela Gewürzwerk Hermann Laue GmbH | Ahrensburg | Spice blends, sauces and marinades for butchers and the food industry",
 "mentions": 2, "query": "top spices importers in Germany", "companyKey": "hela-gewurzwerk-hermann-laue",
 "sourceUrl": "https://www.tradologie.com/spice-importers/spices-importers-in-germany/",
 "articleUrls": ["https://www.tradologie.com/spice-importers/spices-importers-in-germany/", "https://www.indexbox.io/blog/germany-clove-imports-2024/"],
 "positions": [3, 9], "contactRoute": "https://www.hela.eu", "buyerRole": "processor",
 "fitNote": "Processor in Germany featured in 2 sources, processing spice blends for the food industry.",
 "flags": ["multi_source", "undated_article"], "targetFlagsMatched": [], "ruleScore": 80, "score": 85, "label": "hot",
 "fitScore": 85, "scoreReasons": ["mentions: named in 2 articles as a top spice processor in Germany"],
 "summary": "Hela Gewürzwerk Hermann Laue GmbH is a spice processor located in Ahrensburg, Germany, specializing in spice blends, sauces, and marinades for the food industry.",
 "generatedText": "As a spice processor in Ahrensburg creating blends for the food industry, do you currently source Indian turmeric, cumin, or black pepper by the container?",
 "generatedTextBy": "sample", "recommendedNextStep": "Open https://www.hela.eu to find the purchasing contact for spice raw materials.",
 "aiModel": "sample", "assessedBy": "sample", "chargedEvent": "demo", "billedAs": "qualified-importer-ai",
 "dedupeKey": "co:de:hela-gewurzwerk-hermann-laue", "rowId": "de:hela-gewurzwerk-hermann-laue",
 "fetchedAt": "2026-11-23T10:57:23+00:00", "source": "tradologie.com",
 "sourceRun": {"mode": "list", "query": "top spices importers in Germany"}, "scrapedAt": "2026-11-23T10:57:23+00:00"}
```

## `OUTPUT` record keys

- `ok` — bool: `false` only when the search was refused / failed and nothing loaded
- `outcome` — str, one of `ok` · `empty` · `source_refused` · `source_failed` · `error`
- `mode` — str: `demo` · `live` · `list` · `dataset`
- `qualified`, `rows` — int; `costUsd` — float, what this run charged
- `stats` — object: the funnel, `discovered`, `skipped_<reason>` counts, `ai_assessed`, `capped_by_max_qualified`
- `queries` — array | null (live runs): one per search — `query`, `country`, `product`, `language` (own-language
  search), `round` (2 = a variant search), `resultsRead`, `skippedDirectory`, `articlesRead`, `namesExtracted`,
  `refused` (`{reason: n}`), `dropped` (`{reason: n}`), `kept`
- `refused` — array | null: `{url, reason, detail, query}`; `reason` is one of `robots`, `sign_in`, `pdf`, `not_supported` (a content type not read yet),
  `no_list` (expected, every run) and `failed` (HTTP error / timeout — alert on this one)
- `serp` — object | null: `proxy` (bool), `note`, `storeFallback`, `skippedDirectory`, `jsPageAnswers`,
  `fromBreadcrumbs`, `gotoResolved`, `unresolved`, `failures[]`, `emptyPages[]` — what each Google page gave
- `topUp` — object | null: `{pairs, queries, newArticles}` — the variant searches of pairs with < 5 articles
- `searchRounds` — object | null: `topUp` and `pageTwo` (`{pairs, queries, newArticles}`, page 2 of the English
  searches of pairs still short of 5 articles)
- `namedInTwoOrMore` — int | null: names two or more articles share (0 → the status says "ranked by score")
- `addOns` — object | null: `contacts` `{actor, asked, found, error}`, `screening` `{actor, asked, screened, hits,
  error}` — the opt-in sibling runs
- `articlesRead`, `companiesFound` — int | null; `dropped` — object: `{reason: n}`; `websiteCheck` — object:
  `fromArticle`, `searched`, `foundBySearch`, `cap`, `skippedNoSerp`, `skippedCap`
- `byCountry` — array | null (≥ 2 countries): `{country, importers, multiSource, multiSourceShare, articlesRead, top[]}`
- `freeTierQuote` — str | null: set once your free importers are used — the next run's price, both tiers
- `clientName` — str | null: the client the REPORT and digest were prepared for
- `skips` — object | null: `{"<reason>": ["<name>", …]}` — the names each rule dropped
- `chargedEvents` — object: `{"<event>": <count>}`; `chargeSplit` — object: `demo`, `free`, `basic`, `ai`, `freeKeptForAi`
- `sourceStatus` — object | null: `status`, `partial`, `timeCapped`, `itemsRead`
- `sourceError` — str | null · `sourceRefused` — `"plan"` | null · `sampleFallback` — bool | null
- `aiCoverage` — object | null: `aiAssessed`, `ruleScored`, `fallbackReasons`, `sampleVerdicts`, `secondPass`,
  `overloadRetries` (busy "overloaded" answers retried); `aiError` — str | null
- `aiTokens` — object | null: `inputPerUnit`, `outputPerUnit`, `model`
- `webhook` — object | null: `sent`, `failed`, `failedKeys`, `redelivered`, `pendingNextRun`, `signed`
- `dedupeStore` — object | null: `name`, `scope`, `remembered`, `newMemory`, `otherSearchesRemembered`
- `trend` — object | null (second run on): `qualified: {from, to}`, `hot: {from, to}`
- `history` — array | null: one `{at, qualified, hot}` per run of this search, oldest first
- `digestEmailed` — bool | null; `scheduleTaskUrl` — str | null; `reportUrl` — str | null
- `timing` — object: `sourceSecs`, `aiSecs`, `aiSecsPerUnit`, `aiBackoffSecs`, `totalSecs`
- `nextSteps` — array | null: the status steps that did not fit the 200-character status

## Measured time and `timeoutSecs` per mode

| Mode | Measured time | `timeoutSecs` |
|---|---|---|
| Free demo (sample importers) | 4.4 s on Apify (2026-11-23) | 120 |
| Your own records (`list` / `dataset`), rules only | ≈ 2 s per 100 | 300 |
| Live search, rules only | 57.5 s on Apify for 1 pair (2026-11-23); up to 2 more search rounds per pair now — size ≈ 3 min per pair | 900 |
| AI via Apify's model access | not measured on the platform yet — size like a free own key | 3600 |
| AI with a free own key | measured ≈ 4.9–24.9 s per importer, google:gemini-3.5-flash-lite (4 runs, 2026-11-23; 3–5 of 5 assessed) | 3600 |
| AI with a paid own key | ≈ 0.8 s per importer, google:gemini-3.5-flash-lite (2026-11-22) | 600 |

Own key: 2 calls at a time, one at a time after a rate limit; the AI stops after 2 minutes of rate-limit waiting and the
rest keep their rule score; a busy ("overloaded") answer is retried twice (2 s, 6 s) first. 50 importers at the
slowest measured pace ≈ 1425 s (measured ≈ 4.9–24.9 s per importer with a free key, ≈ 0.8 s with a paid one).
Add-ons (`enrichContacts`, `screenBuyers`) add one sub-run each, ≤ 10 minutes, capped by the run's time left.

## Every other input

`preset`, `resultsPerQuery`, `checkWebsites`, `targetFlags`, `suppressionList`, `llmProvider`, `llmApiKey`,
`sendAlertsTo`, `notifyEmail`, `dedupeAcrossRuns`, `dedupeTtlDays`, `datasetId`, `itemsList`; API-only `allowList`
(never drops a name from `OUTPUT.skips`), `webhookUrl`, `webhookHeaders`, `webhookSecret`, `webhookBatchSize`,
`failOnSourceError`, `autoSwitchToLive`, `useStoreFallback`, `llmModel`, `maxToProcess`, `historyDatasetName`,
`aiCandidateMultiplier`, `dedupeStoreName`, `discoveryActorId`, `discoveryInput`, `discoveryTimeoutSecs`,
`maxDiscoveryChargeUsd`, the alert URLs; the add-ons `enrichContacts`, `enrichContactsTop` (20), `screenBuyers`,
`maxAddOnChargeUsd` ($0.50 per sub-run). No SERP proxy? `useStoreFallback` + `maxDiscoveryChargeUsd` ($0.50) asks
apify/google-search-scraper, billed to you.

## Webhook, CRM and agencies

- **Webhook** — `webhookBatchSize: 1` POSTs `{"event": "importer.qualified", "importer": {…}, "runId": "…"}`, larger
  sizes `{"event": "importers.qualified", "importers": […], "runId": "…"}`; a 429 / 5xx is retried once after 2 s, a
  failed POST re-sent next run (`"redelivery": true`). `webhookSecret` signs it.
- **Which delivery field wins** — each URL is posted once; **Send alerts to** fills unset services. HubSpot: Make /
  Zapier on `dedupeKey`.
- **Agencies** — one saved task per client with `clientName` and its own `dedupeStoreName`.
- **Any plan, names you already have:** `{"sourceMode": "list", "itemsList": [{"name": "RAPS GmbH & Co. KG", "country": "DE"}]}`

## JavaScript client

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

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('rich_minds/importer-list-extractor-ai').call({
    // free first call instead: { sourceMode: "list", itemsList: [{ name: "…", country: "DE" }] }
    sourceMode: 'live', products: ['turmeric'], countries: ['DE'],
    goalDescription: 'German grinders buying Indian turmeric fingers',
    maxQualified: 50, failOnSourceError: true,
}, { timeout: 3600 /* , build: '0.1.11' — pin the build number your pipeline was tested with */ });
if (run.status !== 'SUCCEEDED') throw new Error(`${run.status}: ${run.statusMessage}`);
const rec = await client.keyValueStore(run.defaultKeyValueStoreId).getRecord('OUTPUT');
const out = rec ? rec.value : {};
if (out.ok === false) throw new Error(`${out.outcome}: ${out.sourceError}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((i) => [i.name, i.url, i.score, i.label]));
```

## List-mode rows

Start from the [ready template](list-template.json).

| Field | Needed? | What it enables |
|---|---|---|
| `name` | required | the row, `companyKey` (or `companyName`, `company`, `importer`, `title`) |
| `country` | optional | ISO-2 or a name; `dedupeKey`, `country_mismatch` |
| `website` (or `homepage`) | optional | `website`, `domain`, `url`, +15 score |
| `articleUrl` (or `sourceUrl`), `articleTitle`, `articleDate` | optional | article fields, date flags |
| `position`, `positions`, `articleUrls`, `mentions`, `contextText`, `query`, `companyKey`, `url`, `product` | optional | rank, `multi_source`, list line, merge key |
