# Consulting Monthly Request Consumption

In this endpoint, you can check the number of requests made per month. You must send the `x_api_token` header with the token or pass the token via query string in the URL.

You can also pass the token as a parameter in the URL, example:

`https://comercial.cnpj.ws/consumo?token=YOUR_TOKEN`

**Method:** `GET`

**Endpoint:** `https://comercial.cnpj.ws/consumo`

{% hint style="info" %}
**Attention:** Queries to this endpoint also count as an API request.
{% endhint %}

## Request Example

{% openapi src="/files/pX97Qdj2qn3xNQOZEdoV" path="/consumo" method="get" %}
[openapi-comercial.yaml](https://content.gitbook.com/content/543mjjjP3f2OCfQR723f/blobs/Fw4vf2BKurgpfEERuww1/openapi-comercial.yaml)
{% endopenapi %}

We have a package that can help you integrate with JavaScript:

```shell
yarn add consultar-cnpj
```

```js
const consultarCNPJ = require("consultar-cnpj");

async function getCNPJ() {
  const token = "INFORME O SEU TOKEN DE ACESSO";

  const consumo = await consultarCNPJ.consumo(token);
  console.log(consumo);
}
```

[More information](https://www.npmjs.com/package/consultar-cnpj)

### Return Example

Below is an example of the JSON returned:

```json
{
  "filtros_disponiveis": ["ano", "mes"],
  "filtros_aplicados": {},
  "ordenacao": ["ano", "mes"],
  "data": [
    {
      "mes": 9,
      "ano": 2021,
      "quantidade": 1,
      "atualizado_em": "2021-09-29T20:41:55.144Z",
      "cnpjws_usuario_id": "d046b852-XXXX-XXXX-XXXX-8dccdf11d417"
    }
  ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cnpj.ws/en/api-reference/api-comercial/consultando-consumo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
