Sorry, no results found for "".

Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Usage counters

Retrieve a project's usage counter

Query parameters

period enum

The time period upon which counters will be returned

Example: "today"
today

Return only today's data

current_month

Return data for the current month

last_month

Return data for the past month

Returns

Returns a resource object of type usage_counter

Examples

import { buildClient } from "@datocms/cma-client-node";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const usageCounterId = "cda_access_token_id_requests";
const usageCounter = await client.usageCounters.find(usageCounterId);
// Check the 'Returned output' tab for the result ☝️
console.log(usageCounter);
}
run();
{ id: "cda_access_token_id_requests", result: [{ value: "", counter: 20 }] }