Cryptocurrency historical market price data scraper written in Python.
pip install cryptocmd
to install from the latest source use following command
pip install git+git://github.com/guptarohit/cryptoCMD.git
Following methods are available to get data in multiple formats from https://coinmarketcap.com
from cryptocmd import CmcScraper
# initialise scraper without time interval
scraper = CmcScraper("XRP")
# get raw data as list of list
headers, data = scraper.get_data()
# get data in a json format
xrp_json_data = scraper.get_data("json")
# export the data as csv file, you can also pass optional `name` parameter
scraper.export("csv", name="xrp_all_time")
# Pandas dataFrame for the same data
df = scraper.get_dataframe()
from cryptocmd import CmcScraper
# initialise scraper with coin name as well
scraper = CmcScraper(coin_code="sol", coin_name="solana")
# get raw data as list of list
headers, data = scraper.get_data()
# get data in a json format
solana_json_data = scraper.get_data("json")
# export the data as csv file, you can also pass optional `name` parameter
scraper.export("csv", name="solana_all_time")
# Pandas dataFrame for the same data
df = scraper.get_dataframe()
from cryptocmd import CmcScraper
# initialise scraper with time interval
scraper = CmcScraper("XRP", "15-10-2017", "25-10-2017")
# get raw data as list of list
headers, data = scraper.get_data()
# get data in a json format
json_data = scraper.get_data("json")
# export the data to csv
scraper.export("csv")
# get dataframe for the data
df = scraper.get_dataframe()
Date, Open, High, Low, Close, Volume, Market Cap, Time Open, Time High, Time Low, Time Close
The data is being scrapped from coinmarketcap ✌️ and it's free to use. 🎉
Feel free to make a pull request!
If you found this useful, I'd appreciate your consideration in the below. ✨☕