{"id":11418,"date":"2026-07-21T12:17:17","date_gmt":"2026-07-21T12:17:17","guid":{"rendered":"https:\/\/phantombuster.com\/blog\/?p=11418"},"modified":"2026-07-21T12:17:17","modified_gmt":"2026-07-21T12:17:17","slug":"phantombuster-api-ai-agent-3","status":"publish","type":"post","link":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/","title":{"rendered":"PhantomBuster Streaming API: Build Real-Time AI Prospecting Agents"},"content":{"rendered":"<p>When your prospecting agent has to launch a job, wait blindly, then poll for results, it stops feeling like an agent and starts feeling like glue code.<\/p>\n<p>PhantomBuster&#8217;s Streaming API reduces that friction by letting you observe a run while it&#8217;s still executing. The key decision is choosing between sync and async execution per step. If something is waiting, go sync; if not, run it in the background.<\/p>\n<p>Streaming gives you a practical sync option for steps where something is actively waiting, while keeping background runs for long jobs that should not block anything.<\/p>\n<p>This article shows you how to integrate PhantomBuster with your orchestrator, including an execution model, a sync\/async decision rule, an n8n example, production guardrails, and GTM placement.<\/p>\n<h2>How does the Streaming API change things for builders?<\/h2>\n<h3>What breaks with batch-only automation<\/h3>\n<p>Batch-only tools push you into a polling loop: launch a job, wait an unknown amount of time, poll for completion, then fetch output. That&#8217;s workable for scheduled workflows, but it creates friction inside agent-style runtimes.<\/p>\n<p>Long waits interrupt your agent loop. If a tool call takes minutes, you either block the agent or build state management to pause, resume, and reconcile partial state. Variable runtime makes chaining harder.<\/p>\n<p>If you want to extract profiles, enrich them with an LLM, then write to a CRM, it&#8217;s difficult to keep a consistent request-response flow when the first step sometimes takes 30 seconds and sometimes takes 30 minutes.<\/p>\n<p>Most orchestrators expect predictable responses. Tools like n8n, Make, and Zapier can handle async patterns, but batch-only APIs often force extra plumbing: polling intervals, timeout handling, and retry logic around every call. In practice, the &#8220;agent&#8221; spends too much time managing the workflow and not enough time executing core logic.<\/p>\n<h2>How the PhantomBuster Streaming API works<\/h2>\n<p>With streaming, you can read logs and partial output while the container runs, so agents don&#8217;t need blind waits or ad-hoc poll loops. When you launch a PhantomBuster Automation via API, you can retrieve incremental console output, status, and progress while the container executes. There are two modes:<\/p>\n<ul>\n<li><strong>Track mode<\/strong> returns structured status updates and recent console output through repeated calls to the container\u00a0status endpoint. Your orchestrator polls at an interval you control\u2014every 15 to 60 seconds or aligned with your rate limits\u2014and receives the latest progress and execution state.<\/li>\n<li><strong>Raw streaming<\/strong> returns an HTTP text\/plain chunked response that streams console output as the PhantomBuster Automation runs. Expect chunked transfer encoding with line-delimited console output; keep the connection open and parse incrementally. Your client receives output lines in near real time, not only after the job completes.<\/li>\n<\/ul>\n<p>This enables incremental processing during execution. Your agent can start filtering, deduplicating, or scoring leads as results arrive, then decide what to do next without waiting for a full export to finish.\u00a0Gate side effects (CRM writes, outreach) until required fields are present and eligibility checks pass.<\/p>\n<h3>What the Streaming API does not change<\/h3>\n<p>The Streaming API changes orchestration latency, not platform constraints. It does not change LinkedIn&#8217;s UI display caps. As of July 2026, many accounts see approximately 1,000 results in standard search and up to approximately 2,500 in Sales Navigator.<\/p>\n<p>Validate caps in your account and design for variance. It does not make aggressive behavior &#8220;safe.&#8221; It does not bypass eligibility rules, limits, or enforcement. LinkedIn risk is driven by patterns and cadence, not by whether an action was triggered through a sync endpoint, an async job, or an LLM tool call.<\/p>\n<p>For example, 100 connects in 10 minutes looks riskier than the same total spread across a week. Streaming changes how quickly you can receive data, not how quickly you should act on it.<\/p>\n<blockquote><p>&#8220;LinkedIn doesn&#8217;t behave like a simple counter. It reacts to patterns over time.&#8221; \u2014 PhantomBuster Product Expert, <a href=\"https:\/\/www.linkedin.com\/in\/brianejmoran\/\" target=\"_blank\" rel=\"noopener\">Brian Moran<\/a><\/p><\/blockquote>\n<p>If your agent sends 100 connection requests in 10 minutes because orchestration got faster, risk goes up. Treat streaming as a way to build more efficient workflows, not a reason to increase cadence.<\/p>\n<h2>Sync vs async: The decision rule<\/h2>\n<h3>When to use synchronous execution with streaming<\/h3>\n<p>Use synchronous streaming when another system is actively waiting for the result. This applies when:<\/p>\n<ul>\n<li>An LLM tool call expects input within a short window.<\/li>\n<li>A downstream enrichment step must run immediately.<\/li>\n<li>A CRM write depends on the output to proceed.<\/li>\n<li>Your agent&#8217;s decision logic needs the data before it can continue.<\/li>\n<\/ul>\n<p>Many agent runtimes expect tool calls to return in seconds or within a few minutes. Sync streaming fits that pattern when the job is small and predictable. Typical sync use cases:<\/p>\n<ul>\n<li>Profile enrichment for 1 to 10 profiles\u00a0(or any batch expected to finish within a few minutes) so the calling tool isn&#8217;t blocked for long.<\/li>\n<li>Small list lookups.<\/li>\n<li>Real-time ICP filtering on a short set.<\/li>\n<li>Single-profile data extraction.<\/li>\n<\/ul>\n<h3>When to use asynchronous background jobs<\/h3>\n<p>Use asynchronous execution when the work belongs in the background. This applies when:<\/p>\n<ul>\n<li>The job will take minutes to complete.<\/li>\n<li>You do not need immediate results.<\/li>\n<li>The workflow runs on a fixed cadence.<\/li>\n<li>You want predictable completion without blocking an agent loop.<\/li>\n<\/ul>\n<p>Typical async use cases:<\/p>\n<ul>\n<li>Sales Navigator Search Export\u00a0(up to approximately 2,500 results) usually completes within 20 to 40 minutes depending on filters and account.\u00a0Monitor actual run times in your logs.<\/li>\n<li>LinkedIn Company Follower Collector\u00a0typically returns up to approximately 10,000 results per run, but expect variance by account and context.\u00a0Split runs when needed.<\/li>\n<li>PhantomBuster watcher Automations for daily or weekly incremental checks.<\/li>\n<li>Large list exports, 1,000+ profiles.<\/li>\n<\/ul>\n<p>Async execution lets you launch work, persist the container ID, then come back to the output when it&#8217;s ready. Your system stays responsive and you avoid long-running tool calls.<\/p>\n<h3>Decision table: sync vs async by use case<\/h3>\n<div class=\"wp-layout-normal-table\"><table style=\"min-width: 75px;\">\n<colgroup>\n<col style=\"min-width: 25px;\" \/>\n<col style=\"min-width: 25px;\" \/>\n<col style=\"min-width: 25px;\" \/><\/colgroup>\n<tbody>\n<tr>\n<td colspan=\"1\" rowspan=\"1\"><strong>Use case<\/strong><\/td>\n<td colspan=\"1\" rowspan=\"1\"><strong>Recommended mode<\/strong><\/td>\n<td colspan=\"1\" rowspan=\"1\"><strong>Why<\/strong><\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">Profile enrichment: 1 to 10 profiles<\/td>\n<td colspan=\"1\" rowspan=\"1\">Sync<\/td>\n<td colspan=\"1\" rowspan=\"1\">Fast enough for a real-time response<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">Sales Navigator Search Export: up to 2,500 results<\/td>\n<td colspan=\"1\" rowspan=\"1\">Async<\/td>\n<td colspan=\"1\" rowspan=\"1\">Long runtime, do not block the agent loop<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">Watcher-style monitoring: daily incremental<\/td>\n<td colspan=\"1\" rowspan=\"1\">Async<\/td>\n<td colspan=\"1\" rowspan=\"1\">Cadence-driven, process on the next trigger<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">LLM tool call that needs immediate context<\/td>\n<td colspan=\"1\" rowspan=\"1\">Sync<\/td>\n<td colspan=\"1\" rowspan=\"1\">The agent runtime is waiting<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">Large list export: 1,000+profiles<\/td>\n<td colspan=\"1\" rowspan=\"1\">Async<\/td>\n<td colspan=\"1\" rowspan=\"1\">Better handled as background work<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">CRM write after enrichment<\/td>\n<td colspan=\"1\" rowspan=\"1\">Sync for the write<\/td>\n<td colspan=\"1\" rowspan=\"1\">The downstream system is waiting<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<h2>Reference architecture: Trigger to enrichment to CRM<\/h2>\n<h3>What the four-stage pipeline looks like<\/h3>\n<p>Real-time prospecting agents usually follow a four-stage pattern:<\/p>\n<ul>\n<li><strong>Stage 1: Signal detection<\/strong><\/li>\n<\/ul>\n<p>PhantomBuster\u00a0Automations run on schedule or trigger to detect intent. Examples include using PhantomBuster Automations for\u00a0post engagers, event attendees, Sales Navigator saved searches, or follower-watchers that detect new company followers.<\/p>\n<ul>\n<li><strong>Stage 2: Orchestration<\/strong><\/li>\n<\/ul>\n<p>Your backend or orchestrator\u2014n8n, Make, Zapier, or custom code\u2014launches the PhantomBuster Automation via API and streams or tracks results. This bridges the signal to your processing layer.<\/p>\n<ul>\n<li><strong>Stage 3: AI processing<\/strong><\/li>\n<\/ul>\n<p>Incoming data goes to an LLM for ICP filtering, scoring, and message drafting. This step evaluates the prospect against your ICP.<\/p>\n<ul>\n<li><strong>Stage 4: Action<\/strong><\/li>\n<\/ul>\n<p>If the lead passes your criteria, you trigger the next step: outreach and a CRM write. Outreach should still follow pacing rules, even if the decision happened in real time.<\/p>\n<h3>Where sync and async fit in this pipeline<\/h3>\n<ol>\n<li><strong>Signal detection<\/strong> typically runs async. Scheduled monitoring does not need to block anything.<\/li>\n<li><strong>Orchestration<\/strong> can be sync or async. Use sync streaming for short extractions where something is waiting, and use async tracking for large exports.<\/li>\n<li><strong>AI processing<\/strong> is usually sync. Your scoring and message generation typically run as part of the same decision loop.<\/li>\n<li><strong>Action<\/strong> splits by type. CRM writes are sync because the downstream system is waiting. Outreach runs are often async because they need pacing and should not block your workflow.<\/li>\n<\/ol>\n<h3>Architecture diagram: Described in plain steps<\/h3>\n<p>The flow looks like this:<\/p>\n<ol>\n<li><strong>Trigger<\/strong>: schedule or webhook.<\/li>\n<li><strong>PhantomBuster API<\/strong>: launch plus stream or track status.<\/li>\n<li><strong>Orchestrator<\/strong>: n8n, Make, Zapier, or custom backend.<\/li>\n<li><strong>LLM<\/strong>: filter, score, draft personalization.<\/li>\n<li><strong>PhantomBuster API<\/strong>: if you decide to act, launch a PhantomBuster outreach Automation (such as LinkedIn Auto Connect) and apply pacing rules.<\/li>\n<li><strong>CRM API<\/strong>: write the result and metadata.<\/li>\n<\/ol>\n<p>This division of labor keeps your workflow reliable: use PhantomBuster to extract data and trigger outreach, and keep ICP scoring and gating in your system.<\/p>\n<p>PhantomBuster provides integrated extraction and outreach Automations exposed by a single API, so your orchestrator can compose end-to-end workflows. Keeping those responsibilities separate is what keeps the system maintainable.<\/p>\n<h2>Worked example: n8n triggers Sales Navigator export with Claude enrichment<\/h2>\n<h3>Step 1: Define the trigger<\/h3>\n<p>Your n8n workflow starts on a schedule\u2014for example daily at 9am\u2014or via a webhook from your CRM. The trigger provides the Sales Navigator saved search URL as input. That URL can be fixed for a target segment, or generated dynamically based on CRM fields, for example &#8220;VP Sales at companies in our target segment.&#8221;<\/p>\n<h3>Step 2: Launch the Automation via API<\/h3>\n<p>In n8n, an HTTP Request node calls PhantomBuster&#8217;s launch endpoint with the saved search URL as input. For a full Sales Navigator export, up to approximately\u00a02,500 results, treat this as async.<\/p>\n<p>A run usually completes within 20 to 40 minutes depending on filters and account, which is too long for a synchronous agent call.<\/p>\n<p>The request looks like this: POST <a href=\"https:\/\/api.phantombuster.com\/api\/v2\/agents\/launch\" target=\"_blank\" rel=\"noopener\">https:\/\/api.phantombuster.com\/api\/v2\/agents\/launch<\/a> Headers: X-Phantombuster-Key: YOUR_API_KEY Body: { &#8220;id&#8221;: &#8220;AGENT_ID&#8221;, &#8220;argument&#8221;: { &#8220;sessionCookie&#8221;: &#8220;${{CRED.LI_SESSION}}&#8221;, &#8220;searches&#8221;: &#8220;SAVED_SEARCH_URL&#8221; } }\u00a0Load sessionCookie from your orchestrator&#8217;s credentials store (such as n8n Credentials) or an environment variable; never hardcode secrets.<\/p>\n<p>The response includes a container ID. Persist it, because you&#8217;ll use it to track status and fetch output for that specific run.<\/p>\n<h3>Step 3: Track execution and parse output<\/h3>\n<p>For short jobs, n8n can keep the call synchronous and parse the output as it arrives. For long jobs, store the container ID and poll the status endpoint at a reasonable interval\u2014for example every 30 seconds\u2014then fetch the final output once the run completes.<\/p>\n<p>Use GET \/containers\/{id}\/output for the active run. GET \/agents\/{id}\/output returns the last completed run, not the one currently running. To track an active run, use the container ID and call the container-specific output endpoint. The output is typically a JSON array of profile objects.<\/p>\n<p>Depending on the Automation, you&#8217;ll usually get:<\/p>\n<ul>\n<li>Full name<\/li>\n<li>Job title<\/li>\n<li>Company<\/li>\n<li>Location<\/li>\n<li>LinkedIn URL<\/li>\n<li>Profile summary and recent activity fields when available<\/li>\n<\/ul>\n<h3>Step 4: Send data to Claude for enrichment and scoring<\/h3>\n<p>n8n sends the extracted lead data to Claude, or another LLM, via API along with a scoring prompt. Example prompt:<\/p>\n<blockquote><p>You are a sales qualification agent. Evaluate this prospect: Name: [name] Title: [title] Company: [company] Summary: [summary] Does this prospect match our ICP (B2B SaaS, 50 to 500 employees, VP level or above)? First explain your reasoning, then give a score from 0-10 If score is 7 or higher, draft a personalized connection request message.<\/p><\/blockquote>\n<p>The LLM returns an ICP fit score, the reason for the score, and a draft message when qualified. This division of labor keeps your workflow reliable: use PhantomBuster to extract data and trigger outreach, and keep <a href=\"https:\/\/phantombuster.com\/blog\/ai-automation\/ai-lead-scoring-how-to-prioritize-prospects-automatically-using-phantombuster-data-and-ai\/\">ICP scoring<\/a> and gating in your system.<\/p>\n<h3>Step 5: Trigger outreach and write to the CRM<\/h3>\n<p>If the lead passes your threshold, n8n launches a PhantomBuster LinkedIn outreach Automation\u2014LinkedIn Auto Connect or LinkedIn Message Sender\u2014using the Claude-drafted message as input. In parallel, n8n writes the enriched lead into HubSpot or Salesforce. Include:<\/p>\n<ul>\n<li>Profile data from the PhantomBuster output.<\/li>\n<li>ICP score and decision metadata from the LLM.<\/li>\n<li>Outreach status and the workflow run ID.<\/li>\n<li>Timestamp.<\/li>\n<\/ul>\n<p>This closes the loop: Signal, enrich, score, act, record.<\/p>\n<h3>Production notes for this workflow<\/h3>\n<p>Use n8n error handling to catch API failures and retry with backoff. Store API keys and session cookies in a secure secret store, not in node parameters. Watch for session friction\u2014forced re-authentications, repeated disconnections, or unexpected login checkpoints.<\/p>\n<p>Treat that as a signal to pause, review cadence, and confirm your workflow still matches normal account behavior.<\/p>\n<blockquote><p>&#8220;Session friction is often an early warning, not an automatic ban.&#8221; \u2014 PhantomBuster Product Expert, <a href=\"https:\/\/www.linkedin.com\/in\/brianejmoran\/\" target=\"_blank\" rel=\"noopener\">Brian Moran<\/a><\/p><\/blockquote>\n<h2>Production constraints and operational guidance<\/h2>\n<h3>Rate limits and retry logic<\/h3>\n<p>PhantomBuster&#8217;s API enforces rate limits. Read the limit headers and back off accordingly (for example, respect X-RateLimit-Remaining\/Reset).\u00a0Avoid hardcoding assumptions like &#8220;10 calls\/60s.&#8221;<\/p>\n<p>Queue requests and retry with backoff. Use jitter and align retries with X-RateLimit-Reset.\u00a0A simple pattern looks like this, as a fallback only when headers are absent:<\/p>\n<ul>\n<li><strong>First retry:<\/strong> Wait 5 seconds<\/li>\n<li><strong>Second retry:<\/strong> Wait 15 seconds<\/li>\n<li><strong>Third retry:<\/strong> Wait 45 seconds<\/li>\n<li><strong>After three failures:<\/strong> Surface the error to monitoring and stop retrying automatically<\/li>\n<\/ul>\n<p>Rate limits protect both your account activity and platform capacity. Build these guardrails early, not after you hit production issues.<\/p>\n<h3>How to prevent duplicate execution and retry storms<\/h3>\n<p>If your orchestrator retries on timeout, you can accidentally launch the same\u00a0PhantomBuster Automation twice. That creates duplicate data, wastes slots, and can create avoidable platform friction.<\/p>\n<p>Make the workflow idempotent. Persist a run key per trigger event, store the container ID, then treat retries as &#8220;resume tracking,&#8221; not &#8220;launch again.&#8221; Before launching a new run, check whether you already have an active container for that run key. If you do, fetch status and continue from there.<\/p>\n<h3>LinkedIn platform constraints your agent must respect<\/h3>\n<p>Streaming does not change LinkedIn&#8217;s UI display caps. As of July 2026, many accounts see approximately 1,000 results in standard search, approximately 2,500 in Sales Navigator, and approximately 10,000 for company follower exports.<\/p>\n<p>Your caps may differ\u2014verify in your account.\u00a0Outreach also has practical account-level limits that vary by account age, history, and current trust signals. Instead of designing around a single &#8220;safe number,&#8221; design around steady cadence and consistent behavior.<\/p>\n<blockquote><p>&#8220;Consistency matters more than hitting a specific number.&#8221; \u2014 PhantomBuster Product Expert, <a href=\"https:\/\/www.linkedin.com\/in\/brianejmoran\/\" target=\"_blank\" rel=\"noopener\">Brian Moran<\/a><\/p><\/blockquote>\n<p>Faster orchestration does not justify higher cadence. Your system should enforce pacing explicitly.<\/p>\n<h3>How to avoid slide and spike behavior<\/h3>\n<p>If an account is idle for a while and then suddenly runs a burst of actions, the pattern can look unnatural. This is called &#8220;slide and spike,&#8221; low or irregular activity followed by a sharp jump.<\/p>\n<p>Aim for a consistent daily cadence; if reactivating a dormant account, ramp over 1 to 2 weeks rather than doubling volume overnight. If you have been inactive for weeks, start with a small daily baseline, then increase over time while you monitor session stability and response rates.<\/p>\n<h3>Session management and authentication<\/h3>\n<p>Many LinkedIn automations require a session cookie. If the session expires mid-run, the job fails. Monitor session errors and route them to your monitoring layer. If you see repeated authentication prompts or disconnections, pause automation and review your recent cadence and workflow sequencing.<\/p>\n<h3>Slot consumption and capacity planning<\/h3>\n<p>Each\u00a0PhantomBuster Automation run consumes execution capacity\u00a0(&#8220;slots&#8221;). Check your plan&#8217;s slot allocation and per-automation slot usage in the docs, and design concurrency to stay within limits.<\/p>\n<p>Plan for concurrency. If you have 10 slots and you run 3 workflows that consume 2 slots each, you have 4 slots remaining. If your system launches more work than you have slots, jobs queue until capacity frees up. Design around that constraint.<\/p>\n<h2>Where PhantomBuster fits vs other builder stacks<\/h2>\n<h3>Comparison: PhantomBuster vs general data extraction platforms (Apify, Bright Data)<\/h3>\n<p>General data extraction platforms give you infrastructure to run headless browsers, manage proxies, and handle anti-automation defenses. You still have to implement LinkedIn-specific logic yourself.<\/p>\n<p>With general extraction platforms you own selectors, pagination, auth, and pacing. PhantomBuster ships LinkedIn-ready Automations so you can focus on ICP and outreach rules.<\/p>\n<p>PhantomBuster\u00a0provides pre-built LinkedIn and B2B Automations (such as Sales Navigator Search Export, LinkedIn Profile Export, LinkedIn Auto Connect, Message Sender, and watcher Automations) you can compose via API. If your goal is a GTM workflow, that reduces build time and maintenance load. For a deeper look at how these platforms compare, see <a href=\"https:\/\/phantombuster.com\/blog\/tools\/phantombuster-vs-apify\/\">PhantomBuster vs Apify<\/a>.<\/p>\n<h3>Comparison: PhantomBuster vs enrichment tools\u00a0(Clay, Apollo)<\/h3>\n<p>Some enrichment tools focus on enrichment workflows inside their product UI and do not expose a clean path for real-time, programmatic orchestration in the same way. Depending on the tool, you can end up exporting batches rather than composing your own end-to-end pipeline.<\/p>\n<p>Apollo provides enrichment and contact data, but it does not cover LinkedIn extraction or LinkedIn-native outreach automation. You can enrich a list there, but you cannot collect LinkedIn post engagers or run LinkedIn connection sequences through it. Because the same REST\/Streaming API covers extraction and outreach, you can centralize orchestration, logging, and gating in your own system.<\/p>\n<p>PhantomBuster&#8217;s API, including streaming, gives you programmatic access to extraction and outreach building blocks so you can compose your own pipeline and keep the decision logic in your system.<\/p>\n<h3>Comparison: PhantomBuster vs outbound tools without a public API (Waalaxy, Dripify)<\/h3>\n<p>Some LinkedIn automation tools do not offer a public API. They work as campaign tools inside their own UI, which limits how much you can integrate into a custom orchestration or agent architecture.<\/p>\n<p>If you want a system that detects signals, enriches with an LLM, writes to your CRM, and <a href=\"https:\/\/phantombuster.com\/blog\/ai-automation\/ai-triggered-outreach\/\">triggers outreach only when criteria are met<\/a>, you typically need an API surface you can control.<\/p>\n<p>Because the same REST\/Streaming API covers extraction and outreach, you can centralize orchestration, logging, and gating in your own system. For a detailed breakdown of how PhantomBuster compares on workflow flexibility, see <a href=\"https:\/\/phantombuster.com\/blog\/tools\/phantombuster-vs-dripify-workflow-flexibility\/\">PhantomBuster vs Dripify<\/a>.<\/p>\n<h3>Cases where PhantomBuster is not the right fit<\/h3>\n<p>If you need broad coverage outside LinkedIn and Sales Navigator\u2014for example custom websites or niche platforms\u2014a general extraction platform may fit better. If your goal is fully autonomous outbound with no human oversight, that is not a safe target design on LinkedIn.<\/p>\n<p>Responsible prospecting still needs human judgment, clear targeting rules, and review points before you trigger irreversible actions.<\/p>\n<h2>How the PhantomBuster MCP server proves the pattern<\/h2>\n<h3>What the PhantomBuster MCP server enables<\/h3>\n<p>If you use agent frameworks (LangChain, AutoGen, Claude Desktop), the optional PhantomBuster MCP (Model Context Protocol) server maps the same REST\/Streaming API into tool calls\u2014no duplicate logic.<\/p>\n<p>That means the LLM can launch automations, check status, and retrieve output without you hand-writing HTTP requests for every step. In practice, a tool call flow can look like this:<\/p>\n<ul>\n<li>Launch a Sales Navigator Search Export run.<\/li>\n<li>Track the container status.<\/li>\n<li>Fetch output.<\/li>\n<li>Return results in context for filtering and scoring.<\/li>\n<\/ul>\n<h3>What this means for your architecture<\/h3>\n<p>You can use the MCP server as a reference implementation, or build directly against the REST API and streaming endpoints. Either way, the integration pattern stays the same: launch work, stream or track output, then make decisions in your system.<\/p>\n<p>If you&#8217;re designing for production, focus on the parts that usually break first: Idempotency, status tracking, rate limits, and gating side effects like outreach and CRM writes.<\/p>\n<h2>Conclusion<\/h2>\n<p>PhantomBuster&#8217;s Streaming API makes agent-style orchestration easier to build and easier to operate. The key decision is sync vs async for each step, based on whether something is actively waiting for a result.<\/p>\n<p>Streaming improves latency and workflow cleanliness. It does not change LinkedIn constraints or remove the need for pacing, gradual ramp-up, and human oversight.<\/p>\n<p>If you want to test this pattern, start with one small sync step\u2014for example a short profile lookup and scoring loop\u2014then move larger exports into async runs with container tracking and idempotent retries. <a href=\"https:\/\/phantombuster.com\/signup\" target=\"_blank\" rel=\"noopener\">Start your free trial<\/a><\/p>\n<h2>Frequently asked questions<\/h2>\n<h3>What is the PhantomBuster Streaming API, and what is the difference between Track mode and raw streaming?<\/h3>\n<p>The Streaming API lets your system observe a run in progress instead of waiting for a finished export. Track mode returns structured status and recent console lines per request, which is a good fit for orchestrators.<\/p>\n<p>Raw streaming keeps one HTTP response open and streams console output chunks, which is a good fit for real-time clients and some agent tool call patterns.<\/p>\n<h3>How do you choose sync execution vs async jobs inside one workflow?<\/h3>\n<p>Use sync when another system is waiting for the result, use async when the work belongs in the background. Small lookups and enrichment steps usually fit sync. Large exports, monitoring runs, and long list builds usually fit async, with your system consuming the output artifact later.<\/p>\n<h3>Can an LLM consume partial streamed output and decide before the run finishes?<\/h3>\n<p>Yes, but gate side effects. Use partial output for early filtering, deduplication, and scoring. Trigger outreach and CRM writes only after explicit checks\u2014required fields present, no duplicates, and eligibility rules met\u2014so you avoid inconsistent actions.<\/p>\n<h3>How do you integrate streaming into n8n, Make, Zapier, or a custom backend without messy polling?<\/h3>\n<p>Launch once, persist the container ID, then track only as long as something is waiting. For short tasks, keep the workflow synchronous and parse output immediately. For long tasks, store the container ID, schedule lightweight status checks, then fetch output and continue asynchronously.<\/p>\n<h3>How do you prevent duplicate execution when an orchestrator retries or times out?<\/h3>\n<p>Make retries resume tracking, not relaunch work. Persist a workflow run key, store the container ID, check status before launching again, and treat &#8220;launch&#8221; as a one-time operation per trigger event.<\/p>\n<h3>Does faster orchestration reduce LinkedIn risk or allow higher-cadence outreach?<\/h3>\n<p>No, streaming changes latency, not enforcement risk. Risk depends on behavior patterns, especially sudden bursts, repetition, and inconsistent activity. Use steady pacing, gradual ramp-up, and review points so real-time control does not turn into bursty action density.<\/p>\n<h3>If LinkedIn actions fail or results look incomplete, is that throttling?<\/h3>\n<p>Often it falls into one of three buckets: caps, enforcement, or execution failure. Check for commercial caps and display limits, confirm the action works manually, then look for session friction signals like forced re-auth or repeated disconnections. Also consider UI surface variance, since what LinkedIn shows can vary by account and context.<\/p>\n<h3>Does PhantomBuster support webhooks for job completion, or only polling and streaming?<\/h3>\n<p>PhantomBuster supports webhooks for job completion events. You can configure a webhook URL in your Automation settings to receive notifications when runs finish, which eliminates the need for polling in many async workflows.<\/p>\n<p>This works well for long-running jobs where you want to trigger downstream actions only after completion.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Build real-time prospecting with PhantomBuster API AI agent: learn streaming vs async, n8n example, rate limits, idempotency, and LinkedIn-safe pacing.&#8221;<\/p>\n","protected":false},"author":4,"featured_media":13203,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[30],"tags":[59,34],"class_list":["post-11418","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-automation","tag-ai-automation","tag-automation"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PhantomBuster Streaming API: Build Real-Time AI Prospecting Agents - PhantomBuster Blog<\/title>\n<meta name=\"description\" content=\"Build real-time prospecting with PhantomBuster API AI agent: learn streaming vs async, n8n example, rate limits, idempotency, and LinkedIn-safe pacing.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PhantomBuster Streaming API: Build Real-Time AI Prospecting Agents - PhantomBuster Blog\" \/>\n<meta property=\"og:description\" content=\"Build real-time prospecting with PhantomBuster API AI agent: learn streaming vs async, n8n example, rate limits, idempotency, and LinkedIn-safe pacing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/\" \/>\n<meta property=\"og:site_name\" content=\"PhantomBuster Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-21T12:17:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/phantombuster.com\/blog\/wp-content\/uploads\/2026\/07\/PhantomBuster-Streaming-API-Build-Real-Time-AI-Prospecting-Agents.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1264\" \/>\n\t<meta property=\"og:image:height\" content=\"848\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"John Mears\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Mears\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/ai-automation\\\/phantombuster-api-ai-agent-3\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/ai-automation\\\/phantombuster-api-ai-agent-3\\\/\"},\"author\":{\"name\":\"John Mears\",\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/#\\\/schema\\\/person\\\/ff4cb44d5ea884ebf590520a233baf8d\"},\"headline\":\"PhantomBuster Streaming API: Build Real-Time AI Prospecting Agents\",\"datePublished\":\"2026-07-21T12:17:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/ai-automation\\\/phantombuster-api-ai-agent-3\\\/\"},\"wordCount\":3677,\"image\":{\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/ai-automation\\\/phantombuster-api-ai-agent-3\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/PhantomBuster-Streaming-API-Build-Real-Time-AI-Prospecting-Agents.png\",\"keywords\":[\"AI automation\",\"automation\"],\"articleSection\":[\"AI Automation\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/ai-automation\\\/phantombuster-api-ai-agent-3\\\/\",\"url\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/ai-automation\\\/phantombuster-api-ai-agent-3\\\/\",\"name\":\"PhantomBuster Streaming API: Build Real-Time AI Prospecting Agents - PhantomBuster Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/ai-automation\\\/phantombuster-api-ai-agent-3\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/ai-automation\\\/phantombuster-api-ai-agent-3\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/PhantomBuster-Streaming-API-Build-Real-Time-AI-Prospecting-Agents.png\",\"datePublished\":\"2026-07-21T12:17:17+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/#\\\/schema\\\/person\\\/ff4cb44d5ea884ebf590520a233baf8d\"},\"description\":\"Build real-time prospecting with PhantomBuster API AI agent: learn streaming vs async, n8n example, rate limits, idempotency, and LinkedIn-safe pacing.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/ai-automation\\\/phantombuster-api-ai-agent-3\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/phantombuster.com\\\/blog\\\/ai-automation\\\/phantombuster-api-ai-agent-3\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/ai-automation\\\/phantombuster-api-ai-agent-3\\\/#primaryimage\",\"url\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/PhantomBuster-Streaming-API-Build-Real-Time-AI-Prospecting-Agents.png\",\"contentUrl\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/PhantomBuster-Streaming-API-Build-Real-Time-AI-Prospecting-Agents.png\",\"width\":1264,\"height\":848,\"caption\":\"Two rounded-rectangle chips on a blush pink gradient background; left chip says \\\"Tool review\\\" and right chip says \\\"Build PhantomBuster Streaming API\\\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/ai-automation\\\/phantombuster-api-ai-agent-3\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI Automation\",\"item\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/category\\\/ai-automation\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PhantomBuster Streaming API: Build Real-Time AI Prospecting Agents\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/\",\"name\":\"PhantomBuster Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/#\\\/schema\\\/person\\\/ff4cb44d5ea884ebf590520a233baf8d\",\"name\":\"John Mears\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/cropped-johnmaers-wp-96x96.webp\",\"url\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/cropped-johnmaers-wp-96x96.webp\",\"contentUrl\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/cropped-johnmaers-wp-96x96.webp\",\"caption\":\"John Mears\"},\"url\":\"https:\\\/\\\/phantombuster.com\\\/blog\\\/author\\\/john-mears\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PhantomBuster Streaming API: Build Real-Time AI Prospecting Agents - PhantomBuster Blog","description":"Build real-time prospecting with PhantomBuster API AI agent: learn streaming vs async, n8n example, rate limits, idempotency, and LinkedIn-safe pacing.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/","og_locale":"en_US","og_type":"article","og_title":"PhantomBuster Streaming API: Build Real-Time AI Prospecting Agents - PhantomBuster Blog","og_description":"Build real-time prospecting with PhantomBuster API AI agent: learn streaming vs async, n8n example, rate limits, idempotency, and LinkedIn-safe pacing.","og_url":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/","og_site_name":"PhantomBuster Blog","article_published_time":"2026-07-21T12:17:17+00:00","og_image":[{"width":1264,"height":848,"url":"https:\/\/phantombuster.com\/blog\/wp-content\/uploads\/2026\/07\/PhantomBuster-Streaming-API-Build-Real-Time-AI-Prospecting-Agents.png","type":"image\/png"}],"author":"John Mears","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Mears","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/#article","isPartOf":{"@id":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/"},"author":{"name":"John Mears","@id":"https:\/\/phantombuster.com\/blog\/#\/schema\/person\/ff4cb44d5ea884ebf590520a233baf8d"},"headline":"PhantomBuster Streaming API: Build Real-Time AI Prospecting Agents","datePublished":"2026-07-21T12:17:17+00:00","mainEntityOfPage":{"@id":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/"},"wordCount":3677,"image":{"@id":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/#primaryimage"},"thumbnailUrl":"https:\/\/phantombuster.com\/blog\/wp-content\/uploads\/2026\/07\/PhantomBuster-Streaming-API-Build-Real-Time-AI-Prospecting-Agents.png","keywords":["AI automation","automation"],"articleSection":["AI Automation"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/","url":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/","name":"PhantomBuster Streaming API: Build Real-Time AI Prospecting Agents - PhantomBuster Blog","isPartOf":{"@id":"https:\/\/phantombuster.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/#primaryimage"},"image":{"@id":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/#primaryimage"},"thumbnailUrl":"https:\/\/phantombuster.com\/blog\/wp-content\/uploads\/2026\/07\/PhantomBuster-Streaming-API-Build-Real-Time-AI-Prospecting-Agents.png","datePublished":"2026-07-21T12:17:17+00:00","author":{"@id":"https:\/\/phantombuster.com\/blog\/#\/schema\/person\/ff4cb44d5ea884ebf590520a233baf8d"},"description":"Build real-time prospecting with PhantomBuster API AI agent: learn streaming vs async, n8n example, rate limits, idempotency, and LinkedIn-safe pacing.","breadcrumb":{"@id":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/#primaryimage","url":"https:\/\/phantombuster.com\/blog\/wp-content\/uploads\/2026\/07\/PhantomBuster-Streaming-API-Build-Real-Time-AI-Prospecting-Agents.png","contentUrl":"https:\/\/phantombuster.com\/blog\/wp-content\/uploads\/2026\/07\/PhantomBuster-Streaming-API-Build-Real-Time-AI-Prospecting-Agents.png","width":1264,"height":848,"caption":"Two rounded-rectangle chips on a blush pink gradient background; left chip says \"Tool review\" and right chip says \"Build PhantomBuster Streaming API\""},{"@type":"BreadcrumbList","@id":"https:\/\/phantombuster.com\/blog\/ai-automation\/phantombuster-api-ai-agent-3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/phantombuster.com\/blog\/"},{"@type":"ListItem","position":2,"name":"AI Automation","item":"https:\/\/phantombuster.com\/blog\/category\/ai-automation\/"},{"@type":"ListItem","position":3,"name":"PhantomBuster Streaming API: Build Real-Time AI Prospecting Agents"}]},{"@type":"WebSite","@id":"https:\/\/phantombuster.com\/blog\/#website","url":"https:\/\/phantombuster.com\/blog\/","name":"PhantomBuster Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/phantombuster.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/phantombuster.com\/blog\/#\/schema\/person\/ff4cb44d5ea884ebf590520a233baf8d","name":"John Mears","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/phantombuster.com\/blog\/wp-content\/uploads\/2025\/05\/cropped-johnmaers-wp-96x96.webp","url":"https:\/\/phantombuster.com\/blog\/wp-content\/uploads\/2025\/05\/cropped-johnmaers-wp-96x96.webp","contentUrl":"https:\/\/phantombuster.com\/blog\/wp-content\/uploads\/2025\/05\/cropped-johnmaers-wp-96x96.webp","caption":"John Mears"},"url":"https:\/\/phantombuster.com\/blog\/author\/john-mears\/"}]}},"_links":{"self":[{"href":"https:\/\/phantombuster.com\/blog\/wp-json\/wp\/v2\/posts\/11418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phantombuster.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phantombuster.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phantombuster.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/phantombuster.com\/blog\/wp-json\/wp\/v2\/comments?post=11418"}],"version-history":[{"count":9,"href":"https:\/\/phantombuster.com\/blog\/wp-json\/wp\/v2\/posts\/11418\/revisions"}],"predecessor-version":[{"id":13204,"href":"https:\/\/phantombuster.com\/blog\/wp-json\/wp\/v2\/posts\/11418\/revisions\/13204"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/phantombuster.com\/blog\/wp-json\/wp\/v2\/media\/13203"}],"wp:attachment":[{"href":"https:\/\/phantombuster.com\/blog\/wp-json\/wp\/v2\/media?parent=11418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phantombuster.com\/blog\/wp-json\/wp\/v2\/categories?post=11418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phantombuster.com\/blog\/wp-json\/wp\/v2\/tags?post=11418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}