# Migrate from Serper

> Move a Serper integration to BestSERP: same endpoints, parameters and field names; change the base URL and key, and check the few differences listed here.

Source: https://bestserp.com/docs/migrate-from-serper (updated 2026-11-14)

BestSERP uses the same paths (`/search`, `/images`, `/news`, `/videos`, `/shopping`, `/places`, `/maps`), the same JSON body (`q`, `gl`, `hl`, `num`, `page`, `tbs`), the `X-API-KEY` header and the same camelCase field names as Serper's Google API. Most clients only change two values.

## Steps

1. Set the base URL to `https://api.bestserp.com`.
2. Replace the key with a BestSERP key ([authentication](https://bestserp.com/docs/authentication)).
3. Run your test suite against the differences below.

## Differences

| Topic | BestSERP |
| --- | --- |
| `location` | Not supported yet: refused with `unsupported_parameter`. Put the city in `q`. |
| `knowledgeGraph`, `peopleAlsoAsk`, `relatedSearches`, `answerBox` | Not returned. |
| `sitelinks` on organic results | Not returned. |
| Places `type` | Returned as `category`. |
| Places `website`, `phoneNumber`, `description` | Not returned. |
| Extra fields | `domain`, `favicon`, `unresolvedLinks`, `linksPending`, `ipCountry`, `requestId`, `credits`, `durationMs`. |
| Long searches | May answer `202`: poll `/requests/{requestId}` ([async](https://bestserp.com/docs/async)). |

The [Serper comparison](https://bestserp.com/compare/serper-alternative) lists prices and what Serper does better.

**The same request, pointed at BestSERP, cURL**

```bash
curl -X POST 'https://api.bestserp.com/search' \
  -H 'X-API-KEY: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"q":"coffee","gl":"us","hl":"en"}'
```

**The same request, pointed at BestSERP, Python**

```python
import requests

resp = requests.post(
    "https://api.bestserp.com/search",
    headers={"X-API-KEY": "YOUR_API_KEY"},
    json={
      "q": "coffee",
      "gl": "us",
      "hl": "en"
    },
    timeout=130,
)
resp.raise_for_status()
print(resp.json())
```

**The same request, pointed at BestSERP, Node.js**

```javascript
const res = await fetch("https://api.bestserp.com/search", {
  method: "POST",
  headers: { "X-API-KEY": "YOUR_API_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    "q": "coffee",
    "gl": "us",
    "hl": "en"
  }),
});
console.log(await res.json());
```

**The same request, pointed at BestSERP, PHP**

```php
<?php
$ch = curl_init('https://api.bestserp.com/search');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 130,
    CURLOPT_HTTPHEADER => ['X-API-KEY: YOUR_API_KEY', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode([
        'q' => 'coffee',
        'gl' => 'us',
        'hl' => 'en',
    ]),
]);
echo curl_exec($ch);
```

**The same request, pointed at BestSERP, Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"q":"coffee","gl":"us","hl":"en"}`)
	req, _ := http.NewRequest("POST", "https://api.bestserp.com/search", body)
	req.Header.Set("X-API-KEY", "YOUR_API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```
