# Access the API

The Google API works on top of the SERP API, which is available via GET requests sent to our official API endpoint and by specifying the `engine=<GOOGLE_ENGINE>` query parameter.

The official SERP API endpoint is:

* `https://serpapi.webscrapingapi.com/v2`

To choose the appropriate `engine` check out the available [Google Search Engines](/google-search-api/google-search-engines.md).

{% hint style="info" %}
You can use this as the base URL for the Google API: **`https://serpapi.webscrapingapi.com/v2?api_key=<YOUR_API_KEY>&engine=<GOOGLE_ENGINE>`**
{% endhint %}

### The API key

Our SERP API requires an API key for authentication. The key is embedded in the URL as a query parameter called `api_key` and has to be included on each GET request, for the request to pass. Failing to pass the <mark style="color:yellow;">**required**</mark> `api_key` parameter or passing an incorrect key will result in an `Unauthorized` HTTP status.

To obtain an API key for the SERP API, you have to:&#x20;

1. [Register](/readme/registration.md) a new account on our official platform
2. Subscribe to the SERP API service from within the Dashboard

{% hint style="success" %}
Subscription to the SERP API gives you access to all supported engines: Google, Bing and Yandex.
{% endhint %}

In the following documentation, we will refer to the API key by using this syntax:**`<YOUR_API_KEY>`**

{% hint style="warning" %}
Please make sure to store your private API key in a secure location and never make it publicly available. Using the API key directly impacts you subscription plan. &#x20;
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.webscrapingapi.com/google-search-api/getting-started/access-the-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
