Skip to content

API Rate Limits #1

@HansHauge

Description

@HansHauge

Hey I just wanted to let you know that the omnichain API is now rate limiting so the full data is not collected. This is the block of code:

pages = 10
params = {"addr": "3MbYQMMmSkC3AgWkj9FMo5LsPTW1zBTwXL"}
s = req.Session()
r1 = s.get("https://www.omniexplorer.info/address/3MbYQMMmSkC3AgWkj9FMo5LsPTW1zBTwXL/10")

transactions = []
for page in np.arange(pages, 0, -1):
    r2 = s.post("https://api.omniexplorer.info/v1/transaction/address/{}".format(page), data=params)
    ans = r2.json()
    for trans in ans["transactions"]:
        if trans["type"] == "Grant Property Tokens" and trans["propertyname"] == "TetherUS" and trans["valid"] == True:
            transactions.append([trans["blocktime"], trans["amount"]])
    time.sleep(0.5)

rate-limit

If we simply change the time.sleep(0.5) to time.sleep(10) the data comes through properly.

Cheers and thanks for your work on this. Very interesting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions