# Indian Suppliers Price List: TradeIndia, ExportersIndia USD/MT — API reference

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

## Tested combinations

| 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 | TradeIndia + ExportersIndia read by this Actor, AI off, 5 listings | `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 |
| Brief only | the products named in `goalDescription` are searched (`OUTPUT.termsFromBrief`) | `{"goalDescription": "W320 cashew and turmeric finger, 10 t a month"}` |
| Your currency | adds `priceConverted` per tonne (INR per kg) | `{"products": ["turmeric"], "targetCurrency": "AED"}` |
| Your own list | your rows, no read of the sites | `{"sourceMode": "list", "itemsList": [ … ]}` (fields: README → List-mode rows) |
| A dataset you have | a dataset's items | `{"sourceMode": "dataset", "datasetId": "<id>"}` |

**Which mode runs:** the README's "Which call runs what" table is the one place the rule lives (input shape → `OUTPUT.mode`).
The 0.1 value `actor` still works as `live`. The first log line and `OUTPUT.modeReason` say why the mode ran.

## Run outcomes — what your integration sees

| Outcome | Run status | Dataset | `OUTPUT` | Charged? |
|---|---|---|---|---|
| Free demo | SUCCEEDED | samples | `mode: demo` | no |
| Success | SUCCEEDED | listings | `outcome: ok`, `queries` | per listing |
| One site refused | SUCCEEDED | the other site's rows | `refused: [{site, reason, detail}]` — alert on `reason == failed` | per listing |
| Nothing matched | SUCCEEDED | empty | `outcome: empty` | no — not by us; no Store Actor runs |
| Every site refused | FAILED | empty | `ok: false`, `outcome: source_failed` (`failOnSourceError` for schedules) | no |
| Source partial | SUCCEEDED | rows read | `sourceStatus.partial` | per listing |
| Invalid input | FAILED | empty | none — read `statusMessage` | no |
| AI unavailable | SUCCEEDED | rule rows | `aiError` | basic price |

Store fallback (IndiaMART only): `{"useStoreFallback": true, "maxDiscoveryChargeUsd": 0.5}` — a Store Actor on your
account, capped by `maxDiscoveryChargeUsd`:

```bash
curl -d '{"products":["turmeric"],"useStoreFallback":true,"maxDiscoveryChargeUsd":0.5}' -H "Content-Type: application/json" "https://api.apify.com/v2/acts/rich_minds~india-b2b-suppliers-ai/runs?token=<TOKEN>"
```

## Webhook payload

Per row: `{"event": "supplier_listing.qualified", "supplier_listing": {…one dataset item…}, "runId": "<run id>"}`.
With `webhookBatchSize` > 1: `{"event": "supplier_listings.qualified", "supplier_listings": [ … ], "runId": "…"}`.
Retried once on 429 / 5xx; rows that still failed are in `OUTPUT.webhook.failedKeys` and re-POSTed first on the next
run. `webhookSecret` signs the body (HMAC-SHA256 in the `X-Signature` header).

## Run time per mode

| Mode | Measured time | `timeoutSecs` to pass |
|---|---|---|
| Free demo | 0.7 s (local) | 120 |
| Live, 1 product × 2 sites × 50 | 4 s (local, 2026-11-22) | 300 |
| Live, 3 products (spices preset, 120 qualified of 169 read) | 14 s (local, 2026-11-22) | 300 |
| AI, own key | ≈ 3.3–6.2 s per listing, 10–18 a minute (free google:gemini-3.5-flash-lite key, 2026-11-22) | 240 + 18.6 s each |
| AI via Apify's model access | not measured on the platform yet | 240 + 18.6 s each |

## List-mode rows — what a pasted record needs

| Field | Needed? | What it enables |
|---|---|---|
| `name` | required (or `companyName`, `seller`) | the row |
| `url` | required (or `listingUrl`, `productUrl`) | the listing link, the dedupe key |
| `price` | optional — "Rs 110 - Rs 150 Per Kilogram" | USD per tonne |
| `productTitle`, `productQuery`, `city`, `state`, `moq`, `site` … | optional | filters, median, score |

## JavaScript client

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

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('rich_minds/india-b2b-suppliers-ai').call({
    // free first call instead: {} (the demo) or { sourceMode: 'list', itemsList: [your rows] }
    products: ['cashew'], goalDescription: 'W320 kernels, 1 container a month', maxQualified: 20,
}, { timeout: 620 /* FAQ own-key row: 240 + 18.6 s each × 20; build: '0.1.3' */ });
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 || out.sourceError) throw new Error(`${out.outcome}: ${out.sourceError}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((i) => [i.name, i.priceUsdPerMt, i.score, i.label, i.url]));
```

## One dataset item

A TradeIndia row from the live basmati run of 2026-11-22 (AI off), every field:

```json
{"itemId": "b751a226d9a0", "rowId": "c99b736f2f73976a", "fetchedAt": "2026-11-22T14:22:54+00:00",
 "name": "SHAH ENTERPRISES FBD PRIVATE LIMITED",
 "url": "https://www.tradeindia.com/products/traditional-brown-basmati-rice-c10836643.html",
 "site": "tradeindia", "listingId": "10836643", "city": "Faridabad", "state": "Haryana",
 "productTitle": "Traditional Brown Basmati Rice", "productQuery": "basmati rice", "price": "90000.0 INR (Approx.)",
 "priceMin": 90000, "priceMax": 90000, "priceCurrency": "INR", "priceUnit": "tonne", "priceUsdPerMt": 971.08,
 "priceUsdPerMtNote": null, "productMedianUsdPerMt": 971.08, "fxRate": 92.68, "fxDate": "2026-11-20",
 "moq": 1, "moqUnit": "tonne", "moqTonnes": 1.0, "bagKg": null, "gstVerified": false, "gstin": null,
 "yearsInBusiness": 11, "yearsInBusinessBasis": "established", "responseRate": null,
 "trustBadges": ["Premium Seller"], "certifications": ["MSME", "FSSAI", "ISO-22000", "HALAL", "IEC", "APEDA"],
 "sellerKey": "shah enterprises fbd|faridabad",
 "sellerUrl": "https://www.tradeindia.com/shah-enterprises-fbd-private-limited-29715706/",
 "sourceUrl": "https://www.tradeindia.com/manufacturers/basmati-rice.html", "hsCode": null,
 "description": "Traditional Brown Basmati Rice",
 "priceConverted": 971.08, "priceConvertedCurrency": "USD", "priceConvertedUnit": "tonne",
 "contactRoute": "https://www.tradeindia.com/products/traditional-brown-basmati-rice-c10836643.html",
 "contactRouteType": "inquiry form on the listing",
 "nextStepActorUrl": "https://console.apify.com/actors/rich_minds~india-exporter-registries-ai?input=%7B%22supplierNames%22%3A%20%5B%22SHAH%20ENTERPRISES%20FBD%20PRIVATE%20LIMITED%22%5D%7D",
 "flags": ["masked_phone", "verified"], "targetFlagsMatched": [], "ruleScore": 90, "score": 90, "label": "hot",
 "fitScore": null, "productMatch": "exact", "scoreReasons": [], "summary": "",
 "generatedText": "Hello — we are pricing basmati rice for export: is your listed 90000.0 INR (Approx.) ex-works or FOB an Indian port, and what would you quote per tonne for your minimum of 1 tonne?",
 "recommendedNextStep": "Send the RFQ through the listing (…), then check SHAH ENTERPRISES FBD PRIVATE LIMITED's GSTIN and IEC before any advance payment.",
 "aiModel": null, "assessedBy": "rules", "chargedEvent": "qualified-supplier-listing-basic",
 "billedAs": "qualified-supplier-listing-basic", "dedupeKey": "tradeindia:10836643",
 "source": {"mode": "actor", "actorId": "own-source", "reader": "built-in TradeIndia + ExportersIndia reader",
            "query": "basmati rice"},
 "scrapedAt": "2026-11-22T14:22:54+00:00"}
```

**Dates:** `fxDate` is the ECB's publication date of the USD/INR reference rate this run used (not the listing's
date); `fetchedAt` / `scrapedAt` are when this run read the page (UTC). The price is the seller's current ask.

**`chargedEvent`** is never null: `qualified-supplier-listing-basic`, `qualified-supplier-listing-ai`, `free-tier`,
`demo` (sample rows, free) or `already-charged`.

## `OUTPUT` record keys

- `ok` — bool: `false` only when every site was refused / failed and nothing loaded
- `outcome` — str: `ok` · `empty` · `source_refused` · `source_failed`
- `mode` — str: `demo` · `live` · `list` · `dataset`; `modeReason` — str, e.g. `"products read from the brief"`
- `rows`, `qualified` — int, e.g. `89`
- `queries` — array: per product `{product, sellers, listingsDelivered, listingsRead, listingsWithPrice, pricedShare,
  medianUsdPerMt, minUsdPerMt, maxUsdPerMt, pricedListings, outliers, sites: {<site>: {pagesRead, listings, withPrice,
  convertibleUsdPerMt, medianUsdPerMt}}}`
- `refused` — array: `{site, product, reason, detail}`; `fx` — object: `rate`, `date`, `source`, `rates` (INR, EUR, GBP,
  AED per USD)
- `termsFromBrief` — array | null; `targetCurrency` — str; `hsUnmapped` — array | null; `storeFallback` — object | null
- `stats` — object: `discovered`, `skipped_<reason>` counts, `ai_assessed`, `capped_by_max_qualified`
- `skips` — object | null: `{"no_price": ["<seller>", …], …}`
- `chargedEvents` — object: `{"<event>": <count>}`; `chargeSplit` — object: `demo`, `free`, `basic`, `ai`,
  `freeKeptForAi`; `freeTierRemaining` — int | null; `costUsd` — number
- `sourceStatus` — object | null: `reader`, `status`, `partial`, `perQuery`
- `sourceError` — str | null · `sourceRefused` — `"plan"` | 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}`
- `history` — array | null: one `{at, qualified, hot}` per run of this search, oldest first
- `scheduledSizing`, `firstRunBackfill`, `scanCapHit` — object | null: what a scheduled run resized
- `digestEmailed` — bool | null; `scheduleTaskUrl` — str | null; `reportUrl` — str | null
- `timing` — object: `sourceSecs`, `aiSecs`, `aiSecsPerUnit`, `aiBackoffSecs`, `aiPaceSecs`, `totalSecs`
- `nextSteps` — array | null: the status steps that did not fit the 200-character status

## The free tier and the AI reserve

Your first 25 qualified listings per Apify account are free. When the AI is on but your plan has no model access and
no own key, the rule-only rows use the free listings down to 5 — those 5 stay free for your first AI-assessed
listings (`OUTPUT.chargeSplit.freeKeptForAi`). The status says only "N free supplier listings left".

## Own-key AI speed

Measured 2026-11-22 with a free `google:gemini-3.5-flash-lite` key: ≈ 3.3–6.2 s per listing (≈ 10–18 a minute).
`timeoutSecs` = 240 + 18.6 s per qualified listing (1.5 × the slowest measured 6.2 s, × 2 AI candidates per listing). Apify's model access
(`anthropic/claude-haiku-4.5`): not measured on the platform yet.
