Cookie Preferences

We use cookies to improve your experience and analyze site usage.

GRANTED API Docs
Back to App
OverviewAuthenticationError Handling
Endpoints
Grant EndpointsSubscription Endpoints

Subscription Endpoints

Monitor your API usage and subscription limits.

GET /subscription/usage

Get current usage statistics for your subscription.

Parameters

  • days (number) - Number of days for statistics (default: 30)

Example Response

{
  "success": true,
  "data": {
    "currentMonth": {
      "calls": 2500,
      "limit": 10000,
      "remaining": 7500,
      "resetDate": "2024-02-01T00:00:00Z"
    },
    "statistics": {
      "period": "30 days",
      "totalCalls": 8750,
      "avgCallsPerDay": 291.7,
      "topEndpoints": [
        { "endpoint": "/grants", "calls": 5200 },
        { "endpoint": "/grants/filters", "calls": 2100 }
      ]
    },
    "subscription": {
      "tier": "PROFESSIONAL",
      "monthlyLimit": 10000,
      "rateLimit": 50,
      "status": "ACTIVE"
    }
  }
}

GET /subscription/limits

Get detailed information about your subscription limits and features.

Example Response

{
  "success": true,
  "data": {
    "subscription": {
      "tier": "PROFESSIONAL",
      "status": "ACTIVE"
    },
    "limits": {
      "monthly": {
        "limit": 10000,
        "current": 2500,
        "remaining": 7500,
        "resetDate": "2024-02-01T00:00:00Z"
      },
      "rateLimit": {
        "requestsPerSecond": 50,
        "description": "Maximum 50 requests per second"
      }
    },
    "features": {
      "grants": {
        "read": true,
        "search": true
      },
      "subscription": {
        "read": true
      }
    }
  }
}