How to get NFTs info

Hi. What’s the best way to get info about some NFTs? Say, level or exp of a game character. I’m using a function on the contract that prints it, and using a fetch that POST to Moralis API and runs that function for every ID, something like this:

fetch('https://deep-index.moralis.io/api/v2/<contract>/function?chain=bsc%20testnet&function_name=getInfo',
                {
                    method: "POST",
                    withCredentials: true,
                    headers: {
                        "accept": "application/json",
                        "X-API-Key": "<key>",
                        "Content-Type": "application/json"
                    },
                    body: <abi>, <params>
          }

But it requires interacting with the function for every NFT for every time you reload the page, and it’s quite inefficient, is there a best way?

Check the docs for “sync and watch smart contract events”. Using this you can sync a smart contract function and store the data in the server database.

https://docs.moralis.io/moralis-server/automatic-transaction-sync/smart-contract-events#why-do-we-need-to-sync-and-watch-smart-contract-events

But that only works with events, right? I tried with the function but it doesn’t even appears on the dashboard (with Transfer event it worked). I guess I should emit an event everytime an NFT is created and every time it’s info is updated and register those.

Ideally, every important function execution will have an event that is fired up. So, for most cases, you will have/should have an event at that time