-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_query.py
25 lines (17 loc) · 858 Bytes
/
make_query.py
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
import requests
from print_data import trending_data_print, print_query_data
def get_top_7():
print(".....................Trending Seven.......................")
top_7 = requests.get("https://api.coingecko.com/api/v3/search/trending")
trending_data_print(top_7.json())
def search_crypto():
print("..........Search for a certain Crypto Currency..........")
query = input("Enter the coin you are looking for: ").strip()
query_data = requests.get(f"https://api.coingecko.com/api/v3/search?{query}")
print_query_data(query_data.json())
def get_curr_list():
print("..........Here is the list of currency. You might need it to make currency exchange..........")
query = requests.get("https://api.coingecko.com/api/v3/simple/supported_vs_currencies").json()
for curr in query:
print(curr,end='\t')
print()