Problems with getTokenIdOwners

Im using the function “getTokenIdOwners”, and in my colecction i have two NFTs, ID 0 and ID 1. When i called this function it only gives me the info of 1 of the 2 NFTs that i have, sometimes give me the owner info of the NFT with ID = 0, and sometimes give me the owner info of the NFT with ID = 1. But also gives me a error on the console: POST https://vu3yo6ri4duj.usemoralis.com:2053/server/functions/getTokenIdOwners 400 moralis.js:53806

Also, i went to the smart contract and i mint one of this NFTs to an other owner, and when i used the getTokenIdOwners fuction it doesnt update, so when the function gives me the info of the owners, its not correct, its returning me ONLY the first mint that i did 2 days ago, and not the new mint that i did 2 hours ago, maybe this info es good for help me.

thanks for your time :wink:

This is the console, the second error is okay, im folowing the “Ultimate NFT Programming Tutorial - Full Course” of moralis channel, and im in the minute 1:28:00 , this error also appears to the teacher so is not relevant. I think the problem is on the first error.

that error says that you make too many requests in a second, it is a rate limit error

also, we have some problems with rinkeby in particular now and you may get slower responses, or maybe timeout (seen as CORS errors in console)

it looks like you use a cloud function there, maybe it depends on the code from that cloud function on what it returns

it shouldn’t return different output for same parameters

this is the code of the cloud function

that function seems to extract the metadata for a particular token id that is received as parameter as nftId

is there a problem with what that function returns?

Im checking and the function returns well the metada

Okay maybe the result of the “getTokenIdOwners” is wrong because you are having issues with rinkeby, but how can i solve the problem of the rate-limited, in the video has the same code and doesnt apper the error. Ty for all

for the rate limit, try to add a delay of 1 second between requests, or make fewer requests


Can you try to consol log “options” before passing it to getTokenIdOwners. So we can test the parameter separately with getTokenIdOwners function to see what is cause the error 400.