A simple crawler for cryptocurrency data from CoinMarketCap.com
Project description
A simlpe currency crawler
Basically, this crawler implements the crawling of specific currency history data on https://coinmarketcap.com, and its output data format can be found on the following page:
The output data is in .csv format:
Basic functionalities
- Get data on the current top 1 to 5000 currencies
- Get data for the currency (currencies) of the given specified name(s)
How to use
For convenience, I have written a simple command line client.
To get the usage of this client, simply input python client.py -h
Examples:
-
To get the data of top 100 currencies of year 2020:
python client.py 2020-01-01 2021-01-01 -l 100You can use
-lor--limitto set the number of currencies you want to crawl, and use-ior--indexto specify the start index:python client.py 2020-01-01 2021-01-01 -l 100 -i 500The code above crawl the data of currencies ranked from 500 to 600.
-
To obtain currency data by name
-
To get the data of Bitcoin of year 2019:
python client.py 2019-01-01 2020-01-01 -n "Bitcoin" -
To get the data of Bitcoin & Cardano, first create a file
test.txt:Bitcoin CardanoThen use
-for--filepython client.py 2019-01-01 2020-01-01 -f ./test.txt
-
-
A currency to ID mapping is stored locally and you can use your own API key to update the local mapping. By default the first 5000 entries are updated, you can change this setting in the source code. Use
-aor--apito do this:python client.py -a <your_api_key>
Cautions
- ⚠️ Python version >= 3.7 required
- ⭕️ If any library missing, use
pip/pip3to install them. - 😭 As this crawler has not been rigorously tested, there may be unexpected bugs. You can issue or pull requests if you have any advice to improve this simple project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file A_Simple_Currency_Data_Crawler-1.0.1-py3-none-any.whl.
File metadata
- Download URL: A_Simple_Currency_Data_Crawler-1.0.1-py3-none-any.whl
- Upload date:
- Size: 49.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3027dd3f7aebaf86c4a84e965fbaa0075597570a4192996a21b34f13727a3054
|
|
| MD5 |
567552a84c1966e66262d381e383d56a
|
|
| BLAKE2b-256 |
40db2472aa09c99664bc637fc004f0ed62f25be5eb8786990e9f8524f467ba26
|