Usage API
#
Endpoint/usage
#
MethodGET
#
DescriptionThe 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.
#
URLhttps://us-central1-snapcalorieb2bapi.cloudfunctions.net/usage
#
Query Parameterskey
: The API key for which the usage information is requested.
#
Sample Requestcurl -X GET 'https://us-central1-snapcalorieb2bapi.cloudfunctions.net/usage?key=YOUR_API_KEY'
#
Sample ResponsesSuccess 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_KEY
in the sample request with your actual API key. - Ensure that your requests are sent over HTTPS to maintain security.