# Check SERP Status

As a response of the API server, you will get a status of your serp task

{% hint style="danger" %}
Requires authentication
{% endhint %}

## Get a status of your serp task

<mark style="color:blue;">`GET`</mark> `https://api.serphouse.com/serp/check`

#### Query Parameters

| Name                                 | Type   | Description                         |
| ------------------------------------ | ------ | ----------------------------------- |
| id<mark style="color:red;">\*</mark> | String | unique identifier of your serp task |

#### Headers

| Name                                            | Type   | Description              |
| ----------------------------------------------- | ------ | ------------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<YOUR\_API\_KEY> |

{% tabs %}
{% tab title="200: OK Completed operation" %}

```json
{
    "status": "success",
    "msg": "Completed",
    "results": ""
}
```

{% endtab %}

{% tab title="400: Bad Request Failed validation" %}

```json
{
    "status": "error",
    "msg": "validation_error",
    "error": {
        "id": [
            "The id field is required."
        ]
    }
}
```

{% endtab %}

{% tab title="404: Not Found Failed operation" %}

```json
{
    "status": "success",
    "msg": "Not found",
    "results": ""
}
```

{% endtab %}

{% tab title="200: OK Processing in a queue" %}

```json
{
    "status": "success",
    "msg": "Processing in a queue",
    "results": ""
}
```

{% endtab %}

{% tab title="200: OK Waiting for a process" %}

```json
{
    "status": "success",
    "msg": "Waiting for a process",
    "results": ""
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthenticated" %}

```json
{
    "status": "error",
    "msg": "Unauthenticated"
}
```

{% endtab %}
{% endtabs %}

## Example request:

{% tabs %}
{% tab title="BASH" %}

```bash
curl --location --request GET 'https://api.serphouse.com/serp/check?id=77224195' \
--header 'Authorization: Bearer <YOUR_API_KEY>'
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require "uri"
require "net/http"

url = URI("https://api.serphouse.com/serp/check?id=77224195")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <YOUR_API_KEY>"

response = https.request(request)
puts response.read_body

```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

url = "https://api.serphouse.com/serp/check?id=77224195"

payload={}
headers = {
  'Authorization': 'Bearer <YOUR_API_KEY>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}

{% tab title="NODE.JS" %}

```javascript
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://api.serphouse.com/serp/check?id=77224195',
  headers: { 
    'Authorization': 'Bearer <YOUR_API_KEY>'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$serphouse = new SERPHouse\SERPHouseClient('YOUR_API_KEY');
$res = $serphouse->serpApi->check('77224195');
echo $res->getResponse();

```

{% endtab %}

{% tab title="JAVA" %}

```java
OkHttpClient client = new OkHttpClient().newBuilder().build();
Request request = new Request.Builder()
  .url("https://api.serphouse.com/serp/check?id=77224195")
  .get()
  .addHeader("Authorization", "Bearer <YOUR_API_KEY>")
  .build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
```

{% endtab %}

{% tab title="JAVASCRIPT" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <YOUR_API_KEY>");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.serphouse.com/serp/check?id=77224195", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="GO" %}

```go
package main

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

func main() {

  url := "https://api.serphouse.com/serp/check?id=77224195"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer <YOUR_API_KEY>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}

{% tab title="C#/.NET" %}

```csharp
var client = new RestClient("https://api.serphouse.com/serp/check?id=77224195");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <YOUR_API_KEY>");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
```

{% endtab %}
{% endtabs %}


---

# 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.serphouse.com/serp-api/check-serp-status.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.
