You are here, from the API call with the query param action=getabi
, requesting the ABI of the contract. So it supposed to return the ABI but nothing else, as you have correctly gotten.
Since you need to read a value of a variable in the contract using query param action=eth_call
might do this. Refer this discussion here as well.
UPDATE:
I think, I got it working. I haven't dealt much with etherscan API. But I think this is what you are looking for.
As per the discussion above mentioned, you first need to get the Keccak-256 Hash value of paused()
and get the sub-string of 8 characters and join 0x
to the front => 0x5c975abb
. Then query param data
should set to that. i.e. data=0x5c975abb
.
Then the API url should look like;
https://api.etherscan.io/api?module=proxy&action=eth_call&to=0x4CF488387F035FF08c371515562CBa712f9015d4&data=0x5c975abb&apikey=my-api-key=YourAPIKey
The response I got looked;
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000000000000000000000000000000000001"
}
The result
should be the value of paused which is 1 means true
.