Skip to content

Get Usage

GET /v1/usage

Get the current extraction usage for the authenticated user's billing period. Use this endpoint to monitor consumption and avoid hitting plan limits.

Try it

Test this endpoint interactively in the Swagger UI.

Authorization required

Include your API key in the Authorization header.

Request

Headers

HeaderValueRequired
AuthorizationBearer <token>Yes

This endpoint takes no query parameters or request body.

Code Examples

bash
curl https://api.docmap.io/v1/usage \
  -H "Authorization: Bearer dm_live_abc123def456ghi789jkl012mno345"
typescript
const apiKey = process.env.DOCMAP_API_KEY

const response = await fetch('https://api.docmap.io/v1/usage', {
  headers: { 'Authorization': `Bearer ${apiKey}` },
})

const { data } = await response.json()
console.log(`${data.usage} / ${data.limit} extractions used (${data.plan} plan)`)
python
import requests

api_key = "dm_live_abc123def456ghi789jkl012mno345"

response = requests.get(
    "https://api.docmap.io/v1/usage",
    headers={"Authorization": f"Bearer {api_key}"},
)

data = response.json()["data"]
print(f"{data['usage']} / {data['limit']} extractions used ({data['plan']} plan)")

Response

Status: 200 OK

The response body is wrapped in a data object.

Fields

FieldTypeDescription
planstringThe user's current plan: free, starter, core, or pro.
usagenumberNumber of extractions consumed in the current billing period.
limitnumberMaximum number of extractions allowed for the current plan.
periodKeystringCurrent billing period in YYYY-MM format.

Example

json
{
  "data": {
    "plan": "starter",
    "usage": 142,
    "limit": 500,
    "periodKey": "2024-11"
  }
}

Errors

StatusCodeDescription
401UNAUTHORIZEDMissing, invalid, or expired API key / token.

DocMap API Documentation