WatchData Documentation
  • 📖Welcome to WatchData Docs
    • 🧩Features
      • ⛓️Blockchain API
      • ⚡Powered API
      • 🪙Price API
    • 💼What products are suitable for our solutions
  • 👋Introduction
    • 🛠️Quick start guide to WatchData!
    • 🤔Why Use WatchData?
    • 💡Supported chains
    • 🛑Error Reference
    • 🏗️Change Log (update)
  • 💎Powered API
    • 🔀Transfers
      • watch_getTransfers
      • watch_getTransfersByAddress
    • 💠Parity
      • parity_getBlockReceipts
    • 🌀Trace
      • trace_transaction
      • trace_block
    • ⏹️Blocks
      • watch_getBlockNumberByTimestamp
    • *️⃣Token API
      • watch_getTokenBalances
      • 🆕watch_getTokenMetadata
    • 🆒Stats
      • watch_getStatsByDay
  • 🕸️Blockchain API's
    • Ethereum API
      • eth_getBlockByHash
      • eth_getBlockByNumber
      • eth_getTransactionCount
      • eth_getTransactionByHash
      • eth_getTransactionReceipt
      • eth_getBlockTransactionCountByHash
      • eth_getBlockTransactionCountByNumber
      • eth_getTransactionByBlockHashAndIndex
      • eth_getTransactionByBlockNumberAndIndex
      • eth_getUncleCountByBlockHash
      • eth_getUncleCountByBlockNumber
      • eth_getLogs
      • eth_call
      • eth_chainId
      • eth_estimateGas
      • eth_gasPrice
      • eth_getBalance
      • eth_getCode
      • net_version
      • eth_getStorageAt
      • eth_sendRawTransaction
      • eth_blockNumber
    • ♨️Polygon API
      • eth_blockNumber - Polygon
      • eth_getBlockByHash - Polygon
      • eth_getBlockByNumber - Polygon
      • eth_getTransactionByHash - Polygon
      • eth_getTransactionCount - Polygon
      • eth_getTransactionReceipt -Polygon
      • eth_getBlockTransactionCountByHash - Polygon
      • eth_getBlockTransactionCountByNumber - Polygon
      • eth_getTransactionByBlockHashAndIndex - Polygon
      • eth_getTransactionByBlockNumberAndIndex - Polygon
      • eth_getUncleCountByBlockHash - Polygon
      • eth_getUncleCountByBlockNumber - Polygon
      • eth_getLogs - Polygon
      • eth_call - Polygon
      • eth_chainId - Polygon
      • eth_estimateGas - Polygon
      • eth_gasPrice - Polygon
      • eth_getBalance - Polygon
      • eth_getCode - Polygon
      • net_version - Polygon
      • eth_getStorageAt - Polygon
      • eth_sendRawTransaction - Polygon
    • Binance Smart Chain API
      • eth_blockNumber (BSC)
      • eth_getBlockByHash (BSC)
      • eth_getBlockByNumber (BSC)
      • eth_getTransactionCount (BSC)
      • eth_getTransactionByHash (BSC)
      • eth_getTransactionReceipt (BSC)
      • eth_getBlockTransactionCountByHash (BSC)
      • eth_getBlockTransactionCountByNumber (BSC)
      • eth_getTransactionByBlockHashAndIndex (BSC)
      • eth_getTransactionByBlockNumberAndIndex (BSC)
      • eth_getUncleCountByBlockHash (BSC)
      • eth_getUncleCountByBlockNumber (BSC)
      • eth_getLogs (BSC)
      • eth_call (BSC)
      • eth_chainId (BSC)
      • eth_estimateGas (BSC)
      • eth_gasPrice (BSC)
      • eth_getBalance (BSC)
      • eth_getCode (BSC)
      • net_version (BSC)
      • eth_getStorageAt (BSC)
      • eth_sendRawTransaction (BSC)
    • Tron API
      • Full Node API Overview
      • Address Utilities
        • CreateAddress
        • GenerateAddress
        • ValidateAddress
      • Transactions
        • CreateTransaction
        • EasyTransferByPrivate
        • EasyTransfer
        • BroadcastHex
        • BroadcastTransaction
      • Accounts
        • AccountPermissionUpdate
        • UpdateAccount
        • GetAccount
        • CreateAccount
      • Account Resources
        • GetAccountNet
        • GetAccountResource
        • UnfreezeBalance
        • FreezeBalance
        • GetDelegatedResource
        • GetDelegatedResourceAccountIndex
      • Query The Network
        • GetBlockByNum
        • GetBlockById
        • GetBlockByLatestNum
        • GetBlockByLimitNext
        • GetNowBlock
        • GetTransactionById
        • GetTransactionInfoById
        • GetTransactionInfoByBlockNum
        • GetNodeInfo
        • GetChainParameters
      • TRC 10 Token
        • GetAssetIssueByAccount
        • GetAssetIssueById
        • GetAssetIssueList
        • GetPaginatedAssetIssueList
        • TransferAsset
        • CreateAssetIssue
        • ParticipateAssetIssue
        • UnfreezeAsset
        • UpdateAsset
        • EasyTransferAsset
        • EasyTransferAssetByPrivate
      • Smart Contracts
        • GetContract
        • TriggerSmartContract
        • TriggerConstantContract
        • DeployContract
        • UpdateSetting
        • UpdateEnergyLimit
        • ClearAbi
      • TRONZ Shielded Smart Contract
        • GetSpendingKey
        • GetExpandedSpendingKey
        • GetAkFromAsk
        • GetNkFromNsk
        • GetIncomingViewingKey
        • GetDiversifier
        • GetZenPaymentAddress
        • GetNewShieldedAddress
        • CreateShieldedContractParameters
        • CreateSpendAuthSig
        • GetTriggerInputForShieldedTrc20Contract
        • ScanShieldedTrc20NotesByIvk
        • ScanShieldedTrc20NotesByOvk
        • IsShieldedTrc20ContractNoteSpent
      • Voting & SRs
        • ListWitnesses
        • CreateWitness
        • UpdateWitness
        • GetBrokerage
        • UpdateBrokerage
        • VoteWitnessAccount
        • GetReward
        • WithdrawBalance
        • GetNextMaintenanceTime
      • Proposals
        • ListProposals
        • GetProposalById
        • ProposalCreate
        • ProposalApprove
        • ProposalDelete
      • DEX Exchange
        • ListExchanges
        • GetExchangeById
        • ExchangeCreate
        • ExchangeInject
        • ExchangeWithdraw
        • ExchangeTransaction
      • Pending Pool
        • GetTransactionListFromPending
        • GetTransactionFromPending
        • GetPendingSize
    • Bitcoin API
      • Blockchain RPCs
        • getbestblockhash
        • getblock
        • getblockchaininfo
        • getblockcount
        • getblockhash
        • getblockheader
        • getblockstats
        • getchaintips
        • getchaintxstats
        • getdifficulty
        • getmempoolancestors
        • getmempooldescendants
        • getmempoolentry
        • getmempoolinfo
        • getrawmempool
        • gettxout
        • gettxoutproof
      • Rawtransactions RPCs
        • analyzepsbt
        • combinepsbt
        • combinerawtransaction
        • converttopsbt
        • createpsbt
        • createrawtransaction
        • decodepsbt
        • decoderawtransaction
        • decodescript
        • finalizepsbt
        • fundrawtransaction
        • getrawtransaction
        • joinpsbts
        • sendrawtransaction
        • testmempoolaccept
        • utxoupdatepsbt
  • 🪙Price API
    • Price API
      • All tickers
      • Current price
  • ⛓️Web3
    • Web3 SDK
      • Web3.js
      • Web3.py
      • Ethers.js
      • Ethereum.rb
  • 🗺️Tutorials and Guides
    • How to guides
      • How Getting Ethereum Account Balance and Transactions
      • How do I add WatchData to MetaMask?
      • How can i Get stats by Day
      • How to get the balance of an ERC-20 token
      • How can i get transfers using watch_getTransfersByAddress?
    • WatchData Price API and how it works?
    • How eth_getLogs works?
  • 🗃️Resources
    • Pricing and Limits
      • Watch Units
    • FAQ
      • General
      • Pricing
      • Privacy
    • Support
    • Community
Powered by GitBook
On this page
  1. Tutorials and Guides

WatchData Price API and how it works?

PreviousHow can i get transfers using watch_getTransfersByAddress?NextHow eth_getLogs works?

Last updated 2 years ago

Easily get accurate prices for cryptocurrencies: WatchData Introduces the

We at WatchData know how dApp developers sometimes need accurate token prices when creating decentralized apps. WatchData users know that WatchData takes dApp development to the next level with its powerful yet easy-to-use backend infrastructure. That’s why we’re now bringing WatchData functionality to token pricing on the blockchain with the WatchData Price API!

What is Price API

It is a convenient API with which you can get rates for more than 2 000 pairs, both for cryptocurrencies and fiat assets. Sound interesting? Next we will tell you how to interact with our API and get this data.

How and what data can I get?

Once you’ve registered, you need to create your key. You can create a key for any blockchain to interact with Price API, it won’t play a role when interacting with API.

The only thing left is to make requests and get the data we need. To do that let’s open Postman and insert our key.

Your url should look like this:

https://price.api.watchdata.io/price/current_price?api_key=your_api_key

Then let’s write a simple query for any pair. For example take DOGE to EUR.

Request example:

{
    "base_symbol": "DOGE",
    "quote_symbol": "EUR"
}

The API worked out the result. Let’s take a look at it

Response example:

{
    "base_symbol": "DOGE",
    "quote_symbol": "EUR",
    "price": 0.1207,
    "created_at": "2022-05-06T07:36:54+00:00"
}
  1. Coinmarketcap

2) Binance

3) Coingecko

As you can see from the screenshot, the price € 0.120…, it differs by a few thousand cents, but this difference is explained by the time spent on searching on the above resources.

You can check hundreds of different pairs and take their actual rates through our API.

Let’s try to get the reverse rate of EUR to DOGE. To do that we just need to swap tickers and make a new request:

Request example:

{
    "base_symbol": "EUR",
    "quote_symbol": "DOGE"
}

Response example:

{
    "base_symbol": "EUR",
    "quote_symbol": "DOGE",
    "price": 8.285004142502071,
    "created_at": "2022-05-06T08:27:08+00:00"
}

Great! We were able to get the reverse rate. From the obtained values, we see that at the time of the request, we can get 8.28 DOGE for 1 EUR.

If you’re building a Web3 application or a dApp that uses token prices, using the WatchData Price API is a must.

The API brings crucial functionality to a wide range of cryptocurrency projects. This includes creating NFT projects, cryptocurrency wallets, various DeFi applications, or any type of dApps that require reliable price information. The ability to get accurate information about the price of almost any token cannot be overstated.

When you work with data from blockchain you can get all kinds of information, for example you can check logs with or if you want you can get the transfers of the token you’re interested in with . But if you need data in the form of prices for your fiat currency, you simply can’t find this data in the blockchain. That is, you will get a lot of useful information, but if you need to put it into a price format, you will have to do extra work.

First, you have to go through the registration steps in our app. You can read a short guide here: , or watch a video here:

From the result, we see that 1 DOGE is offered for 0,1207 EUR as of 05/06/2022. Let’s check if this value is correct. Let’s go to , and to check Dogecoin value to Euro.

🗺️
eth_getLogs
watch_getTransfersByAddress
link to the guide
link to YouTube.
Coinmarketcap
Binance
Coingecko
WatchData Price API