An open-source TypeScript wrapper for the the CoinGecko API
Installations
npm install @crypto-coffee/coingecko-api
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
14.20.1
NPM Version
6.14.17
Score
73.3
Supply Chain
98
Quality
78
Maintenance
50
Vulnerability
81.3
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Developer
michael-siek
Download Statistics
Total Downloads
6,065
Last Day
5
Last Week
40
Last Month
114
Last Year
1,334
GitHub Statistics
2 Stars
40 Commits
2 Watching
5 Branches
2 Contributors
Bundle Size
29.05 kB
Minified
9.56 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.2.0
Package Id
@crypto-coffee/coingecko-api@1.2.0
Unpacked Size
61.58 kB
Size
14.25 kB
File Count
16
NPM Version
6.14.17
Node Version
14.20.1
Total Downloads
Cumulative downloads
Total Downloads
6,065
Last day
66.7%
5
Compared to previous day
Last week
66.7%
40
Compared to previous week
Last month
78.1%
114
Compared to previous month
Last year
-27.5%
1,334
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Dev Dependencies
8
CoinGecko API TypeScript Wrapper
An open-source TypeScript wrapper for the the CoinGecko API
Installation
1npm install @crypto-coffee/coingecko-api
Usage Example
1import CoinGeckoApi from '@crypto-coffee/coingecko-api' 2 3;(async () => { 4 try { 5 const coinGeckoApi = new CoinGeckoApi() 6 const results = await coinGeckoApi.simple({ 7 ids: 'Bitcoin', 8 vs_currencies: 'usd' 9 }) 10 console.log(results) 11 } catch (err) { 12 // do something with the error 13 } 14})()
Endpoints
We have supplied the majority of CoinGecko's API. The available endpoints are supplied below:
Ping
1const result = await coinGeckoApi.ping()
/simple/price
1// Single id 2const results = await coinGeckoApi.simple({ 3 vs_currencies: 'usd' 4 id: 'bitcoin' 5}) 6// Multiple ids 7const results = await coinGeckoApi.simple({ 8 vs_currencies: 'usd' 9 id: ['bitcoin', 'Ethereum'] 10})
/simple/token_price/{id}
1// single contract_address 2const results = await coinGeckoApi.simpleTokenPrice({ 3 'binance-smart-chain', { 4 contract_addresses: '0x00', 5 vs_currencies: 'usd' 6 } 7}) 8// Multiple contract_addresses 9const results = await coinGeckoApi.simpleTokenPrice({ 10 'binance-smart-chain', { 11 contract_addresses: ['0x00', '0x001'], 12 vs_currencies: 'usd' 13 } 14})
/simple/supported_vs_currencies
1const results = await coinGeckoApi.supportedCurrencies()
​/coins​/list
1const results = await coinGeckoApi.coinList()
​/coins​/markets
1const results = await coinGeckoApi.coinMarkets({ vs_currency: 'usd' })
​/coins​/{id}
1const results = await coinGeckoApi.coinMarkets({ id: 'bitcoin' })
​/coins​/{id}​/tickers
1const results = await coinGeckoApi.coinTickers('bitcoin', { 2 exchange_ids: 'binance' 3}) 4 5const { data, request } = await coinGeckoApi.coinTickers('bitcoin', { 6 exchange_ids: 'binance' 7})
​/coins​/{id}​/history
1const results = await coinGeckoApi.coinHistory('bitcoin', '30-12-2017', { 2 localization: false 3}) 4const results = await coinGeckoApi.coinHistory('bitcoin', '30-12-2017')
​/coins​/{id}​/market_chart
1const results = await coinGeckoApi.coinMarketChart('bitcoin', { 2 vs_currency: 'usd', 3 days: '1' 4})
​/coins​/{id}​/market_chart​/range
1const results = await coinGeckoApi.coinMarketChartRange('bitcoin', { 2 vs_currency: 'usd', 3 from: '1392577232', 4 to: '1422577232' 5})
​/coins​/{id}​/ohlc
1const results = await coinGeckoApi.coinOHLC('bitcoin', {
2 vs_currency: 'usd',
3 days: 7
4})
​
/coins​/{id}​/contract​/{contract_address}
1const results = await coinGeckoApi.contractInformation( 2 'binance-smart-chain', 3 '0x00' 4)
/coins​/{id}​/contract​/{contract_address}​/market_chart​/
1const results = await coinGeckoApi.contractMarketChart( 2 'binance-smart-chain', 3 '0x00', 4 { 5 vs_currency: 'usd', 6 days: '1' 7 } 8)
/coins​/{id}​/contract​/{contract_address}​/market_chart​/range
1const results = await coinGeckoApi.contractMarketChartRange( 2 'binance-smart-chain', 3 '0x00', 4 { 5 vs_currency: 'usd', 6 from: '1619881896', 7 to: '1619968296' 8 } 9)
/asset_platforms
1const results = await coinGeckoApi.assetPlatforms()
/coins​/categories​/list
1const results = await coinGeckoApi.categoriesList()
/coins​/categories
1const results = await coinGeckoApi.categoriesListMarketData()
/exchanges
1const results = await coinGeckoApi.exchangesList()
/exchanges​/list
1const results = await coinGeckoApi.exchangesList()
/exchanges​/{id}
1const results = await coinGeckoApi.exchangesById('binance')
/exchanges​/{id}​/tickers
1const results = await coinGeckoApi.exchangeTickers('binance')
/exchanges​/{id}​/volume_chart
1const results = await coinGeckoApi.exchangesVolumeChart('binance', 1)
Contributions
This package is maintained by Zidious(Gabe) and Michael. If any of the endpoints that are supplied by CoinGecko and are not in this package please only an issue and we will get them added as soon as possible.
:coffee: :coffee:
No vulnerabilities found.
No security vulnerabilities found.
Gathering detailed insights and metrics for @crypto-coffee/coingecko-api