# APEDA Registered Exporters & MPEDA — Verified Exporter List — API reference

The detail an integrator needs and a buyer does not: linked from the README's Integrations section. `/actor-deploy
--assets` hosts this file next to the images (any other repo file 404s on the Store).

## Tested combinations

Every row is an input the test suite and the review runs start — the combinations that are supported. An input
outside this table is accepted by the schema but not tested; keep the table in sync with `storage-example/` and
`tests/` (gate `check_tested_combinations`, 2026-10-23 company-contact-finder-ai V-27).

| 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 APEDA register read by the Actor itself (basmati, Punjab), AI off | `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 |
| Your own list | your rows, no source run | `{"sourceMode": "list", "itemsList": [ … ]}` (fields: README → List-mode rows) |
| A dataset you have | a dataset's items, no source run | `{"sourceMode": "dataset", "datasetId": "<id>"}` |

Add one row per mode the Actor adds (a light mode, a file input, an add-on), with its input JSON.

## One dataset item

One item of the AI example run (`storage-example/INPUT.ai.json`, 2026-11-21, a demo row — so `chargedEvent: demo`; a paid row carries `qualified-registered-exporter-ai` / `-basic`):

```json
{
  "itemId": "8d4d5df68c86",
  "name": "ABAD EXIM PVT. LTD",
  "companyName": "ABAD EXIM PVT. LTD",
  "url": "https://e-mpeda.nic.in/registration/Rpt_Region_Wise_Exporters_Detailed_New.aspx?OffId=01&Office=RD%20Kochi&Categ=ExporterMT#fec0273450d7f044-sample",
  "registry": "mpeda",
  "registrationNumber": "KL1/MT/036/04",
  "registrationType": "MT",
  "exporterType": "Manufacturer Exporter",
  "issuedOn": "2004-12-21",
  "validUntil": "2028-12-20",
  "productCategory": "Frozen",
  "address": "Door No.40/1818, S.No.33, C-17,Bay Pride Mall, Marine Drive, Ernakulam 682031 Keralam",
  "city": null,
  "state": "Kerala",
  "pin": "682031",
  "contactPerson": null,
  "email": "gm.exim@abadgroup.in",
  "phone": null,
  "mobile": null,
  "website": "https://www.abad.co.in",
  "office": "RD Kochi",
  "products": [
    "Fish Wild",
    "Fish Aquaculture",
    "Shrimp Wild",
    "Shrimp Aquaculture",
    "Cuttlefish",
    "Squid",
    "Octopus",
    "Lobster",
    "Crab"
  ],
  "productForms": [
    "Frozen"
  ],
  "contactRoute": "gm.exim@abadgroup.in",
  "flags": [
    "valid_registration",
    "has_email",
    "manufacturer"
  ],
  "targetFlagsMatched": [],
  "ruleScore": 90,
  "score": 65,
  "label": "warm",
  "fitScore": 65,
  "scoreReasons": [
    "products lists shrimp wild and shrimp aquaculture but not basmati",
    "exporterType is Manufacturer Exporter",
    "validUntil is 2028-12-20",
    "has_email provides gm.exim@abadgroup.in"
  ],
  "summary": "ABAD EXIM PVT. LTD is an MPEDA-registered Manufacturer Exporter in Kerala dealing in fish, shrimp, cuttlefish, squid, octopus, lobster, and crab.",
  "fitNote": "Lists frozen shrimp (Wild/Aquaculture), lacks basmati; valid MPEDA registration until 2028.",
  "generatedText": "Dear ABAD EXIM PVT. LTD, we are looking for frozen shrimp (Wild and Aquaculture) for our UAE import operations. Could you please share your price list, MOQ, and lead time for these products? We look forward to your response.",
  "generatedTextBy": "ai",
  "recommendedNextStep": "Send the sourcing enquiry to gm.exim@abadgroup.in",
  "aiModel": "google:gemini-3.5-flash-lite",
  "assessedBy": "ai",
  "chargedEvent": "demo",
  "billedAs": "qualified-registered-exporter-ai",
  "dedupeKey": "id:fec0273450d7f044-sample",
  "source": "mpeda",
  "sourceUrl": "https://e-mpeda.nic.in/registration/Rpt_Region_Wise_Exporters_Detailed_New.aspx?OffId=01&Office=RD%20Kochi&Categ=ExporterMT",
  "rowId": "fec0273450d7f044-sample",
  "fetchedAt": "2026-11-21T17:09:36+00:00",
  "sourceRun": {
    "mode": "list"
  },
  "scrapedAt": "2026-11-21T17:09:36+00:00"
}
```

## Every output field

| Field | Meaning |
|---|---|
| `itemId`, `dedupeKey`, `rowId` | stable ids — `rowId` = a hash of registry + registration number (MPEDA) or of registry + the APEDA member id (stable across renames and moves; the member id, an IEC, is never output); upsert on `dedupeKey` (= `id:` + `rowId`) |
| `name` | the registered name as the board publishes it (canonical) |
| `url` | the register page + `#rowId` — the boards give a firm no page of its own |
| `source` | `apeda` / `mpeda` (canonical register id) |
| `registrationNumber`, `registrationType`, `exporterType`, `office` | the registration; number and office MPEDA only; `registrationType` RCMC (APEDA) or MT / ME / RX / OF / OT |
| `issuedOn`, `validUntil` | the board's own registration dates as printed in the MPEDA register read at `snapshotAt` — never our download date; null for APEDA |
| `products`, `productForms`, `productCategory` | registered products; MPEDA forms (Frozen, Chilled …) and category |
| `address`, `city`, `state`, `pin` | where the firm is registered (`city` only when the register gives it) |
| `contactPerson`, `email`, `phone`, `mobile`, `website` | contacts the register publishes (MPEDA); `website` as an https link |
| `contactRoute` | best contact: e-mail → mobile → phone → website → register page |
| `flags`, `targetFlagsMatched` | rule findings (README flag table) |
| `score`, `ruleScore`, `fitScore`, `label`, `assessedBy`, `aiModel` | ranking: sort on `score`, trend / threshold on `ruleScore`; `assessedBy` = ai / sample / rules |
| `fitNote`, `summary`, `scoreReasons`, `generatedText`, `generatedTextBy`, `recommendedNextStep` | the fit note, AI summary and reasons, the enquiry (and whose: ai / sample / rules), the next step |
| `chargedEvent`, `billedAs` | what this row was charged as (`billedAs` keeps the priced tier when `chargedEvent` is `free-tier`) |
| `sourceUrl`, `fetchedAt`, `sourceRun` | the register page read, when this run wrote the row (UTC), which mode loaded the row |
| `snapshotAt` | when the register data of the row was read: the daily MPEDA snapshot's time, or this run's live read (APEDA) — `issuedOn` / `validUntil` are the board's own dates |
| `hsCodes` | HS-4 headings the registered products map to (shrimp → 0306, basmati → 1006); `[]` when none maps to one heading |
| `rowType` | `exporter` (a register row, charged) or `screen` (a name / number you checked that the register does not list — free, `chargedEvent: none`) |
| `lookupKind`, `lookupQuery`, `status`, `checkedAt`, `found`, `filesChecked` | lookups / supplier list: which register (or `contact`), what you asked, active / expired / listed / not_found, when the run answered, matches found, reports or pages checked |
| `contactCheck` | the contact check: `matches_register` (the e-mail / phone / domain is the one MPEDA publishes for that firm), `mismatch` (another firm's, or the named firm lists other contacts), `not_in_register` (no registered exporter publishes it — a free row); null elsewhere |
| `companyName`, `registry`, `scrapedAt` | deprecated aliases (same values as `name`, `source`, `fetchedAt`), removed in 0.3, 2027-01; in no view |

## List-mode rows — every field a pasted record can carry

| Field | Needed? | What it enables |
|---|---|---|
| `companyName` (or `name`, `firmName`, `title`) | required | the row |
| `registry`, `registrationNumber`, `registrationType`, `exporterType` | optional | the registration, the stable id |
| `issuedOn`, `validUntil` | optional | validity flags |
| `products` (list or comma text), `productForms`, `productCategory` | optional | product filter, fit note |
| `address`, `city`, `state`, `pin`, `office` | optional | state filter |
| `contactPerson`, `email`, `phone`, `mobile`, `website` | optional | contact flags, `contactRoute` |
| `url`, `sourceUrl`, `rowId`, `registryFlags` | optional | link, dedupe key |
| `hsCodes`, `snapshotAt`, `rowType`, `found`, `filesChecked`, `lookupKind`, `lookupQuery`, `status`, `checkedAt`, `matchedQuery` | optional | carried through as given |

## Inputs renamed and API-only inputs

- `supplierNames` — **Check suppliers**, the form's one supplier-check input (one per line): a name (APEDA and MPEDA), an MPEDA number, or an e-mail / phone / domain alone or after the claimed name (the contact check).
- `supplierName` — API only since 0.2.3: sent alone it runs as one line of `supplierNames`; next to products / states / HS codes / types or one register it is the name filter of that search. The 0.2 name `companyName` is still accepted (one INFO line in the log).
- `lookups` — the object form over the API: `[{"kind": "mpeda", "number": "KL1/MT/202/08"}, {"kind": "apeda", "name": "Firm"}, {"kind": "contact", "contact": "sales@firm.in", "name": "Firm"}]`.
- `forceLive` — re-read the boards instead of the daily snapshot. `allowList`, `webhookSecret` — API only.

## Which call runs what

| Input shape | `OUTPUT.mode` | Can it charge? |
|---|---|---|
| `{}` or the untouched form | `demo` | no |
| the sample + a product typed (Console and API alike) | `live` | yes |
| the sample + a product + `autoSwitchToLive: false` | `demo` (a WARN line, the terms named) | no |
| a product / state / name / HS code / type, one register, a supplier list, or `"live"` + a brief | `live` | yes |
| `"list"` + `itemsList` / `"dataset"` + `datasetId` | `list` / `dataset` | yes |

## Free tier and the AI reserve

Your first 25 qualified registered exporters on this Actor are free, whatever the tier. While the AI is unavailable on
your plan, rule-scored rows use those free units too, but 5 of them are kept for your first AI-assessed exporters (the
AI reserve, `OUTPUT.chargeSplit.freeKeptForAi`); the status only says "N free registered exporters left".

## `OUTPUT` record keys

Generate this list from THREE runs merged — list mode with AI on, a scheduled second run of the same search (trend,
history, seeds, scheduled sizing filled) and a refused live run (`outcome: source_refused`) — never from the demo
alone: a demo-generated list typed 30 of 48 keys `null` and listed no `outcome` value, so the Run-outcomes contract
could not be coded against from the page (gate `check_api_reference_output_typed`, 2026-10-23 us-importer-finder-ai
V-206). One line per key: type, one example, and the sub-keys of every nested record.

- `ok` — bool: `false` only when the source was refused / failed and nothing loaded
- `outcome` — str, one of `ok` · `empty` · `source_refused` · `source_failed` · `error`
- `mode` — str: `demo` · `live` · `list` · `dataset`
- `qualified` — int, e.g. `12`
- `stats` — object: the funnel, `discovered`, `skipped_<reason>` counts, `ai_assessed`, `capped_by_max_qualified`
- `skips` — object | null: `{"<reason>": ["<name>", …]}` — the names each Actor-specific 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`; `aiError` — str | null
- `aiTokens` — object | null: `inputPerUnit`, `outputPerUnit`, `model`
- `webhook` — object | null: `sent`, `failed`, `failedKeys`, `redelivered`, `pendingNextRun`, `signed`
- `trend` — object | null (second run on): `qualified: {from, to}`, `hot: {from, to}`, the Actor's own series
- `history` — array | null: one `{at, qualified, hot, …}` per run of this search, oldest first
- `scheduledSizing`, `firstRunBackfill`, `seedsRolled`, `scanCapHit` — object | null: what a scheduled run resized
- `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
- `snapshotAt` — object | null: `{"mpeda": "2026-11-22T08:10:00+00:00", "apeda": …}` — when each register was read
- `screenRows` — int | null: free "checked, not listed" rows
- `lookups` — object | null: per kind `asked`, `active`, `expired`, `listed`, `not_found`, `failed`, `pagesRead` (kind `contact`: `contact_match`, `contact_mismatch`, `not_found`); `nearMatches` — object | null
- `termsFromBrief` — array | null: the product words a live search read from `goalDescription` when no product was typed

## Webhook payloads and delivery

- **Per row** — `webhookUrl` POSTs `{"event": "registered_exporter.qualified", "registered_exporter": {…}, "runId": "…"}`.
- **Batched** (`webhookBatchSize` > 1) — `{"event": "registered_exporters.qualified", "registered_exporters": [{…}], "runId": "…"}`.
- A 429 / 5xx is retried once after 2 s; a failure never fails the run; a failed POST is retried on the next run;
  `webhookSecret` signs the body.
- **Which delivery field wins** — one POST per service; a per-service field (API only) wins over **Send alerts to**;
  `webhookUrl` gets the rows, the others the digest. HubSpot / Pipedrive via Make / Zapier: upsert on `dedupeKey`.

## Supplier due diligence in 3 calls

Find the exporters here, screen them against the sanctions lists, then read the month's export rules for their product.
10 basmati exporters, screened, plus ≈ 5 rice notices: ≈ $0.20 rules only after each Actor's free tier
(10 × $0.01 + 10 × $0.0039 + ≈ 5 × $0.0125).

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
# 1. licensed exporters of your product (this Actor)
run = client.actor("rich_minds/india-exporter-registries-ai").call(
    run_input={"products": ["basmati"], "states": ["Punjab"], "maxQualified": 10, "enableAi": False},
    timeout_secs=600,
)
exporters = list(client.dataset(run["defaultDatasetId"]).iterate_items())
# 2. screen them: OFAC, US CSL, UN, EU, UK (counterparty-check-ai)
run = client.actor("rich_minds/counterparty-check-ai").call(
    run_input={"counterparties": [f"{e['name']}, IN" for e in exporters], "enableAi": False},
    timeout_secs=900,
)
verdicts = {v["name"]: v for v in client.dataset(run["defaultDatasetId"]).iterate_items()}
# 3. the last 30 days of Indian export rules for rice, HS 1006 (trade-regulation-watch-ai)
run = client.actor("rich_minds/trade-regulation-watch-ai").call(
    run_input={"hsCodes": ["1006"], "lookbackDays": 30, "enableAi": False},
    timeout_secs=600,
)
notices = list(client.dataset(run["defaultDatasetId"]).iterate_items())
for e in exporters:
    v = verdicts.get(e["name"], {})
    print(e["name"], e["validUntil"], v.get("verdict"), e["url"])
print(len(notices), "rice export notices in the last 30 days")
```
