How to best call totalSupply() method?

What is the best way for me to determine total supply for an ERC-20 token. Is there an API for this, or do I need to use the generic contract call method? Thank you.

You can call the contract method if the contract implemented it.

I call the method using the following ABI:

{
“inputs”: [],
“name”: “totalSupply”,
“outputs”: [
{
“internalType”: “uint256”,
“name”: “”,
“type”: “uint256”
}
],
“stateMutability”: “view”,
“type”: “function”
}

And I get the following error:
"message": "functionData.inputs is not iterable"

Any thoughts?