Get Usage Details
Endpoint Details
URL: https://api.profileapi.com/2024-03-01/usage
HTTP Method: GET
Overview
This endpoint provides detailed information about the API usage, including the current number of available credits and the next reset date for the API credit allocation. It is designed to help users manage their usage within the profileAPI platform effectively.
Request Parameters
This endpoint does not require any input parameters.
Returned Fields
Here is the description of the fields returned in the response:
Field | Type | Description | Format |
---|---|---|---|
availableCredits | integer | The current number of available credits the user has until the next reset. | N/A |
nextResetDate | string | The date when the current credits will expire and reset. | YYYY-MM-DD |
Response Structure
The response is composed of a metadata object and a data object that contains details regarding the user's API credits.
JSON Structure
{
"meta": {
"requestId": "abc123", // Unique identifier for the request
"status": "success" // Status of the request
},
"data": {
"availableCredits": 5000, // Example: Number of credits remaining
"nextResetDate": "2024-12-01" // Example: Next reset date for credits
}
}
Example Response
{
"meta": {
"requestId": "abc123",
"status": "success"
},
"data": {
"availableCredits": 5000,
"nextResetDate": "2024-12-01"
}
}
Example Usage
cURL
curl '<https://api.profileapi.com/{version}/usage>'
Node.js (Using Axios)
const axios = require('axios');
axios.get('<https://api.profileapi.com/{version}/usage>')
.then(response => {
console.log("API Usage Details:", response.data);
})
.catch(error => {
console.error('Error fetching API usage data:', error);
});
Python (Using requests)
import requests
response = requests.get('<https://api.profileapi.com/{version}/usage>')
if response.status_code == 200:
print("API Usage Details:", response.json())
else:
print('Failed to retrieve data:', response.status_code)