USA Node

Top Transactions Blocks Staking TNT-20 Tokens Mobile Apps CLI Interface Developer API Broadcast TXN Contact Us Donate Node Status





Node:
   




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 API can be used with the USA node
http://www.thetascan.io
or the Singapore node
http://sg.thetascan.io
These nodes are independent of each other if one goes offline the other is not affected.


Enhanced DDOS protections have been implemented if this is causing your project any problems, feel free to contact us with your ip address so it can be white listed.

ThetaScan has 10 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 and TFuel.

/contract/*
Endpoints that return the details for a contract or address balance.



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, and TFuel /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 and TFuel /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 two endpoint.  The first will 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


Example:
http://www.thetascan.io/api/stake/?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da
http://www.thetascan.io/api/stake/?address=0xc15149236229bd13f0aec783a9cc8e8059fb28da&year=2020

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 and TFuel. 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

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