Search Brazilian tenders with Python and EditalMD
List the open tenders for a term with the Python standard library. No key needed.
Updated
1Copy 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"])2Run the script
Run python3 editalmd.py and replace the term with your product or service.