Stats
You can check the number of requests you can perform within your daily limit by using the command stats.
This request doesn't require API limits.
http://api.serpstat.com/v3/stats?token={token}
{
"result":{
"max_lines":10000,
"used_lines":502,
"left_lines":9498
},
"status_msg":"OK",
"status_code":200,
"left_lines":9498
}
<?php
// This example works with Serpstat SDK only.
// Link: https://github.com/SerpstatGlobal/serpstat-sdk
require_once __DIR__ . '/../vendor/autoload.php';
// configure your application
$config = [
'token' => 'd9632fc1ae1724da4d5ea2f3a99d5f5f',
];
// init client with your serpstat api token
$apiClient = new \Serpstat\Sdk\Core\ApiGuzzleHttpClient($config['token']);
// create instance of api method class
$apiMethod = new \Serpstat\Sdk\Methods\CheckLimitsMethod();
try {
// try call api method
$response = $apiClient->call($apiMethod)->getResult();
} catch (\Exception $e) {
// catch api error
$response = $e->getMessage();
}
var_dump($response);
import codecs
import json
import pprint
import urllib.request as urlrequest
from urllib.parse import urlencode
host = 'http://api.serpstat.com/v3'
method = 'stats'
params = {
'token': 'ijmiom4f5m34905g03um8342dm04923lre3w', # string personal token
}
api_url = "{host}/{method}?{params}".format(
host=host,
method=method,
params=urlencode(params)
)
try:
json_data = urlrequest.urlopen(api_url).read()
except Exception as e0:
print("API request error: {error}".format(error=e0))
data = json.loads(json_data)
pprint.pprint(data)