> For the complete documentation index, see [llms.txt](https://ajuda.espiaonfe.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajuda.espiaonfe.com.br/gestao/nfs-e-servico/configuracao/consulta-automatica-municipal.md).

# Consulta automática (municipal)

### 🤔 O que é a consulta automática de NFS-e (municipal)?

Atualmente, o Espião NF-e possui conexão direta via webservices com centenas de municípios para consulta de NFS-e. No entanto, **alguns municípios não disponibilizam esse serviço de consulta**, permitindo apenas a verificação de NFS-e de serviços prestados, tomados, ambos ou, em alguns casos, nenhum.

A consulta automática para NFS-e foi criada para simplificar o processo de consulta, eliminando o trabalho manual e tornando-o mais prático e eficiente.

### Como funciona

* A consulta automática irá procurar notas fiscais nos municípios configurados em determinados horários três (3) vezes ao dia. É importante destacar que alguns municípios não exigem certificado, enquanto outros requerem.<br>
* Contudo, no caso das consultas automáticas para NFS-e, essa configuração será válida apenas para empresas que utilizam o certificado do tipo A1.

### 📃 Para configurar, siga as etapas a seguir

1. No menu **Histórico**, selecione a opção **NFS-e**

<div align="left"><figure><img src="/files/2okaQsx7uUD1xZ2aYQ0x" alt=""><figcaption></figcaption></figure></div>

2. No menu **Histórico NFS-e**, selecione a aba **NFS-e Municipal** e, em seguida, acesse a aba **Consulta Automática**.

<figure><img src="/files/vINo6VroiA77HQGa83km" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**ATENÇÃO**

Para utilizar a consulta automática de NFS-e, é necessário que a empresa possua um certificado digital tipo A1 válido.
{% endhint %}

3. Busque o município que deseja colocar na busca automática, utilizando os filtros por **Municípios, UF e Observação**. Ao localizar o município desejado, clique no botão **+ Adicionar**

<div align="left"><figure><img src="/files/PXRtrTx8EAt7AHip2Ocu" alt="" width="563"><figcaption></figcaption></figure></div>

Nas colunas **Prestados|Tomados|E-mail**, os ícones indicam os tipos de consultas que o município disponibiliza para a verificação das notas.

<div align="left"><figure><img src="/files/qnJ0tjD24QLyHtfgPxdh" alt=""><figcaption></figcaption></figure></div>

5. Após adicionar o município, você pode escolher se a consulta buscará serviços prestados, tomados ou ambos. Se desejar interromper a consulta para um determinado município, basta clicar em **Remover.**

<figure><img src="/files/C48iwq9IE56AIrLN9xoz" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**ATENÇÃO**\
Só será possível colocar apenas 1 (um) Município para consultar notas **do tipo Prestados por empresa.**
{% endhint %}

Após clique em **Confirmar**. Pronto finalizou a configuração de consulta automática.


---

# 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://ajuda.espiaonfe.com.br/gestao/nfs-e-servico/configuracao/consulta-automatica-municipal.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.
