> 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-nacional.md).

# Consulta automática (nacional)

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 href="#como-funciona" id="como-funciona"></a>

* A consulta automática irá consultar as NFS-e's diretamente na SEFAZ Nacional.&#x20;
* Contudo, no caso das consultas automáticas, essa configuração será válida apenas para empresas que utilizam o [certificado do tipo A1](https://blog.espiaonfe.com.br/o-que-e-certificado-digital-para-que-serve/).

{% hint style="success" %}
**DICA**

**Configure pelo histórico de notas NFS-e:**&#x20;

1. No menu **Histórico NFS-e**, selecione a opção **NFS-e Municipal**. Em seguida, acesse a aba **Consultas Automáticas (Municipal)** e clique na opção destacada para configurar a consulta automática das **NFS-e Nacional**

<img src="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2FaUJTGrCOXiMPuPi8EjVe%2Fconfigurar-consulta-auto-nfs-nacional.png?alt=media&amp;token=542f2681-f239-4cdc-bde9-04cbd291fc6e" alt="" data-size="original">

2. Selecione o período em que deseja que a consulta seja realizada.

<img src="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2F1zPwOjFwoB1LT82Q6qII%2Fdica-ativar-consulta-automatica.png?alt=media&amp;token=ae8b5cf3-73b0-4e71-8e7f-08b50c9beb7c" alt="" data-size="original">
{% endhint %}

#### 📃 Para configurar as consultas automáticas, siga as etapas a a seguir: <a href="#para-configurar-as-consultas-automaticas-siga-as-etapas-a-a-seguir" id="para-configurar-as-consultas-automaticas-siga-as-etapas-a-a-seguir"></a>

1. Para configurar a consulta automática, vá até o menu de **Cadastros** e clique em **Empresas**

<div align="left"><figure><img src="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2F5TMCEIaroYZcqS8DEtlT%2Fimage.png?alt=media&amp;token=335cf0e7-12ed-4dc2-a464-37fc4e4a59f3" alt="" width="250"><figcaption></figcaption></figure></div>

2. Na aba **“Gestão”**, clique no ícone identificado como **“Configurações”**.

<div align="left"><figure><img src="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2FL2zjVQx7Q8t4rOGzjBXe%2Fconfigurar-horario-da-consulta-automatica-nfs-e-pelo-menu-empresas.png?alt=media&amp;token=e85eb4a0-ab0c-49df-9eff-c24a3695bdfb" alt="" width="563"><figcaption></figcaption></figure></div>

3. Na seção **“Consulta automática"** escolha o horário em que deseja que as consultas de **NFS-e** sejam realizadas.

<div align="left"><figure><img src="https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2FSYaryyEDrZXNLBhC90xe%2Fdefinir-horario-da-consulta-nfs-e.png?alt=media&amp;token=2f67ea57-7b70-46aa-bc2e-a3583409102a" alt="" width="363"><figcaption></figcaption></figure></div>

4. Clique em **Salvar** e está feito, o espião está configurado para fazer consultas automáticas.

![](https://1086762934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqoJpeeYAUN8570QfuPzY%2Fuploads%2FjdctGjyHHqY68IN31tNF%2Fimage.png?alt=media\&token=64a453a3-0689-48ed-ab74-33ecdb6524b6)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ajuda.espiaonfe.com.br/gestao/nfs-e-servico/configuracao/consulta-automatica-nacional.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
