# Search Brazilian tenders with Python and EditalMD

List the open tenders for a term with the Python standard library. No key needed.

EditalMD · Updated 2026-10-14

## Step 1. Copy the script

The script prints the deadline, state, agency and link of each open tender.

```
import json
import urllib.parse
import urllib.request

EDITALMD = "https://editalmd.com/api/busca?"


def licitacoes(termo, uf=""):
    filtros = {"q": termo, "abertas": "1", "limite": "20"}
    if uf:
        filtros["uf"] = uf
    with urllib.request.urlopen(EDITALMD + urllib.parse.urlencode(filtros), timeout=30) as resposta:
        return json.load(resposta)["itens"]


for compra in licitacoes("computador"):
    print(compra["encerramento_proposta"], compra["uf"], compra["orgao"], compra["compra_url"])
```

## Step 2. Run the script

Run python3 editalmd.py and replace the term with your product or service.

[Open the search](https://editalmd.com/en/?q=computador&abertas=1)

[Search Brazilian tenders with Python and EditalMD](https://editalmd.com/en/guias/python)
