Subscription Usage API

Returns request quota usage counters, remaining quota values, reset timestamps, and related account usage details.

API Guide

Subscription Usage API

Returns request quota usage counters, remaining quota values, reset timestamps, and related account usage details.

This API will return the current API usage summary for your API key subscription. See Pricing for plan limits, and details.

Additionally the same information can be found in the following HTTP Response Headers returned with every weather data request:

  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • X-RateLimit-Reset

Request Parameters

Field Optional/Required Type Data Type Description
key Required query string Your registered API key.

Example Request

Enter API key

Default

https://api.weatherbit.io/v2.0/subscription/usage?key=API_KEY
curl -s "https://api.weatherbit.io/v2.0/subscription/usage?key=API_KEY"
require 'uri'
require 'net/http'
require 'json'

uri = URI("https://api.weatherbit.io/v2.0/subscription/usage?key=API_KEY")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = (uri.scheme == "https")
request = Net::HTTP::Get.new(uri)
response = http.request(request)
json = JSON.parse(response.body)
puts JSON.pretty_generate(json)
const https = require("https");

https.get("https://api.weatherbit.io/v2.0/subscription/usage?key=API_KEY", (res) => {
  let raw = "";
  res.on("data", (chunk) => { raw += chunk; });
  res.on("end", () => {
    const json = JSON.parse(raw);
    console.log(JSON.stringify(json, null, 2));
  });
}).on("error", (err) => {
  console.error(err.message);
});
Estimated quota: 1 requeststandard

Example Response HTTP 200

{
  "calls_count": "58697",
  "calls_remaining": 7941303,
  "calls_reset_ts": 1780358399,
  "historical_calls_count": "26681",
  "historical_calls_remaining": 373319,
  "historical_calls_reset_ts": 1780358399
}

HTTP Statuses

Code Description Example
200 Subscription usage object. -
400 Client Error
{
  "error": "Some relevant message"
}
403 Unauthorized/No Access for current plan level
{
  "error": "Some relevant message"
}
429 Daily or Velocity limit exceeded See rate limit guidance.
{
  "error": "Rate limit exceeded.",
  "status_code": 429,
  "status_message": "Rate limit exceeded. Try again later."
}
500 Internal Server Error
{
  "error": "Server Error"
}

Return Fields

Field Data Type Description
calls_count string Current call count for the key/subscription.
calls_remaining integer Remaining calls before reset.
calls_reset_ts integer Usage reset timestamp.
historical_calls_count string Historical product call count when available.
historical_calls_remaining integer Remaining historical calls before reset.
historical_calls_reset_ts integer Historical usage reset timestamp.

Returns request usage counters for your API key subscription, including calls_count, calls_remaining, and reset timestamps.