# Check Search Status

As a response of the API server, you will get a status of your trend search task.

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

## Get a status of your trend search task

<mark style="color:blue;">`GET`</mark> `https://api.serphouse.com/trends/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/trends/check?id=76850016' \
--header 'Authorization: Bearer <YOUR_API_KEY>'
```

{% endtab %}

{% tab title="RUBY" %}

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

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

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/trends/check?id=76850016"

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/trends/check?id=76850016',
  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->trends->check(76850016);
echo $res->getResponse();

```

{% endtab %}

{% tab title="JAVA" %}

```java
OkHttpClient client = new OkHttpClient().newBuilder().build();
Request request = new Request.Builder()
  .url("https://api.serphouse.com/trends/check?id=76850016")
  .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/trends/check?id=76850016", 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/trends/check?id=76850016"
  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/trends/check?id=76850016");
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 %}
