Skip to content

Instantly share code, notes, and snippets.

@raddy
Created September 19, 2018 22:37
Show Gist options
  • Select an option

  • Save raddy/64c1121483d85791dccd910451e41204 to your computer and use it in GitHub Desktop.

Select an option

Save raddy/64c1121483d85791dccd910451e41204 to your computer and use it in GitHub Desktop.
Helpers for Nomics API Candles Data
import requests
def nomics_query(q):
API_ROOT = "https://api.nomics.com/"
API_VERSION = "v1"
url = API_ROOT + API_VERSION + '/' + q
return requests.get(url)
def nomics_candles(api_key, interval, currency, start=None, end=None):
q = "candles?key={}&interval={}&currency={}".format(api_key, interval, currency)
if start:
q += "&start={}".format(start)
if end:
q += "&end={}".format(end)
return q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment