### Install OpenClaw and ClawHub CLI Source: https://docs.parallel.ai/integrations/clawhub Installs OpenClaw locally and starts the gateway and dashboard. Also installs the ClawHub CLI. ```bash # Install OpenClaw (recommended: run locally for security) npm install -g openclaw@latest openclaw gateway --port 18789 --bind loopback openclaw dashboard # start the chat interface # Install ClawHub CLI npm install -g clawhub ``` -------------------------------- ### Task API Setup Source: https://docs.parallel.ai/ Instructions for installing the Parallel SDK and setting up the API key. ```bash pip install "parallel-web>=0.5.0" # Python SDK — package is "parallel-web", import as `from parallel import Parallel` # or: npm install parallel-web # TypeScript SDK # Treat PARALLEL_API_KEY like a password — load from .env or a secrets manager, don't commit it. export PARALLEL_API_KEY="your-api-key" ``` -------------------------------- ### Python Setup for Parallel Extract API Source: https://docs.parallel.ai/ Install the Python SDK and set your API key as an environment variable. This example demonstrates how to initialize the client and use the extract method. ```bash pip install "parallel-web>=0.5.0" export PARALLEL_API_KEY="your-api-key" ``` -------------------------------- ### Setup Parallel Monitor API (Python) Source: https://docs.parallel.ai/getting-started/overview Install the Python SDK and set your API key. The Monitor API is in alpha and requires using the low-level client.post() method. ```bash pip install "parallel-web>=0.5.0" # Python SDK — package is "parallel-web", import as `from parallel import Parallel` # or: npm install parallel-web # TypeScript SDK # Treat PARALLEL_API_KEY like a password — load from .env or a secrets manager, don't commit it. export PARALLEL_API_KEY="your-api-key" ``` ```python from httpx import Response from parallel import Parallel client = Parallel() # reads PARALLEL_API_KEY from env # Monitor is alpha — the Python SDK uses the low-level client.post(). # High-level client.monitors.* methods are not yet available. # frequency: "1h" to "30d" (e.g. "1h", "6h", "1d", "1w", "30d"). # Don't bake dates into the query — Monitor tracks new updates automatically. res = client.post( "/v1alpha/monitors", cast_to=Response, body={ "query": "Notable news, funding, product launches, or regulatory events about OpenAI and Anthropic.", ``` -------------------------------- ### Parallel Search API Python SDK Setup and Example Source: https://docs.parallel.ai/ This snippet shows how to install the Parallel Search Python SDK, set up the API key, and perform a search query with an objective and specific search queries. ```APIDOC ## Parallel Search API - Python SDK ### Description Use the Parallel Search API to get LLM-optimized excerpts from web searches. It takes a natural-language objective and keyword queries to ground model responses. ### Setup 1. **Install SDK:** ```bash pip install "parallel-web>=0.5.0" ``` 2. **Set API Key:** The `PARALLEL_API_KEY` environment variable must be set. Treat it like a password and do not commit it. ```bash export PARALLEL_API_KEY="your-api-key" ``` ### Usage Example (Python) This example demonstrates how to initialize the client and perform a search. Both `objective` and `search_queries` are required. - `objective`: A natural-language research goal. - `search_queries`: 2-3 diverse keyword queries (3-6 words each). Optional parameters like `mode`, `max_results`, and `max_chars_total` can be tuned on the handler side. ```python from parallel import Parallel client = Parallel() # Reads PARALLEL_API_KEY from environment search = client.search( objective="Find recent benchmarks and cost comparisons between major vector databases (pgvector, Pinecone, Weaviate, Qdrant).", search_queries=[ "pgvector Pinecone benchmark 2025", "vector database cost comparison", "Weaviate Qdrant performance review", ], ) for result in search.results: print(f"{result.title}: {result.url}") for excerpt in result.excerpts: print(excerpt[:200]) ``` ### Modes - **advanced** (default): Slower, highest quality. Suitable for background agents and complex queries. - **basic**: Lower latency. Suitable for real-time or foreground agents. See [Parallel Search Modes](https://docs.parallel.ai/search/modes) and [Tool Definition](https://docs.parallel.ai/integrations/tool-definition) for more details. ``` -------------------------------- ### Install Python SDK and Set API Key Source: https://docs.parallel.ai/extract/extract-quickstart Install the parallel-web Python SDK and set your Parallel API key as an environment variable. This is a prerequisite for using the Python examples. ```bash pip install parallel-web export PARALLEL_API_KEY="PARALLEL_API_KEY" ``` -------------------------------- ### Install Ollama, Model, and SDKs Source: https://docs.parallel.ai/integrations/ollama-tool-calling Installs Ollama, pulls a tool-capable model, sets the Parallel API key, and installs necessary Python SDKs. ```bash ollama pull qwen3.5:0.8b pip install ollama parallel-web export PARALLEL_API_API_KEY="your-parallel-api-key" ``` -------------------------------- ### Install parallel-web-tools with all integrations Source: https://docs.parallel.ai/data-integrations/overview Install the Python package with all available integrations included. ```bash pip install parallel-web-tools[all] ``` -------------------------------- ### Install cURL and Set API Key Source: https://docs.parallel.ai/extract/extract-quickstart Install cURL and jq, then set your Parallel API key as an environment variable. This is a prerequisite for using the cURL examples. ```bash echo "Install curl and jq via brew, apt, or your favorite package manager" export PARALLEL_API_KEY="PARALLEL_API_KEY" ``` -------------------------------- ### Manual CLI Installation via Pipx Source: https://docs.parallel.ai/integrations/cursor-marketplace Installs the Parallel CLI using pipx and then logs in. Ensure pipx is installed. ```bash pipx install "parallel-web-tools[cli]" ``` ```bash parallel-cli login ``` -------------------------------- ### Install and Set Up Task API SDKs Source: https://docs.parallel.ai/task-api/task-quickstart Install the necessary SDKs and set your API key for authentication. Available for cURL, Python, and TypeScript. ```bash echo "Install curl and jq via brew, apt, or your favorite package manager" export PARALLEL_API_KEY="PARALLEL_API_KEY" ``` ```python pip install parallel-web export PARALLEL_API_KEY="PARALLEL_API_KEY" ``` ```typescript npm install parallel-web export PARALLEL_API_KEY="PARALLEL_API_KEY" ``` -------------------------------- ### Suggest Processor Example Response Source: https://docs.parallel.ai/task-api/ingest-api This is an example of the JSON response from the `/suggest-processor` endpoint, indicating the recommended processor. ```json { "recommended_processors": ["pro"] } ``` -------------------------------- ### Setup Parallel Plugin in Cursor Source: https://docs.parallel.ai/integrations/cursor-marketplace Verifies the CLI installation and authentication status after adding the plugin. ```bash /parallel-setup ``` -------------------------------- ### Install TypeScript SDK and Set API Key Source: https://docs.parallel.ai/extract/extract-quickstart Install the parallel-web npm package and set your Parallel API key as an environment variable. This is a prerequisite for using the TypeScript examples. ```bash npm install parallel-web export PARALLEL_API_KEY="PARALLEL_API_KEY" ``` -------------------------------- ### Manual CLI Installation via Curl Source: https://docs.parallel.ai/integrations/cursor-marketplace Manually installs the Parallel CLI using curl and then logs in. ```bash curl -fsSL https://parallel.ai/install.sh | bash ``` ```bash parallel-cli login ``` -------------------------------- ### Install SDKs and Set API Keys Source: https://docs.parallel.ai/integrations/anthropic-tool-calling Install the necessary SDKs for Anthropic and Parallel Search, and set your API keys as environment variables. This is required for both Python and TypeScript. ```bash pip install anthropic parallel-web export PARALLEL_API_KEY="your-parallel-api-key" export ANTHROPIC_API_KEY="your-anthropic-api-key" ``` ```bash npm install @anthropic-ai/sdk parallel-web export PARALLEL_API_KEY="your-parallel-api-key" export ANTHROPIC_API_KEY="your-anthropic-api-key" ``` -------------------------------- ### Install Parallel Web SDK (Python/TypeScript) Source: https://docs.parallel.ai/getting-started/overview Install the Parallel Web SDK for Python or TypeScript. Treat PARALLEL_API_KEY as a password and load it from environment variables or a secrets manager. ```bash pip install "parallel-web>=0.5.0" # Python SDK — package is "parallel-web", import as `from parallel import Parallel` ``` ```bash # or: npm install parallel-web # TypeScript SDK ``` ```bash # Treat PARALLEL_API_KEY like a password — load from .env or a secrets manager, don't commit it. ``` ```bash export PARALLEL_API_KEY="your-api-key" ``` -------------------------------- ### Install Parallel Web SDK (Python) Source: https://docs.parallel.ai/ Install the Parallel Web SDK for Python. This package provides the client for interacting with the Parallel Search API. ```bash pip install "parallel-web>=0.5.0" ``` -------------------------------- ### Install parallel-web-tools with specific integrations Source: https://docs.parallel.ai/data-integrations/overview Install the Python package with specific integration extras. For example, to use Polars, DuckDB, or Spark, install them with their respective extras. ```bash pip install parallel-web-tools[polars] pip install parallel-web-tools[duckdb] pip install parallel-web-tools[spark] ``` -------------------------------- ### Sample Task for Core-Fast Processor Source: https://docs.parallel.ai/task-api/guides/choose-a-processor This example shows how to use the 'core-fast' processor for rapid access to detailed company information, including founders and recent product launches. ```python task_run = client.task_run.create( input="Parallel Web Systems (parallel.ai)", task_spec={"output_schema":"The founding date, founders, and most recent product launch of the company"}, processor="core-fast" ) print(f"Run ID: {task_run.run_id}") run_result = client.task_run.result(task_run.run_id, api_timeout=3600) print(run_result.output) ``` -------------------------------- ### Install Claude Code Plugin Source: https://docs.parallel.ai/integrations/claude-code-marketplace Install the Parallel plugin from the Claude Code Plugin Marketplace using the provided commands. Run '/parallel:setup' to verify installation and authentication. ```bash /plugin marketplace add parallel-web/parallel-agent-skills /plugin install parallel ``` -------------------------------- ### Complete Example: Chat with Web Search Tool Source: https://docs.parallel.ai/integrations/openai-tool-calling This example shows a full implementation of a chat assistant that uses a web search tool. It includes defining the tool, handling tool calls, and making sequential API calls to OpenAI. ```typescript required: ["objective", "search_queries"], additionalProperties: false, }, strict: true, }; interface SearchArgs { objective?: string; search_queries?: string[]; } async function searchWeb(args: SearchArgs) { const response = await parallel.search({ objective: args.objective, search_queries: args.search_queries, }); return { results: response.results.map((r) => ({ url: r.url, title: r.title, excerpts: r.excerpts?.slice(0, 3) || [], })), }; } async function chatWithSearch(userMessage: string): Promise { const messages: OpenAI.ChatCompletionMessageParam[] = [ { role: "system", content: "You are a helpful research assistant. Use the search_web tool to find current information. Always cite sources with URLs.", }, { role: "user", content: userMessage }, ]; // First API call let response = await openai.chat.completions.create({ model: "gpt-5.5", messages, tools: [parallelSearchTool], tool_choice: "auto", }); let assistantMessage = response.choices[0].message; // Handle tool calls if (assistantMessage.tool_calls) { messages.push(assistantMessage); for (const toolCall of assistantMessage.tool_calls) { if (toolCall.function.name === "search_web") { const args = JSON.parse(toolCall.function.arguments) as SearchArgs; const result = await searchWeb(args); messages.push({ role: "tool", tool_call_id: toolCall.id, content: JSON.stringify(result), }); } } // Second API call with results response = await openai.chat.completions.create({ model: "gpt-5.5", messages, tools: [parallelSearchTool], tool_choice: "auto", }); } return response.choices[0].message.content; } // Example usage async function main() { const answer = await chatWithSearch("What are the latest developments in quantum computing?"); console.log(answer); } main().catch(console.error); ``` ``` -------------------------------- ### Install SDKs and Set API Keys Source: https://docs.parallel.ai/integrations/openai-tool-calling Install the necessary Python or TypeScript SDKs and set your Parallel and OpenAI API keys as environment variables. This is a prerequisite for using the tools. ```bash pip install openai parallel-web export PARALLEL_API_KEY="your-parallel-api-key" export OPENAI_API_KEY="your-openai-api-key" ``` ```bash npm install openai parallel-web export PARALLEL_API_KEY="your-parallel-api-key" export OPENAI_API_KEY="your-openai-api-key" ``` -------------------------------- ### GET /api Source: https://docs.parallel.ai/integrations/agentic-payments Provides the full API schema, documentation, and examples in JSON format. It is recommended to hit this endpoint first for detailed usage information. ```APIDOC ## GET /api ### Description Provides the full API schema, documentation, and examples in JSON format. It is recommended to hit this endpoint first for detailed usage information. ### Method GET ### Endpoint /api ### Response #### Success Response (200) - **schema** (object) - The full API schema. - **docs** (object) - Detailed documentation for the API. - **examples** (object) - Example requests and responses. ### Response Example ```json { "schema": { ... }, "docs": { ... }, "examples": { ... } } ``` ``` -------------------------------- ### V0 API FindAll Migration Example Source: https://docs.parallel.ai/findall-api/findall-migration-guide This Python script demonstrates the complete V0 API workflow for FindAll, including ingesting a query, creating a run with constraints and enrichments, polling for completion, and accessing results. ```python import requests import time API_KEY = "your_api_key" BASE_URL = "https://api.parallel.ai" # Step 1: Ingest query ingest_response = requests.post( f"{BASE_URL}/v1beta/findall/ingest", headers={"x-api-key": API_KEY}, json={"query": "Find AI companies that raised Series A in 2024 and get CEO names"} ) findall_spec = ingest_response.json() # Step 2: Create run (constraints + enrichments together) run_response = requests.post( f"{BASE_URL}/v1beta/findall/runs", headers={"x-api-key": API_KEY}, json={ "findall_spec": findall_spec, "processor": "core", "result_limit": 100 } ) findall_id = run_response.json()["findall_id"] # Step 3: Poll until both flags are false while True: poll_response = requests.get( f"{BASE_URL}/v1beta/findall/runs/{findall_id}", headers={"x-api-key": API_KEY} ) result = poll_response.json() if not result["is_active"] and not result["are_enrichments_active"]: break time.sleep(15) # Step 4: Access results from poll response for entity in result["results"]: print(f"{entity['name']}: Score {entity['score']}") # Loop through arrays to find values for filter_result in entity["filter_results"]: print(f" {filter_result['key']}: {filter_result['value']}") for enrichment in entity["enrichment_results"]: print(f" {enrichment['key']}: {enrichment['value']}") ``` -------------------------------- ### Suggest Processor Request Example (Python) Source: https://docs.parallel.ai/task-api/ingest-api This Python script demonstrates how to make a POST request to the suggest-processor endpoint using the requests library. Ensure you replace 'PARALLEL_API_KEY' with your actual API key. ```python import requests url = "https://api.parallel.ai/v1beta/tasks/suggest-processor" headers = { "x-api-key": "PARALLEL_API_KEY", "Content-Type": "application/json" } data = { "task_spec": { "input_schema": { "type": "object", "properties": { "company_name": { "type": "string" } } }, "output_schema": { "type": "object", "properties": { "ceo_name": { "type": "string" } } } }, "choose_processors_from": ["base", "core", "core2x", "pro", "ultra"] } response = requests.post(url, headers=headers, json=data) result = response.json() print(result) ``` -------------------------------- ### Create FindAll Run Source: https://docs.parallel.ai/public-openapi.json Starts a FindAll run. The endpoint returns a run object with status 'queued'. Track progress via GET /v1beta/findall/runs/{findall_id} or subscribe to events. ```python from parallelai.client import Parallel client = Parallel(api_key="YOUR_API_KEY") response = client.v1beta.findall.runs.create( objective="Find all portfolio companies of Khosla Ventures founded after 2020 and CEO names", ) print(response.json()) ``` -------------------------------- ### Create FindAll Run Source: https://docs.parallel.ai/api-reference/findall/create-findall-run Starts a FindAll run. This endpoint immediately returns a FindAll run object with status set to 'queued'. You can get the run result snapshot using the GET /v1beta/findall/runs/{findall_id}/result endpoint. You can track the progress of the run by polling the status using the GET /v1beta/findall/runs/{findall_id} endpoint, subscribing to real-time updates via the /v1beta/findall/runs/{findall_id}/events endpoint, or specifying a webhook with relevant event types during run creation to receive notifications. ```APIDOC ## POST /v1beta/findall/runs ### Description Starts a FindAll run. This endpoint immediately returns a FindAll run object with status set to 'queued'. You can get the run result snapshot using the GET /v1beta/findall/runs/{findall_id}/result endpoint. You can track the progress of the run by: - Polling the status using the GET /v1beta/findall/runs/{findall_id} endpoint, - Subscribing to real-time updates via the /v1beta/findall/runs/{findall_id}/events endpoint, - Or specifying a webhook with relevant event types during run creation to receive notifications. ### Method POST ### Endpoint /v1beta/findall/runs ### Parameters #### Header Parameters - **parallel-beta** (string) - Optional - Optional header to specify the beta version(s) to enable. ``` -------------------------------- ### Stream Task Group Events in TypeScript Source: https://docs.parallel.ai/api-reference/tasks/stream-task-group-events This TypeScript example demonstrates how to stream task group events asynchronously. It uses `async/await` and `for await...of` to process the event stream. Make sure the parallel-web package is installed. ```TypeScript import Parallel from "parallel-web"; const client = new Parallel(); const taskGroupEvents = await client.taskGroup.events( 'taskgroup_id', ); for await (const event of taskGroupEvents) { console.log(event); } ``` -------------------------------- ### View Available Commands with /help Source: https://docs.parallel.ai/monitor-api/monitor-slack Use the `/help` command to display a list of all available commands and their usage instructions within the Slack interface. ```bash /help ``` -------------------------------- ### TypeScript Streaming Chat Completion with JSON Schema Source: https://docs.parallel.ai/chat-api/chat-quickstart This TypeScript example demonstrates how to make a streaming chat completion request using the OpenAI SDK, configured for the Parallel API. It includes setting the API key, base URL, model, messages, and a JSON schema for the response format. Ensure you have the OpenAI Node.js library installed. ```typescript import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.PARALLEL_API_KEY, baseURL: "https://api.parallel.ai", // Parallel's API endpoint }); async function main() { const stream = await client.chat.completions.create({ model: "speed", // Parallel model name messages: [{ role: "user", content: "What does Parallel Web Systems do?" }], stream: true, response_format: { type: "json_schema", json_schema: { name: "reasoning_schema", schema: { type: "object", properties: { reasoning: { type: "string", description: "Think step by step to arrive at the answer", }, answer: { type: "string", description: "The direct answer to the question", }, citations: { type: "array", items: { type: "string" }, description: "Sources cited to support the answer", }, }, }, }, }, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content || ""); } process.stdout.write("\n"); } main(); ``` -------------------------------- ### Complete Workflow Example Source: https://docs.parallel.ai/task-api/group-api Demonstrates the full workflow of creating a task group, adding tasks, waiting for completion, and retrieving results using Pydantic models for input and output schemas. Requires setting the PARALLEL_API_KEY environment variable. ```Python import asyncio import pydantic from parallel import AsyncParallel from parallel.types import TaskSpecParam, JsonSchemaParam from parallel.types.beta.beta_run_input_param import BetaRunInputParam from parallel.types.beta.task_run_event import TaskRunEvent from parallel.types.beta.error_event import ErrorEvent # Define your input and output models class CompanyInput(pydantic.BaseModel): company_name: str = pydantic.Field(description="Name of the company") company_website: str = pydantic.Field(description="Company website URL") class CompanyOutput(pydantic.BaseModel): key_insights: list[str] = pydantic.Field(description="Key business insights") market_position: str = pydantic.Field(description="Market positioning analysis") # Create reusable task specification task_spec = TaskSpecParam( input_schema=JsonSchemaParam(json_schema=CompanyInput.model_json_schema()), output_schema=JsonSchemaParam(json_schema=CompanyOutput.model_json_schema()), ) async def wait_for_completion(client: AsyncParallel, taskgroup_id: str) -> None: while True: task_group = await client.beta.task_group.retrieve(taskgroup_id) status = task_group.status print(f"Status: {status.task_run_status_counts}") if not status.is_active: print("All tasks completed!") break await asyncio.sleep(10) async def get_all_results(client: AsyncParallel, taskgroup_id: str): results = [] run_stream = await client.beta.task_group.get_runs( taskgroup_id, include_input=True, include_output=True, ) async for event in run_stream: if isinstance(event, TaskRunEvent) and event.output: company_output = CompanyOutput.model_validate(event.output.content) results.append( { "company": event.input.input["company_name"], "insights": company_output.key_insights, "market_position": company_output.market_position, } ) elif isinstance(event, ErrorEvent): print(f"Error: {event.error}") return results async def batch_company_research(): client = AsyncParallel(api_key="PARALLEL_API_KEY") # Create task group task_group = await client.beta.task_group.create() taskgroup_id = task_group.task_group_id print(f"Created taskgroup id {taskgroup_id}") # Define companies to research companies = [ {"company_name": "Stripe", "company_website": "https://stripe.com"}, {"company_name": "Shopify", "company_website": "https://shopify.com"}, {"company_name": "Salesforce", "company_website": "https://salesforce.com"}, ] # Add Tasks to group run_inputs = [ BetaRunInputParam( input=CompanyInput(**company).model_dump(), processor="pro", ) for company in companies ] response = await client.beta.task_group.add_runs( taskgroup_id, inputs=run_inputs, default_task_spec=task_spec, ) print(f"Added {len(response.run_ids)} runs to taskgroup {taskgroup_id}") # Wait for completion and get results await wait_for_completion(client, taskgroup_id) results = await get_all_results(client, taskgroup_id) print(f"Successfully processed {len(results)} companies") return results # Run the batch job results = asyncio.run(batch_company_research()) ``` ```TypeScript import Parallel from "parallel-web"; // Define your input and output types interface CompanyInput { company_name: string; company_website: string; } interface CompanyOutput { key_insights: string[]; market_position: string; } // Use SDK types for Task Group API type TaskGroupObject = Parallel.Beta.TaskGroup; type TaskGroupGetRunsResponse = Parallel.Beta.TaskGroupGetRunsResponse; // Create reusable task specification using SDK types const taskSpec: Parallel.TaskSpec = { input_schema: { type: "json", json_schema: { type: "object", properties: { company_name: { type: "string", description: "Name of the company", }, company_website: { type: "string", description: "Company website URL", }, }, required: ["company_name", "company_website"], }, }, output_schema: { type: "json", json_schema: { type: "object", properties: { key_insights: { type: "array", ``` -------------------------------- ### Install Parallel CLI Source: https://docs.parallel.ai/integrations/agent-skills Install the Parallel CLI using the provided curl command. Refer to the CLI docs for alternative installation methods. ```bash curl -fsSL https://parallel.ai/install.sh | bash ``` -------------------------------- ### Install Parallel Web Tools for Spark Source: https://docs.parallel.ai/data-integrations/spark Install the necessary package for Spark integration. This command installs the core library with Spark dependencies. ```bash pip install parallel-web-tools[spark] ``` -------------------------------- ### V1 API FindAll Migration Example Source: https://docs.parallel.ai/findall-api/findall-migration-guide This Python script demonstrates the V1 API workflow for FindAll, showing how to ingest an objective, create a run with constraints, add enrichments separately, poll for completion, and fetch results from a dedicated endpoint. ```python import requests import time API_KEY = "your_api_key" BASE_URL = "https://api.parallel.ai" headers = { "x-api-key": API_KEY, "parallel-beta": "findall-2025-09-15" } # Step 1: Ingest objective ingest_response = requests.post( f"{BASE_URL}/v1beta/findall/ingest", headers=headers, json={"objective": "Find AI companies that raised Series A in 2024 and get CEO names"} ) ingest_data = ingest_response.json() # Step 2: Create run (constraints only, flattened) run_response = requests.post( f"{BASE_URL}/v1beta/findall/runs", headers=headers, json={ "objective": ingest_data["objective"], "entity_type": ingest_data["entity_type"], "match_conditions": ingest_data["match_conditions"], "generator": "core", "match_limit": 50 } ) findall_id = run_response.json()["findall_id"] # Step 3: Add enrichments (separate call) time.sleep(5) requests.post( f"{BASE_URL}/v1beta/findall/runs/{findall_id}/enrich", headers=headers, json={ "processor": "core", "output_schema": ingest_data.get("enrichments")[0] } ) # Step 4: Poll until completed while True: status_response = requests.get( f"{BASE_URL}/v1beta/findall/runs/{findall_id}", headers=headers ) if status_response.json()["status"]["status"] == "completed": break time.sleep(10) # Step 5: Fetch results from separate endpoint result_response = requests.get( f"{BASE_URL}/v1beta/findall/runs/{findall_id}/result", headers=headers ) result = result_response.json() # Step 6: Access results with direct object access for candidate in result["candidates"]: if candidate["match_status"] == "matched": print(f"{candidate['name']}: Score {candidate['relevance_score']}") # Direct access to all fields (constraints + enrichments merged) for field_name, field_data in candidate["output"].items(): print(f" {field_name}: {field_data['value']}") ``` -------------------------------- ### Create Monitor with Webhook Source: https://docs.parallel.ai/monitor-api/monitor-webhooks This example demonstrates how to create a new Monitor and configure a webhook to receive notifications for specific event types. ```APIDOC ## POST /v1/monitors ### Description Creates a new Monitor and configures its settings, including webhook notifications. ### Method POST ### Endpoint https://api.parallel.ai/v1/monitors ### Parameters #### Request Body - **type** (string) - Required - The type of monitor. - **frequency** (string) - Required - The frequency at which the monitor runs. - **processor** (string) - Required - The processor to use for the monitor. - **settings** (object) - Required - Settings for the monitor. - **query** (string) - Required - The query for the monitor. - **webhook** (object) - Optional - Webhook configuration. - **url** (string) - Required - Your webhook endpoint URL. - **event_types** (array[string]) - Required - Event types to subscribe to. - **metadata** (object) - Optional - User-provided metadata. ### Request Example ```json { "type": "event_stream", "frequency": "1d", "processor": "lite", "settings": { "query": "AI startup funding announcements" }, "webhook": { "url": "https://your-domain.com/webhooks/monitor", "event_types": [ "monitor.event.detected", "monitor.execution.completed", "monitor.execution.failed" ] }, "metadata": { "team": "research" } } ``` ``` -------------------------------- ### Install langchain-parallel Source: https://docs.parallel.ai/integrations/langchain Install the necessary package for LangChain integrations with Parallel. ```bash pip install langchain-parallel ``` -------------------------------- ### Create an Event Stream Monitor Source: https://docs.parallel.ai/monitor-api/monitor-quickstart This example shows how to create a monitor that tracks daily AI funding news and sends notifications to a specified webhook URL. The monitor is configured with a frequency of '1d', a 'lite' processor, and a specific query. It also includes metadata for external identification. ```APIDOC ## POST /v1/monitors ### Description Creates a new monitor to track web changes based on a defined query and frequency. Notifications can be sent via webhooks. ### Method POST ### Endpoint /v1/monitors ### Parameters #### Request Body - **type** (string) - Required - The type of monitor, e.g., "event_stream". - **frequency** (string) - Required - The schedule for running the monitor, e.g., "1d" for daily. - **processor** (string) - Required - The processing type, e.g., "lite". - **settings** (object) - Required - Configuration settings for the monitor. - **query** (string) - Required - The natural language query describing what to track. - **webhook** (object) - Required - Webhook configuration for notifications. - **url** (string) - Required - The URL to send notifications to. - **event_types** (array) - Required - A list of event types to trigger notifications for, e.g., ["monitor.event.detected"]. - **metadata** (object) - Optional - Additional metadata for the monitor. - **external_id** (string) - Optional - An external identifier for the monitor. ### Request Example ```json { "type": "event_stream", "frequency": "1d", "processor": "lite", "settings": { "query": "AI startup funding announcements" }, "webhook": { "url": "https://example.com/webhook", "event_types": ["monitor.event.detected"] }, "metadata": { "external_id": "acme-monitor-001" } } ``` ### Response #### Success Response (200) - **monitor_id** (string) - The unique identifier for the created monitor. - **type** (string) - The type of the monitor. - **status** (string) - The current status of the monitor (e.g., "active"). - **frequency** (string) - The configured frequency. - **processor** (string) - The configured processor. - **settings** (object) - The monitor's settings. - **webhook** (object) - The monitor's webhook configuration. - **metadata** (object) - The monitor's metadata. - **created_at** (string) - The timestamp when the monitor was created. #### Response Example ```json { "monitor_id": "monitor_b0079f70195e4258a3b982c1b6d8bd3a", "type": "event_stream", "status": "active", "frequency": "1d", "processor": "lite", "settings": { "query": "AI startup funding announcements" }, "webhook": { "url": "https://example.com/webhook", "event_types": ["monitor.event.detected"] }, "metadata": { "external_id": "acme-monitor-001" }, "created_at": "2025-04-23T20:21:48.037943Z" } ``` ``` -------------------------------- ### Sample Task for Ultra-Fast Processor Source: https://docs.parallel.ai/task-api/guides/choose-a-processor This example demonstrates using the 'ultra-fast' processor for rapid, comprehensive industry analysis, including growth factors and major competitors. ```python task_run = client.task_run.create( input="Parallel Web Systems (parallel.ai)", task_spec={"output_schema":"A comprehensive analysis of the industry of the company, including growth factors and major competitors."}, processor="ultra-fast" ) print(f"Run ID: {task_run.run_id}") run_result = client.task_run.result(task_run.run_id, api_timeout=3600) print(run_result.output) ``` -------------------------------- ### Install pi-mcp-adapter for Pi Source: https://docs.parallel.ai/integrations/mcp/search-mcp Install the pi-mcp-adapter package to enable MCP support in Pi. ```bash pi install npm:pi-mcp-adapter ``` -------------------------------- ### Add a Wallet with purl Source: https://docs.parallel.ai/integrations/agentic-payments Set up your wallet using the purl CLI. This is a prerequisite for making payments via x402. ```bash purl wallet add ``` -------------------------------- ### Install Parallel CLI with npm Source: https://docs.parallel.ai/integrations/cli Installs the Parallel CLI globally using npm. ```bash npm install -g parallel-web-cli ``` -------------------------------- ### Install Parallel CLI with Homebrew Source: https://docs.parallel.ai/integrations/cli Installs the Parallel CLI using the Homebrew package manager. ```bash brew install parallel-web/tap/parallel-cli ``` -------------------------------- ### Sample Task for Core Processor Source: https://docs.parallel.ai/task-api/guides/choose-a-processor Utilize the 'core' processor for tasks needing comprehensive data, including founding date, founders, and recent product launch. This snippet shows how to configure and run such a task. ```python task_run = client.task_run.create( input="Parallel Web Systems (parallel.ai)", task_spec={"output_schema":"The founding date, founders, and most recent product launch of the company"}, processor="core" ) print(f"Run ID: {task_run.run_id}") run_result = client.task_run.result(task_run.run_id, api_timeout=3600) print(run_result.output) ``` -------------------------------- ### Create a FindAll Preview Run Source: https://docs.parallel.ai/findall-api/features/findall-preview Use this endpoint to create a preview run for your FindAll query. This is useful for testing match conditions and refining your search logic before executing a full search. Ensure you have set the 'PARALLEL_API_KEY' environment variable. ```bash curl -X POST "https://api.parallel.ai/v1beta/findall/runs" \ -H "x-api-key: $PARALLEL_API_KEY" \ -H "parallel-beta: findall-2025-09-15" \ -H "Content-Type: application/json" \ -d '{ "objective": "FindAll portfolio companies of Khosla Ventures founded after 2020", "entity_type": "companies", "match_conditions": [ { "name": "khosla_ventures_portfolio_check", "description": "Company must be a portfolio company of Khosla Ventures." }, { "name": "founded_after_2020_check", "description": "Company must have been founded after 2020." } ], "generator": "preview", "match_limit": 10 }' ``` -------------------------------- ### Install Parallel Web Tools Source: https://docs.parallel.ai/data-integrations/bigquery Install the necessary Python package for the BigQuery integration. This is required for deploying the integration. ```bash pip install parallel-web-tools ``` -------------------------------- ### Create and Retrieve a Task Run Source: https://docs.parallel.ai/task-api/task-quickstart Demonstrates the core workflow of creating a task run with a specified input and task specification, then retrieving the result. This example uses Python and blocks until the task is complete. ```python from parallel import Parallel client = Parallel(api_key="PARALLEL_API_KEY") # 1. Create a task run task_run = client.task_run.create( input="Stripe", task_spec={"output_schema": "The founding year and total funding raised"}, processor="base" ) # 2-3. Retrieve the result (blocks until complete) run_result = client.task_run.result(task_run.run_id, api_timeout=3600) print(run_result.output) ``` -------------------------------- ### Sample Task for Ultra Processor Source: https://docs.parallel.ai/task-api/guides/choose-a-processor Use the 'ultra' processor for in-depth industry analysis, including growth factors and major competitors. This snippet shows how to set up and execute such a task. ```python task_run = client.task_run.create( input="Parallel Web Systems (parallel.ai)", task_spec={"output_schema":"A comprehensive analysis of the industry of the company, including growth factors and major competitors."}, processor="ultra" ) print(f"Run ID: {task_run.run_id}") run_result = client.task_run.result(task_run.run_id, api_timeout=3600) print(run_result.output) ``` -------------------------------- ### Candidate Generated Event Example Source: https://docs.parallel.ai/findall-api/features/findall-webhook Example payload for the `findall.candidate.generated` event, showing the structure of a newly generated candidate. ```APIDOC ## Candidate Events ### `findall.candidate.generated` ```json { "type": "findall.candidate.generated", "timestamp": "2025-10-27T14:56:05.619331Z", "data": { "candidate_id": "candidate_2edf2301-f80d-46b9-b17a-7b4a9d577296", "name": "Anthropic", "url": "https://www.anthropic.com/", "description": "Anthropic is an AI safety and research company founded in 2021...", "match_status": "generated", "output": null, "basis": null } } ``` ```