> For the complete documentation index, see [llms.txt](https://docs.cnpj.ws/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cnpj.ws/es/referencia-de-api/api-comercial/consultando-consumo.md).

# Consultando el Consumo de Solicitudes Mensuales

En este endpoint es posible consultar la cantidad de solicitudes que se han realizado por mes. Debes enviar el header `x_api_token` con el token o pasar el token por query string en la URL.

También puedes pasar el token como un parámetro en la URL, ejemplo:

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

**Método:** `GET`

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

{% hint style="info" %}
**Atención:** Las consultas en este endpoint también cuentan como una solicitud a la API.
{% endhint %}

## Ejemplo de Solicitud

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

Nosotros tenemos un paquete que puede ayudarte en la integración con 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);
}
```

[Más información](https://www.npmjs.com/package/consultar-cnpj)

### Ejemplo de Retorno

A continuación, un ejemplo del JSON retornado:

```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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.cnpj.ws/es/referencia-de-api/api-comercial/consultando-consumo.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
