Account Analytics
Arkhia's analytics API service allows you to fetch API usage analytics for their active projects. The key goal of the analytics API is to give you an insight of your API usage across Arkhia's suite of services.
info
Arkhia Analytics API is available only for Starter tiers and above.
You will need:
- Your base URL (eg. https://starter.arkhia.io)
- Arkhia's API Key [REQUIRED]
- 2-Layer Security Key [REQUIRED] Both of these can be retrieved from the Arkhia Dashboard after you Create a Project.
Fetching Analytics
- NodeJs(Axios)
- Curl
const axios = require('axios');let config = { method: 'get', maxBodyLength: Infinity, url: 'http://api.arkhia.io/analytics/breakdown/<YOUR_API_KEY>', headers: { 'x-api-secret': '<YOUR_API_SECRET>', }};axios.request(config).then((response) => { console.log(JSON.stringify(response.data));}).catch((error) => { console.log(error);});
curl --location 'http://api.arkhia.io/analytics/breakdown/<YOUR_API_KEY>' \--header 'x-api-secret: <YOUR_API_SECRET>'
Response Objects
Successful response:
Status Code: 200
- Response
{"status": true,"response": { "cycleStartDate": <Start Date of the current subscription cycle>, // UTC timestamp in UNIX format "cycleEndDate": <End Date of the current subscription cycle>, // // UTC timestamp in UNIX format "callsUsed": <Total calls used across projects in this cycle>, // number "callsAvailable": <Total calls available across projects in this cycle> // number "percentageCallsUsed": <Percentage calls used across projects in this cycle> // number}}