Usage API

The Usage API provides information on daily query usage and remaining quota for your account. You can retrieve data for the current day or for historical dates, covering a window of up to 90 days. This allows you to monitor daily quota consumption over the specified period.

Note: The Insights API also allows you to request quota information to be returned along with your insights results.


Usage Lookup
GET
/usage/<service>

This endpoint enables you to view the number of queries used from your daily quota, either for today or for past days, within a 90-day timeframe.

Path Parameters

  • Name
    service
    Type
    string
    Description

    Required. Select which service you would like to inquire about: insights or scoring.

Headers

Query Parameters

  • Name
    start_date
    Type
    string
    Description

    Optional. The start date of a date range to query. If you do not provide a start date, today's date will be used. This field is required if you provide an end_date.

  • Name
    end_date
    Type
    string
    Description

    Optional. The end date of a date range to query. A maximium of a 90-day window may be used.

Response

The response will differ depending on your request. If no queries have been done for the date range, you wil receive an empty response. If some of the quota has been used, you will receive an array containing an object for each day requested.

Status Codes:

  • 200 OK
  • 403 Invalid API Key
  • 404 Invalid Path
  • 429 Too many requests (exceeded quota)

Request

curl "https://api.echotrail.io/usage/insights?start_date=2024-11-01&end_date=2024-11-07" \ -H "x-api-key: [your api key]"
curl "https://api.echotrail.io/usage/insights?start_date=2024-11-01&end_date=2024-11-07" \ -H "x-api-key: [your api key]"

Response

[ { "used": 125, "remaining": 125, "total": 250, "date": "2024-11-01" }, { "used": 250, "remaining": 0, "total": 250, "date": "2024-11-02" }, { "used": 250, "remaining": 0, "total": 250, "date": "2024-11-03" }, { "used": 50, "remaining": 200, "total": 250, "date": "2024-11-04" }, { "used": 245, "remaining": 5, "total": 250, "date": "2024-11-05" }, { "used": 250, "remaining": 0, "total": 250, "date": "2024-11-06" }, { "used": 240, "remaining": 10, "total": 250, "date": "2024-11-07" }, ]
[ { "used": 125, "remaining": 125, "total": 250, "date": "2024-11-01" }, { "used": 250, "remaining": 0, "total": 250, "date": "2024-11-02" }, { "used": 250, "remaining": 0, "total": 250, "date": "2024-11-03" }, { "used": 50, "remaining": 200, "total": 250, "date": "2024-11-04" }, { "used": 245, "remaining": 5, "total": 250, "date": "2024-11-05" }, { "used": 250, "remaining": 0, "total": 250, "date": "2024-11-06" }, { "used": 240, "remaining": 10, "total": 250, "date": "2024-11-07" }, ]

Was this page helpful?