Skip to main content

module  pixeltable.functions.parallel

Pixeltable UDFs that wrap Parallel’s web search and extraction APIs. Without an API key, the UDFs call Parallel’s free MCP endpoint, which needs pip install mcp and serves searches in Fast mode under the service’s anonymous rate limits. Specify PARALLEL_API_KEY, or api_key in the parallel section of the Pixeltable config file, to call the Search and Extract REST APIs, which also accept the search and extraction settings the free endpoint does not.

udf  extract()

Signature
Extract relevant excerpts, or the whole text, from a web page. Equivalent to the Parallel Extract API endpoint. For additional details, see: https://docs.parallel.ai/extract/extract-quickstart Without an API key, the free endpoint returns excerpts or full content; fetch_policy and links then require one, and allow_live_fetch is the freshness setting it offers in place of fetch_policy. Request throttling: Applies the rate limit set in the config (section parallel, key rate_limit). If no rate limit is configured, uses a default of 600 RPM. Parameters:
  • url (pxt.String): An HTTP or HTTPS page URL.
  • objective (pxt.String | None): Information to extract, up to 200 characters. Omit for general page excerpts.
  • search_queries (pxt.Json[(String): Keyword queries of three to six words each, which focus the excerpts alongside objective; pass the queries of the search that produced url.
  • full_content (Any): Return the whole page as markdown instead of excerpts. A long page can run to tens of thousands of tokens. Defaults to the service’s setting, which returns excerpts.
  • fetch_policy (Any): How fresh the page contents have to be, as max_age_seconds, timeout_seconds and disable_cache_fallback. Defaults to the service’s setting, which decides from url and objective. Requires an API key.
  • links (Any): Also return the page’s outgoing links. Requires an API key.
  • allow_live_fetch (Any): Whether the free endpoint may read the page live rather than serve its cached copy. Defaults to the service’s setting of True. With an API key, use fetch_policy instead.
  • session_id (Any): Application-owned conversation ID; pass the ID used by the related searches.
Returns:
  • ParallelExtractResponse: A dictionary with the following entries:
    • extract_id (str): Parallel’s ID for this extraction, for support requests
    • results (list): one entry if the page was read, otherwise empty, with
      • url (str): the page URL
      • title (str | None): the page title
      • publish_date (str | None): the publication date, as YYYY-MM-DD
      • excerpts (list[str]): passages relevant to objective
      • full_content (str | None): the whole page as markdown, if full_content asked for it
      • links (list[str] | None): the page’s outgoing links, if links asked for them
    • errors (list): one entry if the page could not be read, otherwise empty, with
      • url (str): the page URL
      • error_type (str): Parallel’s error classification, e.g. fetch_error
      • http_status_code (int | None): the status returned by the page
      • content (str | None): the error body, if the page returned one
    • warnings (list | None): the adjustments the service made to the request, each with a type, a message and an optional detail
    • usage (list | None): what the request billed, each entry with a name and a count
    • session_id (str): the conversation ID, echoed back, or one generated by the service
    A page that could not be read is reported in errors rather than as a UDF error.
Examples: Extract excerpts for a column of page URLs:
Read the excerpts, and the reason a page could not be read, out of the response:
Group a row’s search and extraction under the conversation ID stored alongside it:
Signature
Search the web and return source URLs, titles and relevant excerpts. Equivalent to the Parallel Search API endpoint. For additional details, see: https://docs.parallel.ai/search/search-quickstart Without an API key, the free endpoint serves fast searches; mode, max_results, source_policy and fetch_policy then require one. Request throttling: Applies the rate limit set in the config (section parallel, key rate_limit). If no rate limit is configured, uses a default of 600 RPM. Parameters:
  • objective (pxt.String): The information to find, including any source or freshness requirements.
  • search_queries (pxt.Json[(String): Keyword queries of three to six words each, which may use search operators; two or three work best. The service ranks sources against them and against objective. Defaults to objective as the only query.
  • mode (Any): How much work the service puts into the search, in increasing order of latency and cost. advanced and basic cost five times fast and turbo. See https://docs.parallel.ai/search/modes.
  • max_results (Any): How many sources to return. Defaults to the service’s setting of 10, and is capped at 20.
  • source_policy (Any): Which sources to search, as include_domains, exclude_domains and after_date. See https://docs.parallel.ai/search/advanced-search-settings.
  • fetch_policy (Any): How fresh the page contents have to be, as max_age_seconds, timeout_seconds and disable_cache_fallback. Defaults to the service’s setting, which serves its cached index.
  • session_id (Any): Application-owned conversation ID, a UUID or a hex string of at least 32 characters. Pass the same ID for related search and extract calls; omit it for standalone requests. Use a new opaque ID for a new conversation.
Returns:
  • ParallelSearchResponse: A dictionary with the following entries:
    • search_id (str): Parallel’s ID for this search, for support requests
    • results (list): the sources, ordered by decreasing relevance, each with
      • url (str): the source URL
      • title (str | None): the page title
      • publish_date (str | None): the publication date, as YYYY-MM-DD
      • excerpts (list[str]): passages relevant to objective
    • warnings (list | None): the adjustments the service made to the request, each with a type, a message and an optional detail
    • usage (list | None): what the request billed, each entry with a name and a count
    • session_id (str): the conversation ID, echoed back, or one generated by the service
Examples: Search for each row’s question:
Read the first source’s excerpts out of the response:
Search with keyword queries of their own, in the highest-quality mode:
Make search available to an LLM using the existing tool-calling API:
Last modified on December 4, 2026