Skip to main content

A python wrapper for the Nomics API

Project description

nomics-python

A Python wrapper for the Nomics API

Disclaimer

Although the api call descriptions are from the official documentation, this is an unofficial API wrapper.

Contents

Getting Started

Before using the Nomics API, sign up for a free API key here.

Every api call requires this api key. Make sure to use this key when getting started.

import nomics
api_key = "This-Is-A-Fake-Key-123"
nomics = nomics.Nomics(api_key)

Code Examples

Here are a few calls that this package provides. For more detailed information, please see the associated Nomics API documentation.

  • Prices
    • get_currencies
    • get_prices
  • Markets
    • get_markets
    • get_market_cap_history
    • get_dashboard
  • Candles
    • get_candles

Prices

Input

No parameters

nomics.get_currencies()

Output

['0XBTC', '1ST', '2GIVE', '3DES', 'ABA'...]
  • get_prices - Returns current prices for all currencies

Input

No parameters

nomics.get_prices()

Output

[
    {
        'currency': 'BTC', 
        'price': '3438.52345'
    }, {
        'currency': 'BTCP', 
        'price': '0.86186'
    }
    ...
]

Input

No parameters

nomics.get_all_time_highs()

Output

[...
    {
        "currency": "ZCASHC",
        "price": "0.07839",
        "timestamp": "2018-02-06T00:00:00Z",
        "exchange": "idex",
        "quote": "ETH"
    },
    {
        "currency": "ZCL",
        "price": "251.65683",
        "timestamp": "2018-01-07T00:00:00Z",
        "exchange": "bittrex",
        "quote": "BTC"
    },
...]
  • get_supplies_interval - Open and close supply information for all currencies between a customizable time interval.

Input

Required Parameters:

  • start: Start time of the interval in isoformat

Optional Parameters:

  • end: End time of the interval in isoformat

Output

[...
    {
        "currency": "ZCL",
        "open_available": "3733950.0",
        "open_max": "21000000.0",
        "open_timestamp": "2018-04-13T23:59:09Z",
        "close_available": "3957150.0",
        "close_max": "21000000.0",
        "close_timestamp": "2018-05-14T23:59:09Z"
    },
    {
        "currency": "ZEC",
        "open_available": "3695469.0",
        "open_max": null,
        "open_timestamp": "2018-04-13T23:59:09Z",
        "close_available": "3917444.0",
        "close_max": null,
        "close_timestamp": "2018-05-14T23:59:09Z"
    },
...]

Input

Required Parameters:

  • start: Start time of the interval in isoformat

Optional Parameters:

  • end: End time of the interval in isoformat

Output

[...
    {
        "currency": "ZRC",
        "volume": "324545.48154",
        "open": "1.02354",
        "open_timestamp": "2018-04-14T00:00:00Z",
        "close": "0.82488",
        "close_timestamp": "2018-05-14T00:00:00Z"
    },
    {
        "currency": "ZRX",
        "volume": "637316758.59933",
        "open": "0.69419",
        "open_timestamp": "2018-04-14T00:00:00Z",
        "close": "1.55195",
        "close_timestamp": "2018-05-14T00:00:00Z"
    },
...]

Markets

  • get_markets - Returns information on the exchanges and markets that Nomics supports, in addition to the Nomics currency identifiers for the base and quote currency.

Input

Optional Parameters:

  • exchange: Nomics exchange ID to filter by
  • base: Comma separated list of base currencies to filter by
  • quote: Comma separated list of quote currencies to filter by
nomics.get_markets(exchange = "binance", base = "BTC,ETH,LTC,XMR", quote = "BTC,ETH,BNB")

Output

[
    {
        'exchange': 'binance', 
        'market': 'ETHBTC', 
        'base': 'ETH', 
        'quote': 'BTC'
    }, {
        'exchange': 'binance', 
        'market': 'LTCBTC', 
        'base': 'LTC', 
        'quote': 'BTC'
    }, ...
]
  • get_market_cap_history - Returns the total market cap for all cryptoassets at intervals between the requested time period.

Input

Required Parameters:

  • start: Start time of the interval in isoformat

Optional Parameters:

  • end: End time of the interval in isoformat
nomics.get_market_cap_history(start = '2019-01-01', end = '2019-01-03')

Output

[
    {
        'timestamp': '2019-01-01T00:00:00Z', 
        'market_cap': '129069743869'
    }, {
        'timestamp': '2019-01-02T00:00:00Z', 
        'market_cap': '133550203583'
    }, {
        'timestamp': '2019-01-03T00:00:00Z', 
        'market_cap': '128268414469'}
]
  • get_dashboard - Returns a high level view of the current state of the market.

Input

No parameters

nomics.get_dashboard()

Output

[
    ... {
        'currency': 'BTC', 
        'dayOpen': '3511.99577900', 
        'dayVolume': '99792173.77561706', 
        'dayOpenVolume': '110587082.15678930', 
        'weekOpen': '3456.85794661', 
        'weekVolume': '1239234754.79406981', 
        'weekOpenVolume': '1148015971.33757139', 
        'monthOpen': '3858.41231750', 
        'monthVolume': '6443576407.76799557', 
        'monthOpenVolume': '11701713847.30718734', 
        'yearOpen': '8164.13564882', 
        'yearVolume': '234521217323.90533474', 
        'yearOpenVolume': '324699677804.24397743', 
        'close': '3454.32472322', 
        'high': '24436.29525153', 
        'highTimestamp': '2018-01-05T00:00:00Z', 
        'highExchange': 'bithumb', 
        'highQuoteCurrency': 'KRW', 
        'availableSupply': '17517750', 
        'maxSupply': '21000000'
    }, ...
]

Candles

Aggregated Candles

Input

Required Parameters:

  • interval: Time interval of the candle (Has to be one of the following values: "1d", "4h", "1h", "30m", "5m", "1m")
  • currency: Currency ID

Optional Parameters:

  • start: Start time of the interval in isoformat
  • end: End time of the interval in isoformat
nomics.get_candles(interval = "1d", currency = "BTC", start = "2018-01-01", end = "2018-01-03")

Output

[
    {
        'timestamp': '2018-01-01T00:00:00Z', 
        'low': '13493.21831', 
        'open': '14071.16898', 
        'close': '13549.53608', 
        'high': '13793.07961', 
        'volume': '1490453543'
    }, {
        'timestamp': '2018-01-02T00:00:00Z', 
        'low': '14421.69036', 
        'open': '14275.23107', 
        'close': '14789.29684', 
        'high': '14416.79422', 
        'volume': '3048511009'
    }, ...
]

Exchange Candles

Input

Required Parameters:

  • interval: Time interval of the candle (Has to be one of the following values: "1d", "4h", "1h", "30m", "5m", "1m")
  • exchange: Exchange ID
  • market: Market ID

Optional Parameters:

  • start: Start time of the interval in isoformat
  • end: End time of the interval in isoformat
nomics.get_candles(interval = "1d", exchange = "binance", market = "BTCUSDT", start = "2018-01-01", end = "2018-01-03")

Output

[
    {
        'timestamp': '2018-01-01T00:00:00Z', 
        'low': '12750.00000000', 
        'open': '13715.65000000', 
        'close': '13380.00000000', 
        'high': '13818.55000000', 
        'volume': '8609.91584400', 
        'num_trades': '99182'
    }, {
        'timestamp': '2018-01-02T00:00:00Z', 
        'low': '12890.02000000', 
        'open': '13382.16000000', 
        'close': '14675.11000000', 
        'high': '15473.49000000', 
        'volume': '20078.09211100', 
        'num_trades': '165673'
    }, ...
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nomics-python-1.1.1.tar.gz (7.1 kB view details)

Uploaded Source

File details

Details for the file nomics-python-1.1.1.tar.gz.

File metadata

  • Download URL: nomics-python-1.1.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.9.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2

File hashes

Hashes for nomics-python-1.1.1.tar.gz
Algorithm Hash digest
SHA256 d003ed7453855b8b09873ff95991ed7d50fc5e6e743424a2059c9e63c3a608e1
MD5 1c8ca1d6f7c13e24ead4cb1372cd8fc1
BLAKE2b-256 6ae77bfd3e3573b065ae3f4ffa4521a595fda8437b0d1be396dea029a72c8873

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page