> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Websearch SDK Reference

> SDK reference for the Websearch API, available in Node.js and Python.

## Websearch

### Search Websearch

Search with Exa, Ceramic, Linkup, Tavily, Serper, OpenAI, or Perplexity and return page URLs, titles, and descriptions in one response format. Authenticate with an API key that grants **websearch.execute** and send **Content-Type: application/json**.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.websearch.search(provider="exa", query="Things to do in Salt Lake City in fall", limit=10)

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.websearch.search({
      provider: "exa",
      query: "Things to do in Salt Lake City in fall",
      limit: 10,
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "provider": Literal["exa", "ceramic", "linkup", "tavily", "serper", "openai", "perplexity"],  # required
        "query": str,  # required
        "identity": {  # optional
            "id": str,  # required
        },
        "limit": Optional[int],
        "plugins": [{  # optional
            "entities": List[str],  # optional
            "entity_thresholds": Dict[str, float],  # optional
            "id": Literal["pii_redaction"],  # required
            "language": Optional[str],
            "on_failure": Optional[str],
            "regions": List[str],  # optional
            "threshold": Optional[float],
        }],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      identity?: {
        id: string;  // required
      };
      limit?: number;
      plugins?: {
        entities?: string[];
        entityThresholds?: Record<string, number>;
        id: "pii_redaction";  // required
        language?: string;
        onFailure?: string;
        regions?: string[];
        threshold?: number;
      }[];
      provider: "exa" | "ceramic" | "linkup" | "tavily" | "serper" | "openai" | "perplexity";  // required
      query: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "headers": Dict[str, List[str]],
        "result": {
            "items": [{
                "description": str,
                "title": str,
                "url": str,
            }],
            "metadata": {
                "latency_ms": int,
                "provider": Literal["exa", "ceramic", "linkup", "tavily", "serper", "openai", "perplexity"],
                "query": str,
                "request_id": str,
            },
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      headers: Record<string, string[]>;
      result: {
        items: {
          description: string;
          title: string;
          url: string;
        }[];
        metadata: {
          latencyMs: number;
          provider: "exa" | "ceramic" | "linkup" | "tavily" | "serper" | "openai" | "perplexity";
          query: string;
          requestId: string;
        };
      };
    }
    ```
  </CodeGroup>
</Expandable>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.