in this project i used coinmrketcap API to pull crypto currency Data , the analysis mainly foucesed on the most famous cryptos
- Bitcoin
- Tether (usdt)
- Etheruem
- BNB Samrt chain
- PYTHON
- Jupyter Notebook
- API
- REQUESTS
- PANDAS : Data manipulation library
- MATPLOTLIB : Data Visualization library
- SEABORN : For Complex Visuals
- The analysis process started by Generating an API key from Coinmarketcap.com to pull the data
- Then used Requests ibrary to specify the parameters to get specific data
- then created a fuction for the pull request code
from requests import Request, Session
from requests.exceptions import ConnectionError, Timeout, TooManyRedirects
import json
url = 'https://pro-api.coinmarketcap.com./v1/cryptocurrency/listings/latest'
parameters = {
'start':'1',
'limit':'15',
'convert':'USD'
}
headers = {
'Accepts': 'application/json',
'X-CMC_PRO_API_KEY': '0d329fba-1910-4e7d-8ed3-7689bb45be33',
}
session = Session()
session.headers.update(headers)
try:
response = session.get(url, params=parameters)
data = json.loads(response.text)
print(data)
except (ConnectionError, Timeout, TooManyRedirects) as e:
print(e)def api_call () :
global df
url = 'https://pro-api.coinmarketcap.com./v1/cryptocurrency/listings/latest'
parameters = {
'start':'1',
'limit':'15',
'convert':'USD'
}
headers = {
'Accepts': 'application/json',
'X-CMC_PRO_API_KEY': '0d329fba-1910-4e7d-8ed3-7689bb45be33',
}
session = Session()
session.headers.update(headers)
try:
response = session.get(url, params=parameters)
data = json.loads(response.text)
print(data)
except (ConnectionError, Timeout, TooManyRedirects) as e:
print(e)
df2=pd.json_normalize(data['data'])
df2['timestamp']=pd.to_datetime('now')
df=df.append(df2)
## Creatin a csv file to Store The data
if not os.path.isfile(r'F:\DATA ANALYSIS\portfolio projects\Python project\Api and automation project') :
df.to_csv(r'F:\DATA ANALYSIS\portfolio projects\Python project\Api and automation project',header='column names')
else :
df.to_csv(r'F:\DATA ANALYSIS\portfolio projects\Python project\Api and automation project',mode='a',header=False)# the Automation Code
from time import sleep
for i in range(100):
api_call()
sleep(20)
exit()- Price
- Market capitalization
- Volume
- Circulating and total supply
- Summary statistics for each coin.
- Historical price trends: Line plots to visualize price movements over time.
- Market dominance: Percentage of market capitalization by a specific coin (e.g., Bitcoin dominance).
Objective: To analyze trends and patterns in cryptocurrency prices and volume over time.
- Key Metrics: Historical prices, volumes, and market cap.
- patterns over specific time frames (daily, weekly, monthly).
Objective: To examine relationships between different cryptocurrencies or between cryptocurrencies and traditional financial markets (stocks, commodities).
- Key Metrics: Prices of multiple cryptocurrencies.
- Correlation matrix: Compute correlation coefficients between different cryptocurrencies to see which coins move together.
The descriptive, time series, and correlation analysis of Bitcoin, Tether (USDT), BNB, and Ethereum has provided meaningful insights into the cryptocurrency market dynamics. The t with Bitcoin and Ethereum exhibited significant price fluctuations over time, while Tether (USDT), as a stablecoin, maintained relative price stability.
Correlation analysis revealed key relationships among these cryptocurrencies. Bitcoin and Ethereum showed a strong positive correlation, indicating that they tend to move in tandem, likely due to their prominence in the market. BNB, though also correlated, demonstrated unique trends tied to its specific use within the Binance ecosystem. Meanwhile, Tether's low correlation with the other assets affirmed its role as a stablecoin used for hedging against market volatility.
In conclusion, the analysis underscores the interrelationships between major cryptocurrencies, particularly Bitcoin and Ethereum, while highlighting Tether's function as a stabilizing force in an otherwise volatile market. These insights can inform trading strategies and risk management approaches in the evolving crypto space