# Quickstart

> Get an API key and run your first Google search with BestSERP in two minutes: sign in, create a key, send a request in cURL, Python, Node.js, PHP or Go.

Source: https://bestserp.com/docs/quickstart (updated 2026-11-14)

## 1. Sign in

[Sign in with Google](https://bestserp.com/login). Your account starts with 3,000 free credits, valid 30 days. No card.

## 2. Create a key

Open **Dashboard > API keys**, create a key and copy it: it is shown once. Keys start with `bsa_`.

## 3. Send a request

Replace `YOUR_API_KEY` and run one of these:

**cURL**

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

**Python**

```python
import requests

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

**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": "best running shoes",
    "gl": "us",
    "hl": "en"
  }),
});
console.log(await res.json());
```

**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' => 'best running shoes',
        'gl' => 'us',
        'hl' => 'en',
    ]),
]);
echo curl_exec($ch);
```

**Go**

```go
package main

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

func main() {
	body := strings.NewReader(`{"q":"best running shoes","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))
}
```

The response holds the organic results in `organic`, plus `credits` (what the request cost) and `requestId`:

**200 OK**

```json
{
  "searchParameters": {
    "q": "best running shoes",
    "gl": "us",
    "hl": "en",
    "type": "search",
    "num": 10,
    "page": 1,
    "engine": "google"
  },
  "organic": [
    {
      "position": 1,
      "title": "The 12 Best Running Shoes of 2026, Tested by Runners",
      "link": "https://www.runnersgearlab.com/best-running-shoes",
      "snippet": "We ran 1,200 miles in 60 pairs to find the best daily trainers, race shoes and trail runners for every budget.",
      "displayedLink": "https://www.runnersgearlab.com › best-running-shoes",
      "source": "Runners Gear Lab",
      "domain": "runnersgearlab.com",
      "favicon": "https://www.google.com/s2/favicons?domain=runnersgearlab.com&sz=64"
    },
    {
      "position": 2,
      "title": "Best Running Shoes for Beginners: A Buying Guide",
      "link": "https://www.stridemag.com/guides/running-shoes-beginners",
      "snippet": "Cushioning, drop, fit and price explained. Our picks for new runners, from $80 trainers to carbon racers.",
      "displayedLink": "https://www.stridemag.com › guides",
      "source": "Stride Magazine",
      "domain": "stridemag.com",
      "favicon": "https://www.google.com/s2/favicons?domain=stridemag.com&sz=64"
    }
  ],
  "videos": [
    {
      "position": 1,
      "title": "I Tested 10 Running Shoes for 500 Miles",
      "link": "https://www.youtube.com/watch?v=runshoe500",
      "duration": "18:42",
      "channel": "The Run Lab",
      "platform": "YouTube",
      "date": "2 weeks ago"
    }
  ],
  "requestId": "5b0c8a52-3f0e-4d55-9a2a-0f3a8e2d1c11",
  "credits": 1,
  "cached": false,
  "linksPending": false,
  "unresolvedLinks": 0,
  "durationMs": 1840
}
```

## Next

- Other result types: [images](https://bestserp.com/docs/api/images), [news](https://bestserp.com/docs/api/news), [videos](https://bestserp.com/docs/api/videos), [shopping](https://bestserp.com/docs/api/shopping), [places](https://bestserp.com/docs/api/places), [maps](https://bestserp.com/docs/api/maps).
- Long searches answer `202`: see [async requests](https://bestserp.com/docs/async).
- Guides for [Python](https://bestserp.com/integrations/python), [Node.js](https://bestserp.com/integrations/nodejs), [LangChain](https://bestserp.com/integrations/langchain) and [n8n](https://bestserp.com/integrations/n8n).
