Links

Schedule Search

All POST data should be sent in the JSON format (UTF-8 encoding). The task setting is done using the POST method when the array of tasks is sent into json format. We recommend to set up to 100 tasks at a time. Such limits were set due to the variations of task setting methods that you may use.
Requires authentication
post
https://api.serphouse.com/trends/schedule
Parameters
Header
Authorization*
Bearer <YOUR_API_TOKEN>
Content-Type*
application/json
Body
time_zone_offset*
integer
Pass Timezone offset. You can receive the list of available timezone of google trend with their offset value by making a separate request to the List of timezone and offset
keywords*
string
Search keyword single google or multiple google, youtube, yahoo Note:- maximum 5 string search.
time*
string
now 1-H - Return past hour result now 4-H Return past 4 hours result now 1-d Return past 1 day result now 7-d Return past 7 days result today 1-m Return past 1 month result today 3-m Return past 3 months result today 12-m Return past 1 year result today 5-y Return past 5 years result 2021-01-24 2021-02-25 To extract custom date range result
property
string
property should contain bellow list only. "" - Web Search(Default) images - Image Search news - News Search froogle - Google Shopping youtube - YouTube Search
category
integer
by Default category is 0 for all categories. You can receive the list of available categories of google trend with their sub category by making a separate request to the List of Categories
geo
string
by Default geo is "" for Worldwide. You can receive the list of available geo of google trend with their state by making a separate request to the List of Country and State.
langauge_code
string
by Default language code is "en". You can receive the list of available language of google trend with their ids by making a separate request to the List of Language.
postback_url
url
return URL for sending task results If you specify the Postback URL there will be no need to use Get Trend search Tasks Results for obtaining results. We will send the result of a completed task by a POST request to the URL as soon as the task is completed. You can change your webhook setting from Webhook Settings Page.
pingback_url
url
Pingback URL is Notification URL of a completed task, When a task is completed we will notify you by GET request sent to the URL you have specified. You can change your webhook setting from Webhook Settings Page.
Responses
200: OK
Successful operation
400: Bad Request
Failed validation
401: Unauthorized
Unauthenticated
402: Payment Required
Failed operation

Example request:

BASH
RUBY
PYTHON
NODE.JS
PHP
JAVA
JAVASCRIPT
GO
C#/.NET
curl --location --request POST 'https://api.serphouse.com/trends/schedule' \
--header 'Authorization: Bearer <YOUR_API_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"data" : [
{
"time_zone_offset": -330,
"keywords": "google",
"time": "now 1-d",
"property": "youtube",
"category": 0,
"geo": "us",
"langauge_code": "en",
"postback_url": "https:\/\/webhook.site\/277a9716-691d-4255-be89-a5f8f0240b58",
"pingback_url": "https:\/\/webhook.site\/277a9716-691d-4255-be89-a5f8f0240b58"
}
]
}'
require "uri"
require "json"
require "net/http"
url = URI("https://api.serphouse.com/trends/schedule")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer <YOUR_API_TOKEN>"
request.body = JSON.dump({
"data": [
{
"time_zone_offset": "-330",
"keywords": "google",
"time": "now 1-d",
"property": "youtube",
"category": "0",
"geo": "us",
"langauge_code": "en",
"postback_url": "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58",
"pingback_url": "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58"
}
]
})
response = https.request(request)
puts response.read_body
import requests
import json
url = "https://api.serphouse.com/trends/schedule"
payload = json.dumps({
"data": [
{
"time_zone_offset": -330,
"keywords": "google",
"time": "now 1-d",
"property": "youtube",
"category": 0,
"geo": "us",
"langauge_code": "en",
"postback_url": "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58",
"pingback_url": "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58"
}
]
})
headers = {
'Authorization': 'Bearer <YOUR_API_TOKEN>',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var data = JSON.stringify({
"data": [
{
"time_zone_offset": "-330",
"keywords": "google",
"time": "now 1-d",
"property": "youtube",
"category": "0",
"geo": "us",
"langauge_code": "en",
"postback_url": "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58",
"pingback_url": "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58"
}
]
});
var config = {
method: 'post',
url: 'https://api.serphouse.com/trends/schedule',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <YOUR_API_TOKEN>'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
<?php
$client = new GuzzleHttp\Client();
$headers = [
'Authorization' => 'Bearer <YOUR_API_TOKEN>',
'Content-Type' => 'application/json'
];
$body = '{
"data": [
{
"time_zone_offset": -330,
"keywords": "google",
"time": "now 1-d",
"property": "youtube",
"category": 0,
"geo": "us",
"langauge_code": "en",
"postback_url": "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58",
"pingback_url": "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58"
}
]
}';
$request = new GuzzleHttp\Psr7\Request('POST', 'https://api.serphouse.com/trends/schedule', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
JSONObject jsonObject = new JSONObject();
jsonObject.put("data", new JSONArray()
.put(new JSONObject()
.put("time_zone_offset", -330)
.put("keywords", "google")
.put("time", "now 1-d")
.put("property", "youtube")
.put("category", 0)
.put("geo", "us")
.put("langauge_code", "en")
.put("postback_url", "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58")
.put("pingback_url", "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58")
)
);
String bodyJson = jsonObject.toString();
RequestBody body = RequestBody.create(mediaType, bodyJson);
Request request = new Request.Builder()
.url("https://api.serphouse.com/trends/schedule")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer <YOUR_API_TOKEN>")
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <YOUR_API_TOKEN>");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"data": [
{
"time_zone_offset": -330,
"keywords": "google",
"time": "now 1-d",
"property": "youtube",
"category": 0,
"geo": "us",
"langauge_code": "en",
"postback_url": "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58",
"pingback_url": "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58"
}
]
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.serphouse.com/trends/schedule", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.serphouse.com/trends/schedule"
method := "POST"
payload := strings.NewReader(`{
"data": [
{
"time_zone_offset": "-330",
"keywords": "google",
"time": "now 1-d",
"property": "youtube",
"category": "0",
"geo": "us",
"langauge_code": "en",
"postback_url": "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58",
"pingback_url": "https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58"
}
]
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer <YOUR_API_TOKEN>")
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))
}
var client = new RestClient("https://api.serphouse.com/trends/schedule");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer <YOUR_API_TOKEN>");
var body = @"
{
""data"": [
{
""time_zone_offset"": ""-330"",
""keywords"": ""google"",
""time"": ""now 1-d"",
""property"": ""youtube"",
""category"": ""0"",
""geo"": ""us"",
""language_code"": ""en"",
""postback_url"": ""https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58"",
""pingback_url"": ""https://webhook.site/277a9716-691d-4255-be89-a5f8f0240b58""
}
]
}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);