VendorStacks
On this section
← All guides

Build a vendor-segmented prospect list

Page through /v1/prospect, dedupe across queries, and export a segment of entities that disclose a given vendor.

Markdown mirror: /docs/guides/vendor-segmented-prospect-list.md

Reverse lookup answers "who discloses vendor X?" in pages of 10 entities, 1 credit per page. A full segment is: page until exhausted, dedupe (an entity can match several queries if you run more than one), export.

Page until exhausted

prospect.mjs
const KEY = process.env.VENDORSTACKS_KEY;
const seen = new Map(); // domain -> row

async function segment(params) {
  for (let page = 1; ; page++) {
    const qs = new URLSearchParams({ ...params, page: String(page) });
    const res = await fetch(`https://vendorradar-production.up.railway.app
/v1/prospect?${qs}`, {
      headers: { Authorization: `Bearer ${KEY}` },
    });
    if (res.status === 429) {
      await new Promise(r => setTimeout(r, 1000 * Number(res.headers.get("retry-after") ?? 2)));
      page--; continue;
    }
    const data = await res.json();
    for (const c of data.companies) {
      if (!seen.has(c.domain)) seen.set(c.domain, { ...c, matched: qs.toString() });
    }
    if (page * data.per_page >= data.total) break;
  }
}

// Two queries, one deduped segment:
await segment({ vendor: "twilio", category: "sms_messaging" });
await segment({ vendor: "sinch", category: "sms_messaging" });

console.log([...seen.values()]
  .map(c => [c.domain, c.evidence?.quote?.replaceAll(",", ";"), c.matched].join(","))
  .join("\n"));

Cost math

Segment sizePagesCreditsAt $10-pack rate
200 entities2020~$0.18
1,400 entities140140~$1.27
5,000 entities500500~$4.55
  • Keep the evidence.quote column — it's the line your sequence can cite verbatim.
  • Total counts come back on every page (total), so you can estimate credits before paging far.
  • Enrich the top of the deduped list with full profiles via /v1/company (1 credit each) when you need the whole stack for tiering.