Skip to content
Track usage
Help · Usage and billing

Track usage

Track quota usage on CNPJá: meters, charts by member and API key, each request with what it consumed, and the trace ID to send to support.

See how much of the quota the organization has spent and every request made in the app or with its API keys. The summary sits in the organization selector, at the top of the app, and the details on the Usage and Requests pages, which open from the top of the selector’s menu or under Settings, at the foot of the rail (on a phone, tap Menu and then Settings).

Who can see it

WhatWho sees it
Meters in the organization selector and on the DashboardEvery member of the organization
The Usage and Requests pagesOwner, Administrator, Developer and Bookkeeper

The Member does not see the two pages: for them, Settings opens straight on the account settings, and a link to either page leads to the Dashboard. The permissions of each role are in Permissions by role.

In the organization selector

The selector sits at the top of the app and shows the selected organization and its plan. The selector’s lower edge fills up as the quota with the least room left is spent, in the color of that quota’s kind of query.

  1. Click the organization selector.
  2. Check the card of each organization you belong to: the plan, the Live queries and Cached queries meters, with the period’s usage and quota, and in how many days the quota renews. On a plan that ends with this usage period, the card says instead, in amber, Back to Free and in how many days the organization goes back to Free and its quota. On a plan past due, the card keeps showing when the quota renews, followed by Overage off, in red; the date of a return to Free, when there is one, is in the Overdue debt panel of the Subscription page (Late payment).
  3. To spend another organization’s quota, click its card.
  4. For the details of the selected organization, click Usage or Requests, at the top of the menu. Both links show for those who can see these pages and only cover the selected organization.

Each query meter opens with the dot of its kind and fills in its color, teal for live and grey for cache, however much is used, and the bar ends at the quota, never running past it. From 80% of the quota, the count turns bold, in the color of the text, never in amber, the color of overage. Once the quota runs out, a tick closes the bar, and the tick and the count are amber while the overage budget pays for the queries past the quota, or red when nothing does. Whatever was already consumed past the quota runs on a second bar right under it: in amber while the budget pays for it as overage, or in red when it went past with no budget to pay, as in a burst of queries at the edge of the quota or with the budget suspended by a late payment, and that is not charged. The Dashboard shows the same meters for the selected organization, with See usage for those who can open the Usage page, and, while the organization is spending overage, the Overage budget meter, which fills in amber, the color of overage in reais across the app, its count and tick turning red as soon as what is left of the budget can’t pay for even one more overage query, even before the spending reaches the whole amount. The meter in Current period, on the Usage page, follows the same rule. What changes when the quota runs out is in Quota used up.

Usage page

The Usage page shows the requests and the queries the organization consumed over a time window, in the app and through the API.

  1. Open Usage, at the top of the organization selector’s menu, or Settings > Usage.
  2. Under Period, pick one of the shortcuts, from Last 24 hours to Last 12 months, or mark the dates under From and To, set the Hours and click Apply. The page opens on Last 30 days.
  3. Under Grouping, pick Hourly, Daily, Weekly or Monthly.
  4. To see only some members or keys, use the Actor filter, described in Filter by member or key.
  5. To bring in the requests made since the page opened, click Refresh. The filters stay the same, and the Current period is read again along with it.
PartWhat it shows
Current periodThe plan, the overage budget when there is one, in amber, the day of the usage period, a meter per quota, the Overage budget meter once any of it is spent, and Resets on, plus Plan renews on when the plan renews on another date, or Plan ends on when the subscription was cancelled. It does not change with the Period you pick
RequestsHow many requests the organization made in the chosen period
Queries consumedThe queries billed to the organization, split into live and cached, on a teal and grey bar
AvailabilityThe share of requests answered without a server error. It is an informational indicator
p50 latencyThe median response time
BreakdownThe Request volume, Query volume, Requests by status, Latency by percentile, Requests by type, Requests by actor, Usage by type and Usage by subtype charts

In the charts, as across the app, live queries are teal and cached ones grey, always in that order: Usage by type has one color per kind, and in Usage by subtype each subtype is a shade of its kind’s color.

Next to each chart’s title, the About this panel tip explains what it measures. In the legend, click an item to isolate it and Shift + click to add others. Click an interval of a chart to open that interval’s requests in Requests; with the keyboard, pick the interval with the arrow keys and press Enter.

The filters live in the page address, so a copied link opens the same view for anyone who can also see the page. With no requests in the period, the page offers View the last 12 months, when another period is picked, and Make your first request, or Clear when members or keys are ticked under Actor.

Filter by member or key

The Actor filter is on the Usage, Requests and Audit log pages. Actions taken in the app count under the member who took them, and those made through the API under the key used.

  1. Click Actor.
  2. Tick the members, listed under Members, and the keys, listed under API keys, you want to see. You can tick several.
  3. To see everyone again, untick the items or use the clear button beside the filter.

Tip: use one API key per application. The Actor filter then shows each application’s usage on its own, as explained in API keys.

Requests page

The Requests page lists every request of the organization, one per row.

  1. Open Requests, at the top of the organization selector’s menu, or Settings > Requests.
  2. Filter by Period, Status, Request type, Usage type, Usage subtype and Actor, or type in Search requests. Clear undoes every filter. Refresh reads the requests again with the same filters and highlights the ones that arrived.
  3. Click a request to open its details.
  4. To move to the neighboring requests on the page, use Previous request and Next request, or the K and J keys.

Search requests looks for whole words in the resource, the trace ID, the error code, the IP address and the user agent, and every word typed must appear. Type the CNPJ, the CPF or the CEP without punctuation.

The table shows Time, Status, Request type, Resource, Actor, IP address, Latency and Usage, which puts live queries beside a teal dot and cached ones beside a grey dot. The resource is the identifier looked up, such as a CNPJ, a CPF or a CEP, with a link to its record in the app when there is one, or the identifier of the list exported, for an Establishment export. The status comes with its meaning: 200 OK, 201 Created, 206 Partial content, 400 Bad request, 402 Insufficient balance, 404 Not found, 422 Unprocessable, 500 Server error, 503 Unavailable and 504 Gateway timeout.

The details bring together the Actor, the Latency, the IP address, the Error code when there is one, the Resource and the Trace ID, plus:

  • Query parameters: the parameters sent with the request;
  • Breakdown: each operation performed, the live ones first, with the teal dot, then the cached ones, with the grey dot;
  • Usage: the queries consumed per unit, with the dot of their kind, and the Total, or Not billed when the request was not charged;
  • User agent: the browser or program that made the request.

Trace ID

Every request gets a trace ID, the code that identifies it in CNPJá’s records. It shows in the request details, under Requests, with a button to copy it, and, in API errors, in the response body as traceId. Send this code when you contact support, as explained in Trace ID.

Chart limits

  • Each chart holds up to 500 intervals. So Hourly works for periods of up to 20 days, Daily up to 500 days and Weekly up to 3,500 days. A grouping that does not fit the period is unavailable, with a note on its longest period.
  • Each chart shows up to 8 items, such as statuses, types or actors. The rest are added up under Other or, in Usage by subtype, under Other (live) and Other (cached), which do not open requests.
  • The Latency by percentile chart measures time rather than counts, so it does not open requests either.

What gets logged

For each request, CNPJá logs the time, the actor, which can be a member or a key, the type, the resource looked up, the parameters, the status, the error code, the latency, the IP address, the user agent, the trace ID and the usage.

These records are visible to the organization’s Owner, Administrator, Developer and Bookkeeper. Anyone in one of those roles therefore sees what each member looked up, when and from which IP address. How CNPJá handles this data is in the Privacy Policy, and how long it keeps it, under Retention and deletion.

What does not appear

  • Public requests, made to the API without a key, belong to no organization.
  • What someone does in the app without an account counts toward no organization’s usage.
  • Only data requests appear, such as lookups, certificates, searches and exports. Creating, editing or deleting lists and views does not: those actions are in the organization’s audit log, except establishments added to a list or removed from it through the API, which are not recorded anywhere.
  • Each organization sees only its own requests. To see another one’s, switch organizations in the selector.

Requests rejected by validation (400) and failures on CNPJá’s side (5xx) do appear, marked Not billed. Requests refused because the quota or the overage budget had already run out (402), by the rate limit (429) or for an invalid key (401) do not. An export, though, appears when it is refused too, always marked Not billed: with status 402 when its estimated consumption does not fit what is left of the quota and the overage budget, and with status 422 when the list has reached its limit of exports. An export that starts appears with status 201 and the consumption recorded at the request, as Quota usage explains.

The Terms of Use prevail over this page.

Informational content that may change without notice. It is not tax, accounting or legal advice, and CNPJá's terms and policies prevail over this page.