Usage
GET
/v1/usageRequires an API keyGET
/v1/usage/historyRequires an API keyRead how much of your monthly quota you have used and what your latest conversions were. See the guide to usage and quota.
Request
GET /v1/usage takes no parameters.
GET /v1/usage/history
| Parameter | In | Type | Description |
|---|---|---|---|
limit |
query | integer | 1 to 500, default 50 |
Response
GET /v1/usage
| Field | Type | Description |
|---|---|---|
tier |
string | Your plan name |
pages_quota |
integer | Pages included per calendar month (UTC) |
pages_used |
integer | Pages used this month |
welcome_pages |
integer | Welcome pages you still have; they do not expire and do not reset |
pages_remaining |
integer | Pages you can still use: the rest of the month; includes the welcome pages |
rate_limit_per_minute |
integer | Conversion requests per minute you may make |
{
"tier": "free",
"pages_quota": 50,
"pages_used": 37,
"welcome_pages": 500,
"pages_remaining": 513,
"rate_limit_per_minute": 20
}
GET /v1/usage/history returns an array, newest first:
| Field | Type | Description |
|---|---|---|
id |
integer | Row identifier |
endpoint |
string | The endpoint used, for example /v1/convert or /v1/convert (ocr) |
file_name |
string or null | The file |
pages_billed |
integer | Pages counted |
duration_ms |
integer | Time taken |
status_code |
integer | Result |
created_at |
datetime | When |
Errors
| Status | When |
|---|---|
401 |
Missing, wrong or revoked API key |
422 |
limit is out of range |
Examples
curl -s https://api.docslice.app/v1/usage \
-H "Authorization: Bearer $DOCSLICE_API_KEY"
import json
import os
import requests
response = requests.get(
"https://api.docslice.app/v1/usage",
headers={"Authorization": f"Bearer {os.environ['DOCSLICE_API_KEY']}"},
timeout=30,
)
print(json.dumps(response.json(), indent=2))
fetch("https://api.docslice.app/v1/usage", {
headers: { Authorization: `Bearer ${process.env.DOCSLICE_API_KEY}` },
})
.then((response) => response.json())
.then((data) => console.log(JSON.stringify(data, null, 2)));
<?php
$curl = curl_init('https://api.docslice.app/v1/usage');
curl_setopt_array($curl, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('DOCSLICE_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
echo curl_exec($curl);
curl_close($curl);
curl -s "https://api.docslice.app/v1/usage/history?limit=10" \
-H "Authorization: Bearer $DOCSLICE_API_KEY"
import json
import os
import requests
response = requests.get(
"https://api.docslice.app/v1/usage/history",
headers={"Authorization": f"Bearer {os.environ['DOCSLICE_API_KEY']}"},
params={"limit": 10},
timeout=30,
)
print(json.dumps(response.json(), indent=2))
fetch("https://api.docslice.app/v1/usage/history?limit=10", {
headers: { Authorization: `Bearer ${process.env.DOCSLICE_API_KEY}` },
})
.then((response) => response.json())
.then((data) => console.log(JSON.stringify(data, null, 2)));
<?php
$curl = curl_init('https://api.docslice.app/v1/usage/history?limit=10');
curl_setopt_array($curl, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('DOCSLICE_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
echo curl_exec($curl);
curl_close($curl);