Retrieve usage data from unkey to power your dashboards, reports or usage-based billing.
Copy
Ask AI
const { result, error } = await unkey.analytics.getVerifications({ apiId: "api_123",});if (error) { // handle potential network or bad request error // a link to our docs will be in the `error.docs` field console.error(error.message); return;}console.log(result)
const { result, error } = await unkey.analytics.getVerifications({ apiId: "api_123",});if (error) { // handle potential network or bad request error // a link to our docs will be in the `error.docs` field console.error(error.message); return;}console.log(result)
Only include data for a specific key or keys.When you are providing zero or more than one key ids, all usage counts are aggregated and summed up. Send multiple requests with one keyId each if you need counts per key.
Only include data for a specific tag or tags.When you are providing zero or more than one tag, all usage counts are aggregated and summed up. Send multiple requests with one tag each if you need counts per tag.
By default, datapoints are not aggregated, however you probably want to get a breakdown per time, key or identity.Grouping by tags and by tag is mutually exclusive.
const { result, error } = await unkey.analytics.getVerifications({ apiId: "api_123",});if (error) { // handle potential network or bad request error // a link to our docs will be in the `error.docs` field console.error(error.message); return;}console.log(result)