curl --request GET \
--url https://api.fetchin.io/api/v1/usage \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.fetchin.io/api/v1/usage"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.fetchin.io/api/v1/usage', 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.fetchin.io/api/v1/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.fetchin.io/api/v1/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.fetchin.io/api/v1/usage")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fetchin.io/api/v1/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"from": "2026-10-01",
"to": "2026-10-03",
"creditsRemaining": 684230,
"subscriptionCreditsRemaining": 184230,
"paygCreditsRemaining": 500000,
"requests": 30482,
"billableRequests": 30214,
"creditsUsed": 32154,
"endpoints": [
{
"endpoint": "/api/v1/profile",
"requests": 28377,
"billableRequests": 28154,
"creditsUsed": 28154,
"statusCodes": { "200": 26401, "404": 1753, "429": 211, "503": 12 }
},
{
"endpoint": "/api/v1/post/engagement",
"requests": 2105,
"billableRequests": 2060,
"creditsUsed": 4000,
"statusCodes": { "200": 1940, "404": 120, "429": 45 }
}
],
"days": [
{ "date": "2026-10-01", "requests": 9850, "billableRequests": 9771, "creditsUsed": 10411 },
{ "date": "2026-10-02", "requests": 10412, "billableRequests": 10305, "creditsUsed": 10978 },
{ "date": "2026-10-03", "requests": 10220, "billableRequests": 10138, "creditsUsed": 10765 }
]
}
{
"error": "from must be on or before to.",
"code": "INVALID_PARAMETER"
}
{
"error": "Invalid API key",
"code": "INVALID_API_KEY"
}
{
"error": "Service temporarily unable to serve this request. Please retry.",
"code": "SERVICE_UNAVAILABLE"
}
Get Usage
Your current balance and the credits you used over a date range, per endpoint and per day
curl --request GET \
--url https://api.fetchin.io/api/v1/usage \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.fetchin.io/api/v1/usage"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.fetchin.io/api/v1/usage', 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.fetchin.io/api/v1/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.fetchin.io/api/v1/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.fetchin.io/api/v1/usage")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fetchin.io/api/v1/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"from": "2026-10-01",
"to": "2026-10-03",
"creditsRemaining": 684230,
"subscriptionCreditsRemaining": 184230,
"paygCreditsRemaining": 500000,
"requests": 30482,
"billableRequests": 30214,
"creditsUsed": 32154,
"endpoints": [
{
"endpoint": "/api/v1/profile",
"requests": 28377,
"billableRequests": 28154,
"creditsUsed": 28154,
"statusCodes": { "200": 26401, "404": 1753, "429": 211, "503": 12 }
},
{
"endpoint": "/api/v1/post/engagement",
"requests": 2105,
"billableRequests": 2060,
"creditsUsed": 4000,
"statusCodes": { "200": 1940, "404": 120, "429": 45 }
}
],
"days": [
{ "date": "2026-10-01", "requests": 9850, "billableRequests": 9771, "creditsUsed": 10411 },
{ "date": "2026-10-02", "requests": 10412, "billableRequests": 10305, "creditsUsed": 10978 },
{ "date": "2026-10-03", "requests": 10220, "billableRequests": 10138, "creditsUsed": 10765 }
]
}
{
"error": "from must be on or before to.",
"code": "INVALID_PARAMETER"
}
{
"error": "Invalid API key",
"code": "INVALID_API_KEY"
}
{
"error": "Service temporarily unable to serve this request. Please retry.",
"code": "SERVICE_UNAVAILABLE"
}
Endpoint
GET /api/v1/usage
Authentication
Include your API key in the request header:X-API-Key: your-api-key-here
Parameters
YYYY-MM-DD, included. Days are UTC calendar days.
Defaults to the first day of the current month.YYYY-MM-DD, included: the whole UTC day is counted.
Defaults to today. A range covers at most 366 days.Response
YYYY-MM-DD.YYYY-MM-DD.GET /api/v1/subscription.creditsRemaining.creditsRemaining.402, 429) and errors included.404 for a record that
does not exist. See What is billed.billableRequests when you
called endpoints that cost more than one credit.Example Request
curl -X GET "https://api.fetchin.io/api/v1/usage?from=2026-10-01&to=2026-10-31" \
-H "X-API-Key: your-api-key-here"
const params = new URLSearchParams({ from: '2026-10-01', to: '2026-10-31' });
const response = await fetch(
`https://api.fetchin.io/api/v1/usage?${params}`,
{
headers: {
'X-API-Key': 'your-api-key-here'
}
}
);
const usage = await response.json();
console.log(usage.creditsUsed, usage.creditsRemaining);
import requests
response = requests.get(
'https://api.fetchin.io/api/v1/usage',
headers={'X-API-Key': 'your-api-key-here'},
params={'from': '2026-10-01', 'to': '2026-10-31'}
)
usage = response.json()
print(usage['creditsUsed'], usage['creditsRemaining'])
<?php
$apiKey = 'your-api-key-here';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.fetchin.io/api/v1/usage?from=2026-10-01&to=2026-10-31");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: ' . $apiKey
]);
$response = curl_exec($ch);
$usage = json_decode($response, true);
curl_close($ch);
print_r($usage);
?>
Example Response
{
"from": "2026-10-01",
"to": "2026-10-03",
"creditsRemaining": 684230,
"subscriptionCreditsRemaining": 184230,
"paygCreditsRemaining": 500000,
"requests": 30482,
"billableRequests": 30214,
"creditsUsed": 32154,
"endpoints": [
{
"endpoint": "/api/v1/profile",
"requests": 28377,
"billableRequests": 28154,
"creditsUsed": 28154,
"statusCodes": { "200": 26401, "404": 1753, "429": 211, "503": 12 }
},
{
"endpoint": "/api/v1/post/engagement",
"requests": 2105,
"billableRequests": 2060,
"creditsUsed": 4000,
"statusCodes": { "200": 1940, "404": 120, "429": 45 }
}
],
"days": [
{ "date": "2026-10-01", "requests": 9850, "billableRequests": 9771, "creditsUsed": 10411 },
{ "date": "2026-10-02", "requests": 10412, "billableRequests": 10305, "creditsUsed": 10978 },
{ "date": "2026-10-03", "requests": 10220, "billableRequests": 10138, "creditsUsed": 10765 }
]
}
{
"error": "from must be on or before to.",
"code": "INVALID_PARAMETER"
}
{
"error": "Invalid API key",
"code": "INVALID_API_KEY"
}
{
"error": "Service temporarily unable to serve this request. Please retry.",
"code": "SERVICE_UNAVAILABLE"
}
Errors
See Error Handling for the full list of error codes and recommended handling.400INVALID_PARAMETER— a date that is notYYYY-MM-DD,fromafterto, or more than 366 days401UNAUTHENTICATED/INVALID_API_KEY429RATE_LIMITED500INTERNAL_ERROR503SERVICE_UNAVAILABLE
Notes
GET /api/v1/subscription are left out
of the figures it reports, so checking your consumption never adds to it./subscription, it runs on its own budget of 1 request per second per
account, separate from your plan’s rate limit and from /subscription’s: it
returns X-RateLimit-Cost: 0 and never spends plan throughput. See
Rate Limits.0.Authorizations
Query Parameters
First UTC day of the range, YYYY-MM-DD, included. Defaults to the first day of the current month.
"2026-10-01"
Last UTC day of the range, YYYY-MM-DD, included (the whole day is counted). Defaults to today. The range covers at most 366 days.
"2026-10-31"
Response
Current balance and consumption over the range
First UTC day covered.
"2026-10-01"
Last UTC day covered.
"2026-10-03"
Your balance now, whatever the range: plan allowance plus pay-as-you-go credits. Same figure as on /api/v1/subscription.
684230
The plan half of creditsRemaining.
184230
The pay-as-you-go half of creditsRemaining.
500000
Every request made with your API keys over the range, whatever its outcome: refusals (402, 429) and errors included. Calls to /subscription and /usage are not counted.
30482
The requests that cost credits: a delivered response, or a 404 for a record that does not exist.
30214
Credits used by the billable requests. Higher than billableRequests when endpoints costing more than one credit were called.
32154
The same figures per endpoint, busiest first.
Show child attributes
Show child attributes
One entry per UTC day of the range up to today, oldest first, idle days at 0. Days that have not started are not listed.
Show child attributes
Show child attributes