How to call the B2B prospect discovery API from an AI agent

What does Prosp's discovery API give an AI agent?

Prosp (prosp.cc) exposes a B2B prospect discovery API that turns a natural-language buyer description into a list of matching companies with contacts. Your agent sends criteria like "Independent coffee roasters in the Netherlands that supply cafes and restaurants" and receives company records — domain, name, location, size, industry — plus the contacts Prosp found for each.

The API is named Prosp Discovery API. It has two access paths: a public REST API (/api/v1/… recommended, /mcp/… as a fully supported alternative with the same meaning) and an MCP server your agent connects to directly. Both reach the same discovery engine.

Start a discovery (REST, JavaScript)
// accessToken: exchange your Client ID and Secret (/credentials in the bot) for a token with the OAuth client-credentials grant; the token URL is in /docs/
// idempotencyKey: make ONE per run and reuse it when a step is retried, so a retry never starts a second paid job
const res = await fetch("https://api.prosp.cc/api/v1/discoveries", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${accessToken}`,
    "Content-Type": "application/json",
    "X-Idempotency-Key": idempotencyKey,
  },
  body: JSON.stringify({
    "query": "Independent coffee roasters in the Netherlands that supply cafes and restaurants",
    "locations": [
      "Netherlands"
    ],
    "company_sizes": [
      "small",
      "medium"
    ],
    "maxResults": 5
  }),
});
if (!res.ok) throw new Error(`start failed: HTTP ${res.status}`);   // 402 no credits; 409 a warning or the same job already running (nothing charged); 429 too many requests or jobs
const { jobId } = await res.json();
What Prosp answered (HTTP 200)
{
  "jobId": "5fd86ce778c25261e522b4f516ae6c1c",
  "status": "running",
  "createdAt": "2026-11-09T01:26:49.070978327Z",
  "poll_after_seconds": 20,
  "estimated_duration_seconds": 3605,
  "estimated_duration_p50_seconds": 116,
  "estimated_duration_p90_seconds": 2589,
  "estimated_duration_p95_seconds": 3605,
  "estimated_yield": 3
}
The companies Prosp returned (two shown; contacts are left out of this public example)
{
  "already_owned_count": 1,
  "candidates_screened": 39,
  "prospects": [
    {
      "country_code": "NL",
      "city": "Winterswijk",
      "state": "Gelderland",
      "linkedin_url": "https://www.linkedin.com/company/hesselink-koffie/",
      "instagram_url": "https://www.instagram.com/hesselinkkoffiebranders/",
      "facebook_url": "https://www.facebook.com/hesselinkKoffie",
      "youtube_url": "https://youtube.com/@HesselinkKoffie",
      "business_model": "manufacturer",
      "estimated_annual_revenue_usd": 24000000,
      "domain": "hesselinkkoffie.nl",
      "industry": "Agriculture & Food Production",
      "estimated_revenue_currency": "USD",
      "founded_year": 1885,
      "hq_address": "Winterswijk, Gelderland, Netherlands",
      "social_description": "Hesselink Koffiebranders ( B Corp) \nis een familiebedrijf dat sinds 1885 staat voor topkwaliteit en duurzaamheid in koffie. Met meer dan 140 jaar ervaring beheersen we het ambacht van koffiebranden als geen ander. Onze passie voor perfectie zorgt ervoor dat elke kop koffie een moment van geluk is.",
      "social_follower_count": 2691,
      "social_legal_name": "Hesselink Koffie",
      "social_source": "linkedin",
      "social_extra_links": [
        "http://www.hesselinkkoffie.eu",
        "https://plus.google.com/113443696654761814245/posts",
        "https://www.facebook.com/hesselinkKoffie?fref=ts",
        "https://twitter.com/HesselinkKoffie",
        "http://www.linkedin.com/company/1043333?trk=tyah&trkInfo=tas%3Ahesselink%20koffie%2Cidx%3A1-1-1",
        "http://www.fingerprinted.eu",
        "http://www.hespresso.eu"
      ],
      "social_profiles": [
        {
          "platform": "linkedin",
          "url": "https://www.linkedin.com/company/hesselink-koffie/",
          "follower_count": 2691,
          "legal_name": "Hesselink Koffie"
        },
        {
          "platform": "youtube",
          "url": "https://youtube.com/@HesselinkKoffie",
          "follower_count": 78,
          "extra_links": [
            "http://www.hesselinkkoffie.eu",
            "https://plus.google.com/113443696654761814245/posts",
            "https://www.facebook.com/hesselinkKoffie?fref=ts",
            "https://twitter.com/HesselinkKoffie",
            "http://www.linkedin.com/company/1043333?trk=tyah&trkInfo=tas%3Ahesselink%20koffie%2Cidx%3A1-1-1",
            "http://www.fingerprinted.eu",
            "http://www.hespresso.eu"
          ],
          "legal_name": "Hesselink Koffie",
          "description": "Wij zijn Hesselink Koffie en wij geloven dat lekkere koffie een leven kan verrijken. Voor de meeste Nederlanders is koffie een primaire levensbehoefte. Onze missie is iedereen met die behoefte van dienst te zijn. Dit doen wij vanuit onze eigen koffiebranderij in Winterswijk, zo kunnen wij ambachtelijke en bovenal lekkere koffie garanderen.\n\nWij leveren koffie aan: horeca, bedrijven en particulieren (Hespresso). Daarnaast hebben wij ook ons eigen label duurzame koffie: Fingerprinted Koffie."
        }
      ],
      "discovered_at": "2026-11-04T11:56:49.888716Z",
      "detected_language": "nl",
      "has_wikipedia_article": true,
      "detected_industry": "Agriculture & Food Production",
      "origin_country": "NL",
      "facts": [
        {
          "source": "web",
          "source_url": "https://hesselinkkoffie.nl/over-ons/duurzaamheid/",
          "extracted_at": "2026-11-04T12:03:30.815668Z",
          "text": "Hesselink Koffiebranders maintains transparency throughout their supply chain and holds multiple certifications including Fairtrade Organic, SKAL for organic production, and the Rainforest Alliance seal.",
          "first_party": true
        },
        {
          "source": "web",
          "source_url": "https://hesselinkkoffie.nl/over-ons/duurzaamheid/",
          "extracted_at": "2026-11-04T12:03:30.531299Z",
          "text": "Hesselink Koffiebranders is an officially B Corp certified coffee supplier that provides sustainable coffee solutions to the hospitality industry and other business sectors.",
          "first_party": true
        }
      ],
      "name": "Hesselink Koffie",
      "description": "Hesselink Koffie is a coffee roastery providing artisanal, sustainably sourced coffee beans and professional coffee machines. They serve hospitality and corporate clients primarily across the Netherlands and Germany.",
      "company_size": "small",
      "size_certainty": "estimated",
      "headquarters_location": "Winterswijk, Netherlands",
      "country": "Netherlands"
    },
    {
      "country_code": "NL",
      "city": "Noordwijkerhout",
      "state": "Zuid-Holland",
      "postal_code": "2211",
      "street": "Pletterij 7",
      "instagram_url": "https://www.instagram.com/koffie_lovers/",
      "facebook_url": "https://www.facebook.com/KoffieLoverss",
      "business_model": "manufacturer",
      "estimated_annual_revenue_usd": 4400000,
      "domain": "koffie-lovers.nl",
      "industry": "Hospitality & Restaurant",
      "estimated_revenue_currency": "USD",
      "founded_year": 1998,
      "hq_address": "Pletterij 7, Noordwijkerhout, Zuid-Holland 2211, Netherlands",
      "discovered_at": "2026-11-04T11:55:22.190906Z",
      "detected_language": "nl",
      "has_wikipedia_article": false,
      "domain_age_days": 4963,
      "detected_industry": "Hospitality & Restaurant",
      "sub_country_region": "NL-ZH",
      "origin_country": "NL",
      "facts": [
        {
          "source": "web",
          "source_url": "https://grachtenbeans.nl/en/koffiebrander/koffie-lovers/",
          "extracted_at": "2026-11-04T11:59:04.202460Z",
          "text": "Koffie Lovers has built a strong brand by combining craft roasting techniques, ethical sourcing, and educational efforts.",
          "first_party": false
        },
        {
          "source": "web",
          "source_url": "https://grachtenbeans.nl/en/koffiebrander/koffie-lovers/",
          "extracted_at": "2026-11-04T11:57:39.551192Z",
          "text": "The company offers a range of seven house blends and several single-origin coffees sourced directly from twelve countries, all carrying Fairtrade or Rainforest Alliance certifications.",
          "first_party": false
        }
      ],
      "name": "Koffie Lovers",
      "description": "Koffie Lovers is a coffee roasting business that supplies freshly roasted coffee beans, espresso machines, and accessories to hospitality businesses and offices throughout the Netherlands.",
      "company_size": "small",
      "size_certainty": "estimated",
      "headquarters_location": "Noordwijkerhout, Netherlands",
      "country": "Netherlands"
    }
  ],
  "evaluated_count": 7,
  "total": 5
}
  1. Start a searchPOST /api/v1/discoveries with criteria or icpId; returns jobId immediately
  2. Poll until terminalGET /api/v1/discoveries/{jobId}; status becomes completed, failed, or exhausted
  3. Read companiesGET /api/v1/discoveries/{jobId}/prospects returns companies with contacts
  4. Acknowledge deliveryPOST /api/v1/prospects/ack so domains are not returned again
Your agent starts a search, waits for it to finish, reads the companies, and marks them delivered.
Your agentYour agentProspDiscovery APIProspDiscovery APIPOST /api/v1/discoverieswith search criteria200: jobIdGET /api/v1/discoveries/{jobId}until terminalstatus: completed,total_prospects, found domainsGET/api/v1/discoveries/{jobId}/prospectscompanies with contactsPOST /api/v1/prospects/ackwith delivered domainsacknowledged
The agent starts a search, polls until it finishes, reads the companies, and acknowledges delivery.

How does the REST discovery flow work step by step?

The goal: your agent starts a search, waits for it to finish, reads the companies, and acknowledges them so they are not returned again.

Step one — Start. POST /api/v1/discoveries with inline criteria (a natural-language query plus optional industries, locations, company sizes, keywords, exclusions, sub-country regions, business models) or a saved ICP id. The response returns a jobId immediately. Add an X-Idempotency-Key header to make the call safe to retry.

Step two — Poll. GET /api/v1/discoveries/{jobId} until the status is terminal (completed, failed, or exhausted). The merged view shows lifecycle state, total prospects so far, target, and the found domains that accumulate while the search runs.

Step three — Read. GET /api/v1/discoveries/{jobId}/prospects for the companies this search found, each with the contacts Prosp attached. Or GET /api/v1/prospects for your de-duplicated inbox across all discoveries.

Step four — Acknowledge. POST /api/v1/prospects/ack to mark domains as delivered so they are not returned again.

A search usually takes minutes; some take up to about an hour. If a search fails or stalls, cancel it with POST /mcp/jobs/{jobId}/cancel — credits are refunded only when nothing had been delivered at cancel time.

Wait for the job (REST, JavaScript)
// accessToken and jobId: from the calls above
const terminal = ["completed", "failed", "exhausted", "cancelled"];
const deadline = Date.now() + 45 * 60 * 1000;
let job, cursor = null, wait = 20;   // seconds; then the poll_after_seconds of the last answer
do {
  await new Promise((r) => setTimeout(r, wait * 1000));
  if (Date.now() > deadline) {
    await fetch(`https://api.prosp.cc/mcp/jobs/${jobId}/cancel`, {
      method: "POST",
      headers: { Authorization: `Bearer ${accessToken}` },
    });   // frees the concurrency slot; prospects already delivered are kept
    throw new Error("the job did not finish in 45 minutes and was cancelled");
  }
  const url = `https://api.prosp.cc/mcp/jobs/${jobId}/status` + (cursor ? `?cursor=${encodeURIComponent(cursor)}` : "");
  const r = await fetch(url, {
    headers: { Authorization: `Bearer ${accessToken}` },
  });
  if (!r.ok) throw new Error(`status check failed: HTTP ${r.status}`);
  job = await r.json();
  cursor = job.next_cursor ?? cursor;   // only the prospects added since the last poll
  wait = job.poll_after_seconds ?? 20;
} while (!terminal.includes(job.status));
Read the companies (REST, JavaScript)
// accessToken and jobId: from the calls above
const r = await fetch(`https://api.prosp.cc/api/v1/discoveries/${jobId}/prospects`, {
  headers: { Authorization: `Bearer ${accessToken}` },
});
const { prospects } = await r.json();

How does the MCP server expose the same discovery tools?

Your agent connects to the MCP server at https://api.prosp.cc/mcp-rpc (Streamable HTTP transport). Once connected, the discovery tools appear:

Saved ICP tools (list_icps, save_icp, run_icp) let your agent reuse criteria across searches. run_icp starts a search from a saved icpId and costs the same credits as find_prospects.

The finished job (two companies shown)
{
  "status": "completed",
  "jobId": "5fd86ce778c25261e522b4f516ae6c1c",
  "result": {
    "prospects": [
      {
        "social_description": "Born from adventure, we now have over 20 years of proud heritage that gives us the edge of unparalleled quality, experience and craftmanship. It’s the way we see the future while celebrating our past that allows us to lead the way in our favorite game. And we do it right.",
        "social_follower_count": 3574,
        "social_legal_name": "Bocca Coffee",
        "social_source": "linkedin",
        "social_profiles": [
          {
            "legal_name": "Bocca Coffee",
            "platform": "linkedin",
            "url": "https://www.linkedin.com/company/bocca-coffee/",
            "follower_count": 3574
          },
          {
            "legal_name": "Bocca Coffee",
            "platform": "youtube",
            "url": "https://www.youtube.com/@boccacoffee3009",
            "follower_count": 99
          }
        ],
        "discovered_at": "2026-11-04T12:05:42.480277Z",
        "detected_language": "nl",
        "has_wikipedia_article": false,
        "domain_age_days": 8918,
        "detected_industry": "Hospitality & Restaurant",
        "sub_country_region": "NL-NH",
        "origin_country": "NL",
        "facts": [
          {
            "first_party": true,
            "text": "The company serves a wide variety of commercial clients, including restaurants, hotels, cafés, bakeries, offices, and sports clubs, providing B2B services such as private label production, contract roasting, and coffee supply solutions.",
            "source_url": "https://bocca.nl",
            "source": "web",
            "extracted_at": "2026-11-04T12:27:13.370758Z"
          },
          {
            "first_party": true,
            "text": "Founder Menno Simons established the company, which maintains a vertically integrated business model covering sourcing, roasting, brewing, training, and serving, supported by a passionate, talented, and family-like team that emphasizes continuous improvement.",
            "source_url": "https://bocca.nl/en/blogs/vacancies",
            "source": "web",
            "extracted_at": "2026-11-04T12:33:25.229089Z"
          }
        ],
        "name": "Bocca Espresso Bar",
        "description": "Bocca Espresso Bar sells specialty coffee, coffee machines, and related services primarily to hospitality businesses and offices in the Netherlands. They focus on direct trade, roasting, and packaging to deliver high-quality coffee experiences.",
        "company_size": "small",
        "size_certainty": "estimated",
        "headquarters_location": "Amsterdam, Netherlands",
        "country": "Netherlands",
        "country_code": "NL",
        "city": "Amsterdam",
        "state": "Noord-Holland",
        "postal_code": "1017 GP",
        "street": "Kerkstraat 96H",
        "linkedin_url": "https://www.linkedin.com/company/bocca-coffee/",
        "instagram_url": "https://www.instagram.com/boccacoffee/?hl=nl",
        "facebook_url": "https://www.facebook.com/BoccaCoffee",
        "youtube_url": "https://www.youtube.com/@boccacoffee3009",
        "business_model": "manufacturer",
        "domain": "bocca.nl",
        "industry": "Hospitality & Restaurant",
        "estimated_annual_revenue_usd": 11000000,
        "estimated_revenue_currency": "USD",
        "founded_year": 2001,
        "web_traffic": {
          "history": [
            {
              "dateFrom": "2026-05",
              "dateTo": "2026-05",
              "value": 7494
            },
            {
              "dateFrom": "2026-06",
              "dateTo": "2026-06",
              "value": 17259
            },
            {
              "dateFrom": "2026-07",
              "dateTo": "2026-07",
              "value": 9393
            },
            {
              "dateFrom": "2026-08",
              "dateTo": "2026-08",
              "value": 7773
            },
            {
              "dateFrom": "2026-09",
              "dateTo": "2026-09",
              "value": 9268
            },
            {
              "dateFrom": "2026-10",
              "dateTo": "2026-10",
              "value": 9268
            }
          ],
          "countryRank": 54331,
          "visitsMonthly": 9268,
          "avgDurationSeconds": 45
        },
        "hq_address": "Kerkstraat 96H, Amsterdam, Noord-Holland 1017 GP, Netherlands"
      },
      {
        "discovered_at": "2026-11-04T11:55:22.190906Z",
        "detected_language": "nl",
        "has_wikipedia_article": false,
        "domain_age_days": 4963,
        "detected_industry": "Hospitality & Restaurant",
        "sub_country_region": "NL-ZH",
        "origin_country": "NL",
        "facts": [
          {
            "first_party": false,
            "text": "Koffie Lovers has built a strong brand by combining craft roasting techniques, ethical sourcing, and educational efforts.",
            "source_url": "https://grachtenbeans.nl/en/koffiebrander/koffie-lovers/",
            "source": "web",
            "extracted_at": "2026-11-04T11:59:04.202460Z"
          },
          {
            "first_party": false,
            "text": "The company offers a range of seven house blends and several single-origin coffees sourced directly from twelve countries, all carrying Fairtrade or Rainforest Alliance certifications.",
            "source_url": "https://grachtenbeans.nl/en/koffiebrander/koffie-lovers/",
            "source": "web",
            "extracted_at": "2026-11-04T11:57:39.551192Z"
          }
        ],
        "name": "Koffie Lovers",
        "description": "Koffie Lovers is a coffee roasting business that supplies freshly roasted coffee beans, espresso machines, and accessories to hospitality businesses and offices throughout the Netherlands.",
        "company_size": "small",
        "size_certainty": "estimated",
        "headquarters_location": "Noordwijkerhout, Netherlands",
        "country": "Netherlands",
        "country_code": "NL",
        "city": "Noordwijkerhout",
        "state": "Zuid-Holland",
        "postal_code": "2211",
        "street": "Pletterij 7",
        "instagram_url": "https://www.instagram.com/koffie_lovers/",
        "facebook_url": "https://www.facebook.com/KoffieLoverss",
        "business_model": "manufacturer",
        "domain": "koffie-lovers.nl",
        "industry": "Hospitality & Restaurant",
        "estimated_annual_revenue_usd": 4400000,
        "estimated_revenue_currency": "USD",
        "founded_year": 1998,
        "hq_address": "Pletterij 7, Noordwijkerhout, Zuid-Holland 2211, Netherlands"
      }
    ],
    "already_owned_count": 1,
    "candidates_screened": 39,
    "status": "completed",
    "total_prospects": 5,
    "completed_at": "2026-11-09T01:27:05.003Z",
    "terminal_reason": "target_reached",
    "evaluated_count": 7,
    "already_owned_withheld_count": 5,
    "jobId": "5fd86ce778c25261e522b4f516ae6c1c"
  }
}
The fields each contact carries (names only)
[
  "name",
  "email",
  "position",
  "phone",
  "department",
  "organization",
  "linkedin_url",
  "instagram_url",
  "facebook_url",
  "twitter_url",
  "youtube_url",
  "telegram_url",
  "viber_url",
  "whatsapp_url",
  "contact_address",
  "contact_city",
  "contact_country",
  "contact_country_code",
  "contact_region",
  "registry_source",
  "email_source",
  "is_officer"
]

How does your agent authenticate?

The two access paths sign in differently.

REST: the only supported grant is OAuth 2.0 client credentials. Send /credentials to the Telegram bot to get your Client ID and Client Secret. POST them to https://prosp-mcp-641053169627.auth.eu-central-1.amazoncognito.com/oauth2/token with the scope mcp/execute. Use the returned access token as Authorization: Bearer on every REST call. In code examples the token lives in a variable named accessToken.

MCP: the server uses OAuth 2.1 authorization code with PKCE. Your agent registers itself and opens a sign-in window where the user chooses Continue with Telegram or signs in with an e-mailed one-time code. There are no API keys to paste.

Write an e-mail for one company (Smart Messaging, JavaScript)
const res = await fetch("https://api.prosp.cc/api/v1/message-intelligence", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${accessToken}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    "objective": "Offer a short list of cafes and restaurants in Germany that buy specialty coffee wholesale, and ask whether a sample list would help.",
    "recipient": {
      "name": "Team",
      "company_domain": "hesselinkkoffie.nl"
    },
    "channel": "email",
    "sender": {
      "company_domain": "prosp.cc"
    }
  }),
});
const { id } = await res.json();   // 202: the message is written in the background
const deadline = Date.now() + 45 * 60 * 1000;
let gen;
do {
  await new Promise((r) => setTimeout(r, 5_000));
  if (Date.now() > deadline) throw new Error("the message was not written in 45 minutes");
  const r = await fetch(`https://api.prosp.cc/api/v1/message-intelligence/${id}`, {
    headers: { Authorization: `Bearer ${accessToken}` },
  });
  if (!r.ok) throw new Error(`message status check failed: HTTP ${r.status}`);
  gen = await r.json();
} while (!["succeeded", "failed", "canceled"].includes(gen.status));
console.log(gen.result.subject, gen.result.message);

What does a search cost in credits?

A search costs 100 credits, whether started via REST POST /api/v1/discoveries or via MCP find_prospects. Polling, reading results, exporting, and acknowledging are free. Cancelling refunds credits only when nothing had been delivered at cancel time. Your agent can check its balance with get_credit_balance and review debits and refunds with get_credit_ledger.

A job still running
{
  "next_cursor": "MA",
  "poll_after_seconds": 20,
  "has_more": true,
  "prospectsFound": 0,
  "stage": "searching",
  "candidates_screened": 0,
  "estimated_duration_p50_seconds": 116,
  "total_prospects": 0,
  "estimated_duration_p90_seconds": 2589,
  "estimated_duration_p95_seconds": 3605,
  "estimated_duration_seconds": 3605,
  "estimated_yield": 3,
  "evaluated_count": 0,
  "jobId": "5fd86ce778c25261e522b4f516ae6c1c",
  "status": "processing",
  "target": 5
}
The finished job's status
{
  "evaluated_count": 7,
  "found": [
    "bocca.nl",
    "koffie-lovers.nl",
    "aromaclub.nl",
    "hesselinkkoffie.nl",
    "singleestatecoffee.nl"
  ],
  "jobId": "5fd86ce778c25261e522b4f516ae6c1c",
  "target": 5,
  "poll_after_seconds": 20,
  "has_more": false,
  "prospectsFound": 5,
  "already_owned_count": 1,
  "stage": "complete",
  "candidates_screened": 39,
  "status": "completed",
  "estimated_duration_p50_seconds": 93,
  "total_prospects": 5,
  "estimated_duration_p90_seconds": 2589,
  "estimated_duration_p95_seconds": 3605,
  "estimated_duration_seconds": 3605,
  "estimated_yield": 5,
  "terminal_reason": "target_reached"
}

Connect your agent

Open the MCP setup below to connect your agent over MCP. Once connected, your agent can call find_prospects and receive companies with contacts in its next turn.

Questions

Can I start a search from a saved ICP instead of inline criteria?

Yes. POST /api/v1/discoveries with an icpId, or call the MCP tool run_icp with the same id. Both debit 100 credits.

What happens if I call POST /api/v1/discoveries twice with the same search?

Include an X-Idempotency-Key header so the second call returns the original jobId instead of starting a duplicate search.

Is there a way to download the companies as a file?

Yes. REST: GET /mcp/jobs/{jobId}/prospects.csv or /mcp/jobs/{jobId}/report.pdf. MCP: call get_discovery_export for an Excel workbook.

Connect your agent