Limits

All API users have a daily request limit. Information about the limit can be obtained from the response headers of the API request:

  • X-RateLimit-Limit - daily limit
  • X-RateLimit-Remaining - number of remaining requests that can be made before "X-RateLimit-Reset"
  • X-RateLimit-Reset - the time when the daily limit will be reset (unix timestamp)

Example of method call:

<?php
    $post = array(
        'token' => $token,
        'id' => 9999
    );
    if ($curl = curl_init()) {
        curl_setopt($curl, CURLOPT_URL, 'https://www.ipweb.ru/api/v2/category/delete');
        curl_setopt($curl, CURLOPT_HEADER, 1);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
        $response = curl_exec($curl);
        $header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
        $headers_string = substr($response, 0, $header_size);
        $headers_string = preg_replace('~\s+\Z~', '', $headers_string);
        $headers_array = explode(PHP_EOL, $headers_string);
        $headers = [];
        if (is_array($headers_array)) {
            foreach ($headers_array as $value) {
                if (empty($value)) {
                    continue;
                }
                list($tmp_key, $tmp_value) = explode(':', $value, 2);
                if ($tmp_value) {
                    $headers[trim($tmp_key)] = trim($tmp_value);
                } else {
                    $headers[] = trim($tmp_key);
                }
            }
        }
        curl_close($curl);
        $out = substr($response, $header_size); 
        print_r($headers_groups);
        print_r($out);  
    }

// Result:
{
    .
    .
    .
    "X-RateLimit-Limit": 1000
    "X-RateLimit-Remaining": 992
    "X-RateLimit-Reset": 1734987600
}
{
    "status": "ok",
    "error_code": 0
}
IPweb

Rate the material:

Rating: 0 out of 5. Total ratings: 0.
Last modified

I don't understand anything! Help :-(