[Python] How can solve: too many values to unpack

Discussão em 'Python' iniciado por Stack, Abril 13, 2025.

  1. Stack

    Stack Membro Participativo

    I need get all the information of this public API, but I have the error 'too many values to unpack' in the second code. I think we can get all the information of 30 million of people in Peru. I don't know if the code is correct. I'm a beginner.

    import requests


    parameter= {"72212376"}
    request = requests.get('https://api.reniec.cloud/dni/',parameter)


    DNI_json = request.json()
    for i in DNI_json[0:300000]:
    print(i['dni'])

    Continue reading...

Compartilhe esta Página