Pricestore API contains endpoints that provide the latest price of a token as well as historical price of the tokens, these tokens can also be LP tokens. Tokens supported from ETH/BSC/Matic chains These api's also provide top losers and gainers.
This API provides the price of the token by taking the symbol of the token(ticker) as a parameter which will give the latest price.
unmarshal.PriceStore
.getPriceBySymbol("marsh")
.then(({data}) => console.log(data))
NOTE: This endpoint gives live prices for all coingecko supported symbols, however historical prices are supported only for Ethereum, BSC, Matic and Arbitrum. Timestamp can also be provided as a query param to get historical data.
Example response
curl -i -X GET \ 'https://api.unmarshal.com/v1/pricestore/:symbol?timestamp=string&auth_key=YOUR_API_KEY_HERE'
[- {
- "name": "UnmarshalToken",
- "symbol": "MARSH",
- "contract": "0x2fa5daf6fe0708fbd63b1a7d1592577284f52256",
- "decimal": 18,
- "blockchain": "binance-smart-chain",
- "price": "1.2102781329",
- "price_change": "-4.611565233778907",
- "timestamp": "1637921913"
}, - {
- "name": "UnmarshalToken",
- "symbol": "MARSH",
- "contract": "0x5a666c7d92e5fa7edcb6390e4efd6d0cdd69cf37",
- "decimal": 18,
- "blockchain": "ethereum",
- "price": "1.2102781329",
- "price_change": "-5.0085795456450315",
- "timestamp": "1637921913"
}
]
This API provides the price of a token by the contract address of the token in any chain.
unmarshal.PriceStore
.getPriceByAddress(Chain.ethereum, "token-address")
.then(({data}) => console.log(data))
NOTE: This endpoint live prices for contracts which are listed in coingecko, however historical prices are supported only for Ethereum. Timestamp can be provided as a query parameter to view historical data.
Example response
curl -i -X GET \ 'https://api.unmarshal.com/v1/pricestore/chain/:priceStoreChains/:address?timestamp=string&24change=string&alternateChain=string&auth_key=YOUR_API_KEY_HERE'
{- "tokenId": "0x5a666c7d92e5fa7edcb6390e4efd6d0cdd69cf37",
- "timestamp": "1637922456",
- "price": "1.2107928183"
}
This API takes multiple contract addresses to provide price data at once. Multiple contracts must be separated by commas (,).
unmarshal.PriceStore
.getMultipleTokenPrice(Chain.ethereum, ["token address 1", "token address 2"])
.then(({data}) => console.log(data))
Note: This endpoint works only for Ethereum, Bsc, Matic and Arbitrum.
Example response
curl -i -X GET \ 'https://api.unmarshal.com/v1/pricestore/chain/:priceStoreChains/tokens?tokens=string&auth_key=YOUR_API_KEY_HERE'
[- {
- "name": "MARSH",
- "symbol": "MARSH",
- "tokenId": "0x5a666c7d92e5fa7edcb6390e4efd6d0cdd69cf37",
- "price": "1.225034898998186",
- "percentage_change": "-5.0085795456450315"
}, - {
- "name": "MARSH",
- "symbol": "MARSH",
- "tokenId": "0x2fa5daf6fe0708fbd63b1a7d1592577284f52256",
- "price": "1.2145698052338922",
- "percentage_change": "-4.611565233778907"
}
]
This API provides a list of the top gainers in a particular chain. Data for the last 24 hours contains the biggest gainers.
unmarshal.PriceStore
.getTopGainers(Chain.ethereum)
.then(({data}) => console.log(data))
Example response
curl -i -X GET \ 'https://api.unmarshal.com/v1/pricestore/chain/:priceStoreChains/gainers?price=string&auth_key=YOUR_API_KEY_HERE'
[- {
- "name": "TEND",
- "contract": "0x222f737285d0b60d8d4f27fa22ce8884c9f119f8",
- "decimal": 18,
- "symbol": "TEND",
- "current_price": "0.00000000015816474482266669",
- "percent_change": "498.2934577237196",
- "day_low": "0.00000000015816474482266669",
- "day_high": "0.00000000015816474482266669"
}, - {
- "name": "GoldenWspp",
- "contract": "0xcccbf2248ef3bd8d475ea5de8cb06e19f4591a8e",
- "decimal": 6,
- "symbol": "GWSPP",
- "current_price": "3.001545737261781",
- "percent_change": "480.88924200974947",
- "day_low": "0.5198768424941629",
- "day_high": "3.049309828651424"
}
]
This API provides a list of the top losers in a particular chain. Data for the last 24 hours contains the biggest losers.
unmarshal.PriceStore
.getTopLosers(Chain.ethereum)
.then(({data}) => console.log(data))
Example response
curl -i -X GET \ 'https://api.unmarshal.com/v1/pricestore/chain/:priceStoreChains/losers?price=string&auth_key=YOUR_API_KEY_HERE'
[- {
- "name": "ShibainuGirl",
- "contract": "0x71ea08cd2476905b4d359b2b18c463e1cacdab20",
- "decimal": 9,
- "symbol": "ShibaGirl",
- "current_price": "0.00000000000006362810175319335",
- "percent_change": "-100",
- "day_low": "0.00000000000006227239148252082",
- "day_high": "0.00000000000006420062168121629"
}, - {
- "name": "LTRBT",
- "contract": "0x17d749d3e2ac204a07e19d8096d9a05c423ea3af",
- "decimal": 9,
- "symbol": "LTRBT",
- "current_price": "0",
- "percent_change": "-100",
- "day_low": "0",
- "day_high": "0"
}
]
This api provides the price for LP tokens by taking in the address of the Lp tokens.
NOTE: This endpoint is supported only for Ethereum.
Example response
curl -i -X GET \ 'https://api.unmarshal.com/v1/pricestore/chain/:priceStoreChains/lptokens?lptokens=string&auth_key=YOUR_API_KEY_HERE'
[- {
- "name": "",
- "symbol": "",
- "tokenId": "0x222f93187f15f354d41ff6a7703ef7e18cdd5103",
- "price": "53.49992784613753",
- "percentage_change": ""
}
]