-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
22 lines (15 loc) · 784 Bytes
/
example.py
File metadata and controls
22 lines (15 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from energypriceapi.client import Client
api_key = 'REPLACE_ME'
client = Client(api_key)
result = client.fetchSymbols()
print(result)
result = client.fetchLive(base='USD', currencies=['BRENT','GASOLINE','NATURALGAS','WTI'])
print(result)
result = client.fetchHistorical(date='2021-04-05', base='USD', currencies=['BRENT','GASOLINE','NATURALGAS','WTI'])
print(result)
result = client.convert(from_currency='USD', to_currency='EUR', amount=100, date='2021-04-05')
print(result)
result = client.timeframe(start_date='2021-04-05', end_date='2021-04-06', base='USD', currencies=['BRENT','GASOLINE','NATURALGAS','WTI'])
print(result)
result = client.change(start_date='2021-04-05', end_date='2021-04-06', base='USD', currencies=['BRENT','GASOLINE','NATURALGAS','WTI'])
print(result)