Theta Developer APIs
API Overview
This API is provided for the Theta community to use for free and without warranty. Please do not abuse the API and limit your calls to no more then 1 or 2 per second. Every endpoint can be used with a post or a get. The only exception is the new eth-rpc endpoint, it will only accept a post.ThetaScan has 13 top level categories.
/balance/*
Endpoints that return address balances.
/hash/*
Endpoints that return transaction hash details.
/block/*
Endpoints that return blocks.
/stake/*
Endpoint that returns staking information.
/block_time/*
Endpoint that returns block timing information.
/txn/*
Endpoint that will broadcast a raw signed transaction.
/transactions/*
Endpoints that return transaction information.
/market/*
Endpoints that return the market cap of Theta and TFuel.
/price/*
Endpoints that return the price of Theta, TFuel and TNT-20 tokens.
/contract/*
Endpoints that return the details for a TNT-20 contract or address balance.
/721/*
Endpoints that return the details for a NFT contract.
/eth-rpc
Endpoints that return the ETH RPC for use with Metamask. (only accepts a post)
Get Theta and TFuel Balance for a single Address
This category has 2 endpoints. The first is passing a single address to it. ?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da
It will return the balance of Theta, Theta staked, TFuel, and Tfuel staked /1000000000000000000. The second endpoint is passing a group of address ?multiaddress=address1,address2,address3
Each address must be seperated by a comma and will also return the balance of Theta, Theta staked, TFuel, and Tfuel staked /1000000000000000000..Example:
http://www.thetascan.io/api/balance/?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da
http://www.thetascan.io/api/balance/?multiaddress=0xc15149236229bd13f0aec783a9cc8e8059fb28da,0x0c9a45926a44a6fc9c8b6f9cb45c20483038698c
Get a Transactions By Hash
This category has one endpoint.?hash=0x1ae21d5852c961ca0acff380103e6b914e7d0692c042e6d2fca503e51d63043b
It will return a transactions details. Example:
http://www.thetascan.io/api/hash/?hash=0x1ae21d5852c961ca0acff380103e6b914e7d0692c042e6d2fca503e51d63043b
Get a Block By Block Number
This category has three endpoints. The first is passing no data to it. It will return the most resent block proccessed by the node. The second endpoint is passing a block number ?block=12344
Which will return the specific block requested. The third endpoint will return a grouping of blocks by passing a starting block and an ending block
?start_block=1512000&end_block= 1512100
It is limited to 100 blocks per call. Requesting any more blocks will return nothing.Example:
http://www.thetascan.io/api/block/
http://www.thetascan.io/api/block/?block=12344
http://www.thetascan.io/api/block/?start_block=1512000&end_block=1512100
Get Summary list of Staked Earnings by Address
This category has five endpoints. The first will return the current year by month of staked earnings. ?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da
The second
will return staking earning of the entered year by month. ?address=address&year=2020
The third will return the current amount of Theta staked to a Guardian Node or TFuel staked to an Elite Edge Node.
?node=0x88884a84d980bbfb7588888126fb903486bb8888
The next endpoint will return the current amount of Theta staked to a Guardian Node or TFuel staked to an Elite Edge Node by address staked.
?staketonode=0x88884a84d980bbfb7588888126fb903486bb8888
The last endpoint will return 60 coinbase rewards at a time for an address. Offset = 0 returns 1 to 60, offset=1 returns 61 to 120, etc..
Changing the year will return the 60 most recent to oldest for that year. ?addressdetail=0xc15149236229bd13f0aec783a9cc8e8059fb28da&offset=0&year=2021
Example:
http://www.thetascan.io/api/stake/?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da
http://www.thetascan.io/api/stake/?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da&year=2020
http://www.thetascan.io/api/stake/?node=0x88884a84d980bbfb7588888126fb903486bb8888
http://www.thetascan.io/api/stake/?staketonode=0x80eab22e27d4b94511f5906484369b868d6552d2
http://www.thetascan.io/api/stake/?addressdetail=0xc15149236229bd13f0aec783a9cc8e8059fb28da&offset=0&year=2021
Get Block Times
This category has one endpoint. It will return the average block time for the previous day.Example:
http://www.thetascan.io/api/block_time/
Send a Raw Transaction
This category has one endpoint and will allow a signed raw transaction to be sent over the Theta network.Example:
http://www.thetascan.io/api/txn/?raw=signed transaction
Get Transaction Information
This category has six endpoints. The first one is passing no data it will return the number of transactions for the previous day. The next passing a date ?date=2020-7-25
will return the transactions
count on that specific date. The next endpoint is passing a date range ?start_date=2020-7-25&end_date=2020-8-25
This will return the daily transaction counts
for each day in the range. It does not include the ending date. The next three endpoints return type 2 transactions from a Theta address. Passing only an address
?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da
will return the last 100 transactions for that address. Passing an address and date ?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da&date=2020-8-31
will return all
the transactions on that specific date. The last endpoint is passing an address with a date range ?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da&start_date=2020-7-25&end_date=2020-9-25
It will return up to 1000 transactions in that range.Example:
http://www.thetascan.io/api/transactions/
http://www.thetascan.io/api/transactions/?date=2020-8-25
http://www.thetascan.io/api/transactions/?start_date=2020-7-25&end_date=2020-8-25
http://www.thetascan.io/api/transactions/?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da
http://www.thetascan.io/api/transactions/?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da&date=2020-8-31
http://www.thetascan.io/api/transactions/?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da&start_date=2020-7-25&end_date=2020-9-25
Get Theta Current or Historical Daily Market Cap
This category has three endpoint. The first is passing no data to it. It will return the current market cap of Theta and TFuel. Which is updated every 10 minutes. The second will return the market cap at closing UTC time on a specific date. ?date=2020-8-25
The third will return a range of Theta and TFuel market caps.
?start_date=2020-7-25&end_date=2020-8-25
Example:
http://www.thetascan.io/api/market/
http://www.thetascan.io/api/market/?date=2020-8-25
http://www.thetascan.io/api/market/?start_date=2020-7-25&end_date=2020-8-25
Get Theta Current or Historical Price
This category has three endpoint. The first is passing no data to it. It will return the current price of Theta, TFuel and TNT-20 Tokens. Which is updated every 10 minutes. The second will return the price at closing UTC time on a specific date. ?date=2020-8-25
The third will return a range of Theta and TFuel prices.
?start_date=2020-7-25&end_date=2020-8-25
Example:
http://www.thetascan.io/api/price/
http://www.thetascan.io/api/price/?date=2020-8-25
http://www.thetascan.io/api/price/?start_date=2020-7-25&end_date=2020-8-25
Get Contract Details or Contract Account Balance for TNT-20 Token
This category has two endpoint. The first is passing the contract address. This will return details about the contract such as its name, total supply, and decimal. ?contract=0x2806a488d901922b8c1176e730649b135da1c7db
The second will return the balance of tokens for any address in the contract.
?contract=0x2806a488d901922b8c1176e730649b135da1c7db&address=0x29516d15efd7aedd0e4976d8e461c37318ad7c61
***Note: The balance will be returned with the contract decimal applied.
Example:
http://www.thetascan.io/api/contract/?contract=0x2806a488d901922b8c1176e730649b135da1c7db
http://www.thetascan.io/api/contract/?contract=0x2806a488d901922b8c1176e730649b135da1c7db&address=0x29516d15efd7aedd0e4976d8e461c37318ad7c61
TNT-721 Token Details
This category has six endpoints. The first is passing the contract address and optional index. This will return 500 transaction details for the contract. Changing the index to 1 the next 500 and so on. ?contract=0x4762eba0614a4652250baf328bac5d248310702f&index=0
The second will return 500 NFT transactions for an address and optional index.
?address=0xde508a6712aeae6a4e9643e26cc9e1b2cb1ec98e&type=transactions&index=0
The third end point is passing the address and type as contracts and will return all the NFT contract addresses that an address has interacted with.
?address=0xde508a6712aeae6a4e9643e26cc9e1b2cb1ec98e&type=contracts
The forth endpoint is passing the address and type as list and will return all the NFT owned by that address. It also allows for an optional sort by date or contract.
?address=0xde508a6712aeae6a4e9643e26cc9e1b2cb1ec98e&type=list&sort=date
The fifth endpoint returns how many NFTs an address owns.
?address=0xde508a6712aeae6a4e9643e26cc9e1b2cb1ec98e&type=count
The last endpoint will return all the NFTs an address owns for a specific contract.
?address=0xde508a6712aeae6a4e9643e26cc9e1b2cb1ec98e&?contract=0x4762eba0614a4652250baf328bac5d248310702f
Example:
http://www.thetascan.io/api/721/?contract=0x4762eba0614a4652250baf328bac5d248310702f&index=2
http://www.thetascan.io/api/721/?address=0xde508a6712aeae6a4e9643e26cc9e1b2cb1ec98e&type=transactions&index=1
http://www.thetascan.io/api/721/?address=0xde508a6712aeae6a4e9643e26cc9e1b2cb1ec98e&type=contracts
http://www.thetascan.io/api/721/?address=0xde508a6712aeae6a4e9643e26cc9e1b2cb1ec98e&type=list&sort=contract
http://www.thetascan.io/api/721/?address=0xde508a6712aeae6a4e9643e26cc9e1b2cb1ec98e&type=count
http://www.thetascan.io/api/721/?address=0xde508a6712aeae6a4e9643e26cc9e1b2cb1ec98e&contract=0x06c23c22c19a031a71cc5946349752e13859ee08
Eth-Rpc
This category has twenty six endpoints. For more information on how each endpoint works visit: https://ethereum.org/en/developers/docs/apis/json-rpc/To add this API in to MetaMask click on the current network then choose add network at the bottom of the drop down. After MetaMask opens click Add a network manually at the bottom of the list.
Network name: ThetaScan Mainnet
New RPC URL: https://www.thetascan.io/api/eth-rpc
Chain ID: 361
Currency symbol: TFUEL
Block explorer URL: https://thetascan.io/hash/?hash=
Available Endpoints
eth_chainId
eth_syncing
eth_accounts
eth_protocolVersion
eth_getBlockByHash
eth_getBlockByNumber
eth_blockNumber
eth_getUncleByBlockHashAndIndex
eth_getTransactionByHash
eth_getTransactionByBlockNumberAndIndex
eth_getTransactionByBlockHashAndIndex
eth_getBlockTransactionCountByHash
eth_getTransactionReceipt
eth_getBalance
eth_getStorageAt
eth_getCode
eth_getTransactionCount
eth_getLogs
eth_getBlockTransactionCountByNumber
eth_call
eth_gasPrice
eth_estimateGas
eth_sendRawTransaction
eth_sendTransaction
net_version
web3_clientVersion