Look up CNPJ records with Python and Radar CNPJ
Read the free record of each CNPJ in a list with the Python standard library. No key needed.
Updated
1Copy the script
The script reads each record and prints the company name and status.
import json
import urllib.request
RADAR = "https://radar-cnpj.com/api/cnpj/"
def ficha(cnpj):
limpo = "".join(c for c in cnpj if c.isalnum()).upper()
with urllib.request.urlopen(RADAR + limpo, timeout=20) as resposta:
return json.load(resposta)["data"]
for cnpj in ["00000000000191"]:
empresa = ficha(cnpj)
print(empresa["cnpjFormatted"], empresa["razaoSocial"], empresa["situacao"]["label"])2Run the script
Run python3 radar.py and replace the list with your CNPJs.