Giter VIP home page Giter VIP logo

coinmarketcap's Introduction

coinmarketcap

NPM Package Build Status

js-standard-style

API

ticker([options])

Get a list of assets and their info.

  • options (Object) Optional.
    • limit (Number) Only return the top limit assets. Default is to get all assets.
    • convert (String) Return price, 24h volume, and market cap in terms of another currency.

Returns a promise.

Example:

await coinmarketcap.ticker({
  limit: 10,
  convert: 'eur'
})
// [
//     {
//         "id": "bitcoin",
//         "name": "Bitcoin",
//         "symbol": "BTC",
//         "rank": "1",
//         "price_usd": "1030.06",
//         "price_btc": "1.0",
//         "24h_volume_usd": "321117000.0",
//         "market_cap_usd": "16733968488.0",
//         "available_supply": "16245625.0",
//         "total_supply": "16245625.0",
//         "percent_change_1h": "0.52",
//         "percent_change_24h": "-1.01",
//         "percent_change_7d": "-1.77",
//         "last_updated": "1490895549",
//         "price_eur": "960.3403889",
//         "volume_eur": "299382195.855",
//         "market_cap_eur": "15601329830.0"
//     },
//     ... (9 more)
// ]

tickerByAsset(assetID, [options])

Get info about a particular asset.

  • assetID (String) Asset ID (i.e 'bitcoin')
  • options (Object) Optional.
    • convert (String) Return price, 24h volume, and market cap in terms of another currency.

Returns a promise.

Example:

await coinmarketcap.tickerByAsset('bitcoin', { convert: 'eur' })
// {
//     "id": "bitcoin",
//     "name": "Bitcoin",
//     "symbol": "BTC",
//     "rank": "1",
//     "price_usd": "1030.06",
//     "price_btc": "1.0",
//     "24h_volume_usd": "321117000.0",
//     "market_cap_usd": "16733968488.0",
//     "available_supply": "16245625.0",
//     "total_supply": "16245625.0",
//     "percent_change_1h": "0.52",
//     "percent_change_24h": "-1.01",
//     "percent_change_7d": "-1.77",
//     "last_updated": "1490895549",
//     "price_eur": "960.3403889",
//     "volume_eur": "299382195.855",
//     "market_cap_eur": "15601329830.0"
// }

global([options])

Get global info.

  • options (Object) Optional.
    • convert (String) Return 24h volume, and market cap in terms of another currency.

Returns a promise.

Example:

await coinmarketcap.ticker()
// {
//     "total_market_cap_usd": 24854674203.0,
//     "total_24h_volume_usd": 694102237.0,
//     "bitcoin_percentage_of_market_cap": 67.33,
//     "active_currencies": 680,
//     "active_assets": 80,
//     "active_markets": 2817
// }

License

MIT

coinmarketcap's People

Contributors

jprichardson avatar ryanzim avatar fanatid avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.