An example with Curl using your parameters from the demo above:
curl --location --request POST 'https://all-serp.com/api/google_search?query=coffee&country=united+states&language=en&location=los+angeles&page=1&api_key=your_api_key'
An example with Ruby using your parameters from the demo above:
require "uri"
require "net/http"
url = URI("https://all-serp.com/api/google_search?query=coffee&country=united+states&language=en&location=los+angeles&page=1&api_key=your_api_key")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
An example with Python using your parameters from the demo above:
import requests
url = "https://all-serp.com/api/google_search?query=coffee&country=united+states&language=en&location=los+angeles&page=1&api_key=api_key"
payload={}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload, allow_redirects=False)
print(response.text)
An example with Node.js using your parameters from the demo above:
var axios = require('axios');
var config = {
method: 'post',
url: 'https://all-serp.com/api/google_search?query=coffee&country=united+states&language=en&location=los+angeles&page=1&api_key=your_api_key',
headers: { }
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
An example with PHP using your parameters from the demo above:
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://all-serp.com/api/google_search?query=coffee&country=united+states&language=en&location=los+angeles&page=1&api_key=your_api_key',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
An example with .NET using your parameters from the demo above:
var client = new RestClient("https://all-serp.com/api/google_search?query=coffee&country=united+states&language=en&location=los+angeles&page=1&api_key=your_api_key");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
An example with Java using your parameters from the demo above:
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://all-serp.com/api/google_search?query=coffee&country=united+states&language=en&location=los+angeles&page=1&api_key=your_api_key")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
An example with Go using your parameters from the demo above:
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://all-serp.com/api/google_search?query=coffee&country=united+states&language=en&location=los+angeles&page=1&api_key=your_api_key"
method := "POST"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
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))
}