Skip to main content

anvisa

Python client and command-line tool for ANVISA's official Consultas Externas API (fila de análise, listas, UDI de dispositivos médicos, termos GMDN, nomes técnicos, assuntos de peticionamento).

uv tool install anvisa   # or: pipx install anvisa

Credentials come from https://api.anvisa.gov.br/ (login Gov.br → Client ID / Client Secret). Write them to ~/.config/anvisa/credentials.env (CLIENT_ID=..., CLIENT_SECRET=..., chmod 600) or export ANVISA_CLIENT_ID / ANVISA_CLIENT_SECRET.

anvisa fila areas
anvisa fila consulta 167
anvisa udi search --nome cateter
anvisa --format json udi get 377
anvisa lista consulta 2141
anvisa nome-tecnico search --size 50
anvisa assunto lista --busca bioequival
from anvisa import Client

with Client.from_env() as anvisa:
    queue = anvisa.fila.consulta(167)
    page = anvisa.udi.search(nomeComercial="cateter", size=50)

What the library handles for you, because ANVISA's spec doesn't say so: a User-Agent that Cloudflare accepts, token caching and renewal (29-minute tokens, no refresh token), a mirror of the gateway's rate limit (burst 25, 1 request/s) so loops never hit 429, 1-based request pages against 0-based responses, required filter keys, and typed exceptions for the validation errors ANVISA reports as HTTP 500.

Full write-up, spec overlay and recorded fixtures: https://github.com/vasfvitor/anvisa-api

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anvisa-0.2.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anvisa-0.2.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file anvisa-0.2.0.tar.gz.

File metadata

  • Download URL: anvisa-0.2.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for anvisa-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a23eaa0f3bbcb99af3982f0b5d7c2f2d0e78ff31cbd5202d0245ceb75ffcc1f2
MD5 2be296ea6a0c9412bd7c61661ec463b9
BLAKE2b-256 05c920fd20e3d555ce838696eb0df2a62d1d92274ae5e84083d702da27d6852f

See more details on using hashes here.

Provenance

The following attestation bundles were made for anvisa-0.2.0.tar.gz:

Publisher: release.yml on vasfvitor/anvisa-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anvisa-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: anvisa-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for anvisa-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8273c4b8b109da21fe6ce71463ae738d2982904524ec95dc9867e844bbde86db
MD5 13a74f99b57de62b43e926fbcfff3025
BLAKE2b-256 26e8ae3cbf2ce7b190ea847485ccae6b60a1aa561e50c00f7a89ec08c20ca993

See more details on using hashes here.

Provenance

The following attestation bundles were made for anvisa-0.2.0-py3-none-any.whl:

Publisher: release.yml on vasfvitor/anvisa-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.0

2 files

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page