Skip to main content

Extractor Usage

Monitor your API usage and check remaining extraction capacity. This endpoint helps you track your current usage limits and plan your data extraction workflows accordingly.

GET /extractor-usage

Overview

The Extractor Usage endpoint provides real-time information about your remaining API quota. Use this to monitor consumption, implement usage-based logic in your applications, and ensure smooth operation within your plan limits.

Usage Tracking

Your usage quota is measured in "pages processed" rather than individual API calls. A multi-page document counts as multiple page units.

Request Details

Method: GET Rate Limit: 5 requests per 5 seconds

Headers

HeaderValueRequiredDescription
AuthorizationBearer YOUR_API_KEYYour API authentication token

Query Parameters

ParameterTypeRequiredDescription
start_datestringStart of date range in ISO 8601 format (e.g. 2024-01-01T00:00:00Z). When provided, pagesUsed is returned.
end_datestringEnd of date range in ISO 8601 format (e.g. 2024-12-31T23:59:59Z). Defaults to the current time if omitted.
by_userbooleanSet to true to break down workspace usage by individual user. Requires start_date to be set.

Examples

const baseUrl = 'https://sheets.lido.app/api/v1/extractor-usage';
const headers = { Authorization: 'Bearer YOUR_API_KEY' };

// Basic usage check
async function checkUsage() {
const response = await fetch(baseUrl, { method: 'GET', headers });
const data = await response.json();
console.log(`Pages remaining: ${data.pagesRemaining}`);
return data;
}

// Usage within a date range
async function checkUsageInRange() {
const url = `${baseUrl}?start_date=2024-01-01T00:00:00Z&end_date=2024-12-31T23:59:59Z`;
const response = await fetch(url, { method: 'GET', headers });
const data = await response.json();
console.log(`Pages remaining: ${data.pagesRemaining}`);
console.log(`Pages used in range: ${data.pagesUsed}`);
return data;
}

// Per-user breakdown for a workspace
async function checkUsageByUser() {
const url = `${baseUrl}?start_date=2024-01-01T00:00:00Z&by_user=true`;
const response = await fetch(url, { method: 'GET', headers });
const data = await response.json();
data.usageByUser.forEach(u => {
console.log(`${u.email}: ${u.pagesUsed} pages used`);
});
return data;
}

Response

Default response (no date range)

{
"pagesRemaining": 247
}

With start_date (and optional end_date)

{
"pagesRemaining": 247,
"pagesUsed": 53
}

With start_date and by_user=true

{
"pagesRemaining": 247,
"usageByUser": [
{
"userId": "user_abc123",
"email": "alice@example.com",
"pagesUsed": 30
},
{
"userId": "user_def456",
"email": "bob@example.com",
"pagesUsed": 23
}
]
}

Response Fields

FieldTypeDescription
pagesRemainingnumberNumber of document pages you can still process with your current plan
pagesUsednumberPages processed within the requested date range (present when start_date is provided and by_user is not true)
usageByUserarrayPer-user breakdown (present when by_user=true and start_date is provided)
usageByUser[].userIdstringUnique identifier of the workspace user
usageByUser[].emailstringEmail address of the workspace user
usageByUser[].pagesUsednumberPages processed by this user within the requested date range

Usage Calculation

How Pages Are Counted

Your API usage is measured in processed pages, not individual API calls:

  • Single-page document = 1 page unit
  • 5-page PDF = 5 page units
  • Image file = 1 page unit

Important notes:

  • Failed extractions don't count - If a job fails due to processing errors, no pages are deducted from your quota
  • Only pages in range are counted - When using pageRange, only the specified pages count toward usage
  • Pages excluded by @exclude_pages do count - If you use @exclude_pages in your instructions to skip certain pages during processing, those pages still count toward your usage quota

Page Range Processing

When you specify a pageRange parameter:

// This processes only pages 2-4 (3 pages total)
{
pageRange: "2-4",
// ... other parameters
}
// Usage: 3 page units
// This processes the entire 10-page document
{
pageRange: "", // or omit the parameter
// ... other parameters
}
// Usage: 10 page units