results = []
offset = 0
while True:
r = requests.get(f'https://deep-index.moralis.io/api/v2/nft/0xfcb1315c4273954f74cb16d5b663dbf479eec62e/owners?chain=eth&format=decimal&offset={offset}', headers={'X-API-Key': *****})
data = r.json()
offset += 500
if (len(data["result"])) == 0:
break
results.extend(data['result'])
API Key censored for security.
I am trying to grab a list of every owner of my project with their corresponding token ids with the above Python snippet. For some reason itโs returning duplicates in its response and outright omitting token IDs that should exist. Even stranger, itโs non-deterministic - running the script twice will immediately show different sets of duplicates and omit other random tokens from the output. Is there something Iโm doing wrong here?