Created
September 19, 2018 22:37
-
-
Save raddy/64c1121483d85791dccd910451e41204 to your computer and use it in GitHub Desktop.
Helpers for Nomics API Candles Data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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={}¤cy={}".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