Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python: Request large payload from URL

I am trying to get data from a URL using Python. The code I am using is this:

response = requests.get(
                url="https://api.covalenthq.com/v1/"+Chain_id+"/address/"+Address+"/transactions_v2/?    key=API_KEY",
            headers={
                "Authorization": "Basic AUTHORIZATION",
            },
        )
result = response.json()
result = result['data']['items']

So I am entering a Chain_id and wallet address in the URL to get all the transactions for that pair. However, I only get the latest 100 transactions at most. Is there a way to get all transactions? Is there a parameter I can add to requests to get all the data points?

For example, putting this wallet address, 0x60b86AF869f23aEb552fB7F3CaBD11B829f6Ab2F, into etherscan.io (https://etherscan.io/address/0x60b86af869f23aeb552fb7f3cabd11b829f6ab2f), you can see that there are over 51000 transactions however I only get the latest 100.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

This is not a problem with requests, it’s a limitation from the API itself.

Looking into the API docs they say they have a limit of 100 request per page.

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading