Chapter 01 · Migrate To Parallel
Subchapter 1.4
references/parallel-products.mdMarkdown9 KBView on GitHub
Verified against the official Parallel OpenAPI and product docs on 2026-07-14. Use this reference only when Search excerpts do not preserve the old behavior.
Use Extract for known URLs when the application needs focused excerpts or page bodies.
POST https://api.parallel.ai/v1/extractx-api-key: $PARALLEL_API_KEYparallel-web exposes client.extract(...) in Python and TypeScript.urls is required and accepts up to 20 URLs. objective, search_queries, max_chars_total, session_id, client_model, and advanced_settings are optional.advanced_settings.full_content to true or to {max_chars_per_result: ...}. Full content is off by default.results, errors, and session_id are required arrays/fields. Each successful result has url, excerpts, optional title, optional publish_date, and optional full_content.Example:
extract = client.extract(
urls=selected_urls,
objective=objective,
search_queries=search_queries,
session_id=search_response.session_id,
advanced_settings={"full_content": {"max_chars_per_result": 20_000}},
)Treat an HTTP 200 as a possibly partial success. A requested URL can appear in errors instead of results. Do not zip the returned results to the input list or assume result order. Reconcile unique URLs explicitly, preserve per-URL errors, and test mixed success. If duplicate input URLs are meaningful to the caller, preserve an application-owned request identifier because URL alone is ambiguous.
full_content and excerpts are markdown. If the old application promised plain text, convert at the application boundary and test the conversion. Preserve old timeout and content-size limits deliberately; legacy-provider numeric settings do not transfer one for one.
Use Chat for an interactive grounded completion when the old path returned an answer rather than only sources.
POST https://api.parallel.ai/chat/completionsAuthorization: Bearer $PARALLEL_API_KEYopenai package with base_url/baseURL set to https://api.parallel.ai. This is not a parallel-web client method.speed is the low-latency option; lite, base, and core are research models with research-basis support.response_format are supported. Several OpenAI-compatible controls, including token limits, top_p, and stop, are documented as ignored.Example:
from openai import OpenAI
chat = OpenAI(api_key=parallel_key, base_url="https://api.parallel.ai")
response = chat.chat.completions.create(
model="speed",
messages=[{"role": "user", "content": question}],
stream=False,
)Preserve whether the old contract streamed, returned JSON, exposed citations, or accepted conversation history. Do not copy unsupported generation controls and assume they still work. For research models, preserve the Parallel-specific basis data when the application exposed citations or provenance.
Use Task for multi-step research, structured synthesis, or deep provider modes whose consumed output is not a ranked page list.
POST https://api.parallel.ai/v1/tasks/runs with x-api-key auth, or client.task_run.create(...) / client.taskRun.create(...) from parallel-web.Do not replace an old synchronous handler with an unbounded blocking call. Choose polling, webhook, or SSE based on the existing caller contract. Bound polling, handle failed and cancelled terminal states, and make retries idempotent where the surrounding application requires it.
include_raw_content or Extract raw_content maps to Parallel Extract with full content enabled, not to Search excerpts unless snippets satisfy the caller contract.contents.text, standalone Contents, or combined deprecated context maps to Search excerpts only when snippets suffice; otherwise use Extract.include_answer, Exa Answer, and other interactive synthesis can map to Chat or the application’s existing model.search_results, media, and structured output rather than treating OpenAI-compatible request shapes as behavioral equivalence.web_search maps to Search, fetch_url to Extract, and people_search to Entity Search or an explicitly chosen discovery workflow such as FindAll or Task. Perplexity Search API calls with search_type="people" need the same explicit entity route rather than ordinary web Search. Hosted Agent tools cannot be redirected; expose these routes through application-executed custom functions or move the tool loop to another orchestrator.finance_search can use Parallel’s general index: Search for source results, Chat for an interactive financial answer, or Task for multi-step or schema-shaped research. If the caller consumes raw finance_results, add an application-owned normalizer and verify the required market-data coverage and freshness instead of treating the final answer as the same contract.web results generally map to Search. Preserve source-group behavior, query semantics, filters, and any attached scrapeOptions content deliberately.strictConstrainToURLs=True does not map to a Task domain allow-list. Use Extract plus an application-owned model/parser when exact known-URL retrieval satisfies the contract; otherwise retain or block until broader source scope is approved. Task has no direct Firecrawl maxCredits equivalent, and spark-1-* names do not determine a Parallel processor.