Septzzz's picture
Upload folder using huggingface_hub (part 15)
ad89e73 verified
Raw
History Blame Contribute Delete
5.56 kB
import requests
import json
from datetime import date, datetime, timedelta
import os
from typing import Optional, Dict, Union, List
def get_multiple_coin_details_for_your_choice(crypto1_name_crypto2_name_crypto: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"This endpoint gives live detailed information about the current value of multiple cryptocurrencies. Separate coin name using "_" underscore symbol."
"""
url = f"https://crypto-update-live.p.rapidapi.com/multiplecoins/{crypto1_name_crypto2_name_crypto}"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "crypto-update-live.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def get_top_50_cryptocurrencies_details(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"This endpoint gives all the details of the top fifty cryptocurrencies."
"""
url = f"https://crypto-update-live.p.rapidapi.com/top-currency/top_50_details"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "crypto-update-live.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def get_top_100_cryptocurrencies_list(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"This endpoint gives the list of the top hundred cryptocurrencies."
"""
url = f"https://crypto-update-live.p.rapidapi.com/top_100_currency"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "crypto-update-live.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def get_cryptocurrency_details(crypto_name: str, toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"This endpoint gives live detailed information about the current value of a particular cryptocurrency."
"""
url = f"https://crypto-update-live.p.rapidapi.com/currency/{crypto_name}"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "crypto-update-live.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def get_top_100_cryptocurrencies_details(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"This endpoint gives all the details of the top hundred cryptocurrencies."
"""
url = f"https://crypto-update-live.p.rapidapi.com/top-currency/top_100_details"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "crypto-update-live.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def get_latest_news_on_cryptocurrency(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"This endpoint returns all the news regarding cryptocurrency."
"""
url = f"https://crypto-update-live.p.rapidapi.com/news"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "crypto-update-live.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def get_top_50_cryptocurrencies_list(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"This endpoint gives the list of the top fifty cryptocurrencies."
"""
url = f"https://crypto-update-live.p.rapidapi.com/top_50_currency"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "crypto-update-live.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation
def get_top_gainers_losers_list(toolbench_rapidapi_key: str='088440d910mshef857391f2fc461p17ae9ejsnaebc918926ff'):
"""
"This endpoint gives the list of the top gainers and losers."
"""
url = f"https://crypto-update-live.p.rapidapi.com/top-gainers-losers"
querystring = {}
headers = {
"X-RapidAPI-Key": toolbench_rapidapi_key,
"X-RapidAPI-Host": "crypto-update-live.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
try:
observation = response.json()
except:
observation = response.text
return observation