Retrieve usage data for a time range or the current billing cycle
Retrieve API usage data for a date range or the current billing cycle. Returns daily usage including request counts for each day within the time period. The response includes both individual daily usage data and total usage for the entire period. - Omit start_date and end_date to get usage for your current billing cycle, which may start and end mid month. - The request count is the number of billable requests, the same count that is deducted from your plan or quota. - Maximum date range allowed: 90 days - Days are Pacific calendar days - Current day data when requested will be updated during the day - Days after today are not included
Authorization
ApiKeyAuth API key for authentication. Get your key from the Whitepages developer portal.
In: header
Query Parameters
Start date of the duration to get usage data for. Format: YYYY-MM-DD. Give both start_date and end_date or neither.
End date of the duration to get usage data for, inclusive. Format: YYYY-MM-DD. Give both start_date and end_date or neither.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/account/usage/"{
"time_range": {
"start_date": "2019-08-24",
"end_date": "2019-08-24"
},
"usage_data": [
{
"date": "2019-08-24",
"request_count": 0
}
],
"total_requests_in_timeperiod": 0
}{
"error": {
"code": 400,
"message": "Bad Request",
"long_message": "Invalid person ID format: 'sdf'. Person ID must start with 'P' followed by exactly 10 alphanumeric characters. Example: 'PABcd12345e' or 'P1234567890'.",
"meta": null
},
"wp_trace_id": "3b0b537a60d84057817bb40563ca5c99"
}{
"message": "Forbidden"
}{
"error": {
"code": 422,
"message": "Unprocessable Entity",
"long_message": "The request contains semantic errors and cannot be processed",
"meta": null
},
"wp_trace_id": "7e5f2c9a1d8b4e6f9c0a3b5d7e1f2a4c"
}{
"error": {
"code": 500,
"message": "Internal Server Error",
"long_message": "An internal server error occurred",
"meta": null
},
"wp_trace_id": "9c1a4e7f2b8d4c6a9e0f3b5d7c1a2e4f"
}