Alukard_X
Grand Guru
- Joined
- Oct 3, 2020
- Messages
- 484
PHP:
<?php
$headers = [];
require '/home/user/vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Pool;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Cookie\CookieJarInterface;
$client = new Client([
]);
$array = [
"realme.com",
"truemeds.in",
"hotline.finance",
"acko.com",
"youtravel.me"
];
foreach ($array as $key) {
$response = $client->request('GET', 'https://api.similarweb.com/v1/similar-rank/' . $key . '/rank?api_key=15a35b3519a04d50aafe031f9d58202e', ['headers' => $headers, 'http_errors' => false]);
$res = json_decode($response->getBody());
file_put_contents('similarweb_rank.txt', $key . ";" . $res->similar_rank->rank . "\n", FILE_APPEND | LOCK_EX);
}