-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexamples.py
More file actions
77 lines (50 loc) · 1.82 KB
/
examples.py
File metadata and controls
77 lines (50 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from coinpaprika.client import Client
#
# FREE CLIENT
#
free_client = Client()
# List coins
free_client.coins()
# Get coin by ID (example: btc-bitcoin)
free_client.coin("btc-bitcoin")
# Get tweets by coin ID (max 50 tweets)
free_client.twitter("btc-bitcoin")
# Get coin events by coin ID
free_client.events("btc-bitcoin")
# Get exchanges by coin ID
free_client.exchanges("btc-bitcoin")
# Get markets by coin ID (USD,BTC,ETH,PLN)
free_client.markets("btc-bitcoin", quotes="USD")
# Get 24h OHLC candle (USD,BTC)
free_client.ohlcv("btc-bitcoin")
# Get today OHLC (can change every each request until actual close of the day at 23:59:59)
free_client.today("btc-bitcoin")
# Get people by ID (example: vitalik-buterin)
free_client.people("vitalik-buterin")
# List tags
free_client.tags()
free_client.tags(additional_fields="coins,icos")
# Get tag by ID
free_client.tag("blockchain-service")
# Get tickers for all coins (USD,BTC,ETH)
free_client.tickers()
# Get ticker information for a specific coin (USD,BTC,ETH)
free_client.ticker("btc-bitcoin")
# List exchanges
free_client.exchange_list()
# Get exchange by ID
free_client.exchange("binance", quotes="USD")
# Get markets by exchange ID (USD,BTC,ETH,PLN) with quotes USD
free_client.exchange_markets("binance", quotes="USD")
# Search
free_client.search(q="btc", c="currencies,exchanges,icos,people,tags", modifier="symbol_search", limit=42)
# Price converter
free_client.price_converter(base_currency_id="btc-bitcoin", quote_currency_id="usd-us-dollars", amount=1337)
#
# PRO CLIENT
#
pro_client = Client(api_key="YOUR-API-KEY")
# Get historical OHLCV information for a specific coin (USD,BTC)
pro_client.candles("btc-bitcoin", start="2019-01-11T00:00:00Z")
# Get historical ticker information for a specific coin (USD,BTC,ETH)
pro_client.historical("btc-bitcoin", start="2019-04-11T00:00:00Z")