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

# Migrating from SerpAPI

> Guide for switching from SerpAPI to Linkup

## Overview

Linkup is powered by a proprietary, AI-native web index, which provides swift and relevant retrieval of web results. This is a fundamentally different approach than SerpAPI's, which scrapes Google's results page.

## Quick start

### Get your API key

<Card title="Get your API key" icon="key" href="https://app.linkup.so" horizontal="True">
  Create a Linkup account for free to get your API key.
</Card>

### Install the SDK

<CodeGroup>
  ```bash Python theme={"system"}
  pip install linkup-sdk
  ```

  ```bash JavaScript theme={"system"}
  npm install linkup-sdk
  ```
</CodeGroup>

### Replace your API calls

**SerpAPI**

<CodeGroup>
  ```bash cURL theme={"system"}
  curl "https://serpapi.com/search?engine=google&q=latest%20AI%20news&num=10&api_key=YOUR_SERPAPI_KEY"
  ```

  ```python Python theme={"system"}
  from serpapi import GoogleSearch

  params = {
    "engine": "google",
    "q": "latest AI news",
    "num": 10,
    "api_key": "YOUR_SERPAPI_KEY"
  }

  search = GoogleSearch(params)
  results = search.get_dict()
  ```

  ```javascript JavaScript theme={"system"}
  const SerpApi = require('google-search-results-nodejs');
  const search = new SerpApi.GoogleSearch("YOUR_SERPAPI_KEY");

  const params = {
    engine: "google",
    q: "latest AI news",
    num: 10
  };

  search.json(params, (data) => {
    console.log(data);
  });
  ```
</CodeGroup>

**Linkup**

<CodeGroup>
  ```bash cURL theme={"system"}
  curl "https://api.linkup.so/v1/search" \
    -G \
    -H "Authorization: Bearer YOUR_LINKUP_KEY" \
    --data-urlencode "q=latest AI news" \
    --data-urlencode "depth=standard" \
    --data-urlencode "outputType=searchResults" \
    --data-urlencode "maxResults=10"
  ```

  ```python Python theme={"system"}
  from linkup import LinkupClient

  client = LinkupClient(api_key="YOUR_LINKUP_KEY")

  response = client.search(
      query="latest AI news",
      depth="standard",
      output_type="searchResults",
      max_results=10
  )
  print(response)
  ```

  ```javascript JavaScript theme={"system"}
  import { LinkupClient } from 'linkup-sdk';

  const client = new LinkupClient({ apiKey: 'YOUR_LINKUP_KEY' });

  client.search({
    query: 'latest AI news',
    depth: 'standard',
    outputType: 'searchResults',
    maxResults: 10
  }).then(console.log);
  ```
</CodeGroup>

## Parameter mapping

| SerpAPI parameter  | Linkup parameter                   | Notes                                                          |
| ------------------ | ---------------------------------- | -------------------------------------------------------------- |
| `q`                | `query`                            | Required parameter                                             |
| `engine`           | N/A                                | Linkup uses its own AI-native search engine                    |
| `num`              | `maxResults`                       | Total number of results returned. Default: `10`                |
| `tbs` (time-based) | `fromDate`, `toDate`               | Use ISO 8601 date format (YYYY-MM-DD)                          |
| `as_dt`, `as_eq`   | `includeDomains`, `excludeDomains` | Use arrays of domain strings                                   |
| N/A                | `depth`                            | Choose `"fast"` (beta), `"standard"`, or `"deep"`              |
| N/A                | `outputType`                       | Choose `"searchResults"`, `"sourcedAnswer"`, or `"structured"` |
| N/A                | `structuredOutputSchema`           | Define custom JSON schema for structured data extraction       |

## Response format differences

**SerpAPI response structure**

```json theme={"system"}
{
  "organic_results": [
    {
      "position": 1,
      "title": "Page Title",
      "link": "https://example.com",
      "snippet": "Description...",
      "date": "2 days ago"
    }
  ],
  "search_metadata": {
    "status": "Success",
    "total_time_taken": 1.23
  }
}
```

**Linkup response structure (`"searchResults"`)**

```json theme={"system"}
{
  "results": [
    {
      "name": "Page Title",
      "url": "https://example.com",
      "content": "Full content text...",
      "type": "html"
    }
  ]
}
```

**Linkup response structure (`"sourcedAnswer"`)**

```json theme={"system"}
{
  "answer": "Generated answer with citations...",
  "sources": [
    {
      "name": "Page Title",
      "url": "https://example.com",
      "snippet": "Relevant excerpt..."
    }
  ]
}
```

**Linkup response structure (`"structured"`)**

```json theme={"system"}
{
  "output": {
    "customField1": "Extracted data following your schema...",
    "customField2": ["Array", "of", "values"]
  }
}
```

## Examples

### Fresh content search

**SerpAPI**

<CodeGroup>
  ```bash cURL theme={"system"}
  curl "https://serpapi.com/search?engine=google&q=AI+news&tbs=qdr:w&api_key=YOUR_KEY"
  ```

  ```python Python theme={"system"}
  params = {
    "engine": "google",
    "q": "AI news",
    "tbs": "qdr:w",  # Past week
    "api_key": "YOUR_KEY"
  }
  ```

  ```javascript JavaScript theme={"system"}
  const SerpApi = require('google-search-results-nodejs');
  const search = new SerpApi.GoogleSearch("YOUR_KEY");

  const params = {
    engine: "google",
    q: "AI news",
    tbs: "qdr:w"
  };

  search.json(params, (data) => {
    console.log(data);
  });
  ```
</CodeGroup>

**Linkup**

<CodeGroup>
  ```bash cURL theme={"system"}
  curl "https://api.linkup.so/v1/search" \
    -G \
    -H "Authorization: Bearer YOUR_KEY" \
    --data-urlencode "q=AI news" \
    --data-urlencode "depth=standard" \
    --data-urlencode "outputType=sourcedAnswer" \
    --data-urlencode "fromDate=2026-03-05"
  ```

  ```python Python theme={"system"}
  response = client.search(
      query="AI news",
      depth="standard",
      output_type="sourcedAnswer",
      from_date="2026-03-05"
  )
  print(response)
  ```

  ```javascript JavaScript theme={"system"}
  client.search({
    query: 'AI news',
    depth: 'standard',
    outputType: 'sourcedAnswer',
    fromDate: '2026-03-05'
  }).then(console.log);
  ```
</CodeGroup>

### Domain-specific search

**SerpAPI**

<CodeGroup>
  ```bash cURL theme={"system"}
  curl "https://serpapi.com/search?engine=google&q=transformers&as_dt=arxiv.org&api_key=YOUR_KEY"
  ```

  ```python Python theme={"system"}
  params = {
    "engine": "google",
    "q": "transformers",
    "as_dt": "arxiv.org",  # Domain to search
    "api_key": "YOUR_KEY"
  }
  ```

  ```javascript JavaScript theme={"system"}
  const SerpApi = require('google-search-results-nodejs');
  const search = new SerpApi.GoogleSearch("YOUR_KEY");

  const params = {
    engine: "google",
    q: "transformers",
    as_dt: "arxiv.org"
  };

  search.json(params, (data) => {
    console.log(data);
  });
  ```
</CodeGroup>

**Linkup**

<CodeGroup>
  ```bash cURL theme={"system"}
  curl "https://api.linkup.so/v1/search" \
    -G \
    -H "Authorization: Bearer YOUR_KEY" \
    --data-urlencode "q=transformers" \
    --data-urlencode "depth=standard" \
    --data-urlencode "outputType=searchResults" \
    --data-urlencode "includeDomains=arxiv.org"
  ```

  ```python Python theme={"system"}
  response = client.search(
      query="transformers",
      depth="standard",
      output_type="searchResults",
      include_domains=["arxiv.org"]
  )
  print(response)
  ```

  ```javascript JavaScript theme={"system"}
  client.search({
    query: 'transformers',
    depth: 'standard',
    outputType: 'searchResults',
    includeDomains: ['arxiv.org']
  }).then(console.log);
  ```
</CodeGroup>

### Excluding domains

**SerpAPI**

<CodeGroup>
  ```bash cURL theme={"system"}
  curl "https://serpapi.com/search?engine=google&q=python+tutorial&as_eq=w3schools.com&api_key=YOUR_KEY"
  ```

  ```python Python theme={"system"}
  params = {
    "engine": "google",
    "q": "python tutorial",
    "as_eq": "w3schools.com",  # Domain to exclude
    "api_key": "YOUR_KEY"
  }
  ```

  ```javascript JavaScript theme={"system"}
  const SerpApi = require('google-search-results-nodejs');
  const search = new SerpApi.GoogleSearch("YOUR_KEY");

  const params = {
    engine: "google",
    q: "python tutorial",
    as_eq: "w3schools.com"
  };

  search.json(params, (data) => {
    console.log(data);
  });
  ```
</CodeGroup>

**Linkup**

<CodeGroup>
  ```bash cURL theme={"system"}
  curl "https://api.linkup.so/v1/search" \
    -G \
    -H "Authorization: Bearer YOUR_KEY" \
    --data-urlencode "q=python tutorial" \
    --data-urlencode "depth=standard" \
    --data-urlencode "outputType=searchResults" \
    --data-urlencode "excludeDomains=w3schools.com"
  ```

  ```python Python theme={"system"}
  response = client.search(
      query="python tutorial",
      depth="standard",
      output_type="searchResults",
      exclude_domains=["w3schools.com"]
  )
  print(response)
  ```

  ```javascript JavaScript theme={"system"}
  client.search({
    query: 'python tutorial',
    depth: 'standard',
    outputType: 'searchResults',
    excludeDomains: ['w3schools.com']
  }).then(console.log);
  ```
</CodeGroup>

## Need help?

* Check our [Quickstart Guide](/pages/documentation/get-started/quickstart)
* Read about [Prompting Best Practices](/pages/documentation/endpoints/search/best-practices)
* Join our [Discord Community](https://discord.gg/9q9mCYJa86)
* Explore the [API Reference](/pages/documentation/endpoints/search/reference)

<Info>
  Your Linkup account starts with \$20 of free credit when you sign up with a professional email address. You can monitor usage and add more credit in the [Billing](https://app.linkup.so/organization/billing) section.
</Info>
