<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sdk.nimbleway.com/v2/serp/async",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'search_engine' => 'google_search',
'country' => 'US',
'device' => 'desktop',
'domain' => 'com',
'locale' => 'en',
'location' => 'New York, New York, United States',
'num_results' => 10,
'page' => 1,
'parse' => true,
'query' => 'nimble web data',
'render' => false,
'resolve_url' => false,
'show_hidden_results' => false,
'callback_url' => 'https://example.com/webhook/callback',
'storage_compress' => true,
'storage_object_name' => 'result-2024-01-15.json',
'storage_type' => 's3',
'storage_url' => 's3://bucket-name/path/to/object'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}