The 'getTokenBalances' method return an empty result

I’m trying to get the following result - https://mumbai.polygonscan.com/token/0xe5d19a920146356E9D015CAafD8b83B03f1A10C4#balances.

I need to get the list of address with the wallets via request to API by contract address in json format.
I have tried https://deep-index.moralis.io/api-docs/#/account/getTokenBalances but it return an empty result [].

Does someone knows how to fix it?

That’s a token/contract address. getTokenBalances is for getting the token balances of a wallet address.

I don’t believe Moralis has an endpoint for a token’s holders. Some other APIs may have something for this. Otherwise you may have to query the contract for this info.

Some other APIs may have something for this. Otherwise you may have to query the contract for this info. - how to do that, what exactly do you mean?

Basically it’s not a straightforward thing; there are several steps involved that chain explorers like Polygonscan do to get token holders.

When I say query the contract, I mean get data directly from the blockchain from this contract. There is a method for doing this here: https://ethereum.stackexchange.com/a/54591

There are some other API providers like Covalent and Etherscan/Polygonscan that may have what you’re looking for, I wasn’t able to find one suitable. But what you’re looking for could potentially be done using a combination of different API endpoints.