Get usage /v2
curl --request GET \
--url https://api.meerapi.com/v2/usage_stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.meerapi.com/v2/usage_stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.meerapi.com/v2/usage_stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meerapi.com/v2/usage_stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.meerapi.com/v2/usage_stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.meerapi.com/v2/usage_stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meerapi.com/v2/usage_stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"customer_name": "acme_corp",
"data": [
{
"id": 123,
"type": "monthly",
"start_date": "2026-10-01T00:00:00Z",
"end_date": "2026-11-01T00:00:00Z",
"credit_limit": 10000,
"credits_used": 900,
"credits_remaining": 9100,
"total_requests": 700,
"by_country": [
{
"country": "US",
"request_count": 500
},
{
"country": "AU",
"request_count": 200
}
],
"unallocated_usage": {
"request_count": 0,
"credits_used": 0
}
}
],
"next_cursor": null
}{
"error": "<string>",
"country": "<string>",
"supported_countries": [
"<string>"
]
}{
"error": "<string>",
"country": "<string>",
"supported_countries": [
"<string>"
]
}{
"error": "<string>",
"country": "<string>",
"supported_countries": [
"<string>"
]
}{
"error": "<string>",
"country": "<string>",
"supported_countries": [
"<string>"
]
}{
"error": "unable to process request"
}Get usage /v2
Check your account’s credit balance and usage for a billing period. This endpoint is free and returns the latest recorded period by default.
GET
/
v2
/
usage_stats
Get usage /v2
curl --request GET \
--url https://api.meerapi.com/v2/usage_stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.meerapi.com/v2/usage_stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.meerapi.com/v2/usage_stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meerapi.com/v2/usage_stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.meerapi.com/v2/usage_stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.meerapi.com/v2/usage_stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meerapi.com/v2/usage_stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"customer_name": "acme_corp",
"data": [
{
"id": 123,
"type": "monthly",
"start_date": "2026-10-01T00:00:00Z",
"end_date": "2026-11-01T00:00:00Z",
"credit_limit": 10000,
"credits_used": 900,
"credits_remaining": 9100,
"total_requests": 700,
"by_country": [
{
"country": "US",
"request_count": 500
},
{
"country": "AU",
"request_count": 200
}
],
"unallocated_usage": {
"request_count": 0,
"credits_used": 0
}
}
],
"next_cursor": null
}{
"error": "<string>",
"country": "<string>",
"supported_countries": [
"<string>"
]
}{
"error": "<string>",
"country": "<string>",
"supported_countries": [
"<string>"
]
}{
"error": "<string>",
"country": "<string>",
"supported_countries": [
"<string>"
]
}{
"error": "<string>",
"country": "<string>",
"supported_countries": [
"<string>"
]
}{
"error": "unable to process request"
}Authorizations
apiKeyportalJwt
Authorization: Bearer <YOUR_API_KEY>. The Bearer prefix is optional.
Query Parameters
How many billing periods to return, newest first. Cannot be used with id.
Required range:
1 <= x <= 100The billing period to check. Get an id from List billing periods. Cannot be combined with pagination.
Required range:
x >= 1Use next_cursor from the previous response to get the next page.
⌘I