Usage API
Endpoint#
/usage
Method#
GET
Description#
The Usage API provides information about the current API usage for a given API key. It returns the total count of requests made and the rate limit.
URL#
https://us-central1-snapcalorieb2bapi.cloudfunctions.net/usageQuery Parameters#
key: The API key for which the usage information is requested.
Sample Request#
curl -X GET 'https://us-central1-snapcalorieb2bapi.cloudfunctions.net/usage?key=YOUR_API_KEY'Sample Responses#
Success Response:
{ "code": 200, "data": { "limit": 100, "usage": 5 }}Unauthorized (API Key not provided or invalid):
{ "code": 401, "text": "Unauthorized"}Server Error:
{ "code": 500, "text": "Error processing request"}
Notes#
- Replace
YOUR_API_KEYin the sample request with your actual API key. - Ensure that your requests are sent over HTTPS to maintain security.