Skip to main content

Library for fetching coin/token historical data, trends, tweets and more.

Project description PyPI PyPI - License PyPI - Downloads


Karpet is a tiny library with just a few dependencies for fetching coins/tokens metrics data from the internet.

It can provide following data:

  • coin/token historical price data (no limits)

  • google trends for the given list of keywords (longer period than official API)

  • twitter scraping for the given keywords (no limits)

  • much more info about crypto coins/tokens (no rate limits)

What is upcoming?

  • Reddit metrics

  • Have a request? Open an issue ;)


Library uses a few nifty dependencies and is Python 3.6+ only. There is no need to install dependencies you don’t need. Therefore this library utilizes extras which install optional dependencies:

  • for Google trends - google

  • for Twitter scraping - twitter


  1. Install the library via pip.

pip install karpet  # Basics only
pip install karpet[twitter]  # For Twitter scraping
pip install karpet[google]  # For Google trends
pip install karpet[twitter,google]  # All features
  1. Import the library class first.

from karpet import Karpet


Retrieves historical data.

k = Karpet(date(2019, 1, 1), date(2019, 5, 1))
df = k.fetch_crypto_historical_data(symbol="ETH")  # Dataframe with historical data.

                 price   market_cap total_volume
2019-01-01  131.458725  1.36773e+10  1.36773e+10
2019-01-02  138.144802  1.43923e+10  1.43923e+10
2019-01-03  152.860453  1.59222e+10  1.59222e+10
2019-01-04  146.730599  1.52777e+10  1.52777e+10
2019-01-05  153.056567  1.59408e+10  1.59408e+10


Retrieves exchange list.

k = Karpet()
['DigiFinex', 'KuCoin', 'CryptoBridge', 'Bitbns', 'CoinExchange']


Retrieves crypto news.

k = Karpet()
news = k.fetch_news("btc")  # Gets 10 news.
   'url': ' ....',  # Truncated.
   'title': 'Shell Invests in Blockchain-Based Energy Startup',
   'description': 'The world’s fifth top oil and gas firm, Shell, has...',  # Truncated.
   'date': datetime.datetime(2019, 7, 28, 9, 24, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))
   'image': ''  # Truncated.
news = k.fetch_news("btc", limit=30)  # Gets 30 news.


Retrieves top crypto news in 2 categories:

  • Editor’s choices - articles picked by editors

  • Hot stories - articles with most views

k = Karpet()
editors_choices, top_stories = k.fetch_top_news()
   'url': '',  # Truncated.
   'title': 'Bank of China’s New Infographic Shows Why Bitcoin Price Is Going Up',
   'date': datetime.datetime(2019, 7, 27, 10, 7, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
   'image': '', # Truncated.
   'description': 'The Chinese central bank released on its website an ...'  # Truncated.
   'url': '',  # Truncated.
   'title': 'Bitcoin Price Shuns Volatility as Analysts Warn of Potential Drop to $7,000',
   'date': datetime.datetime(2019, 7, 27, 10, 7, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
   'image': ''  # Truncated.
   'description': 'Stability around $10,600 for Bitcoin price is ...'  # Truncated.


Resolves coin ID’s based on the given symbol (there are coins out there with identical symbol).

Use this to get distinctive coin ID which can be used as id param for method fetch_crypto_historical_data().

k = Karpet()



  • new method get_coin_ids()

  • method fetch_crypto_historical_data() has id param now


  • migrated to API (no API key needed anymore)


  • migrated to API (you need an API key now)

  • requirements are now managed by Poetry


  • added fetch_top_news() method for top crypto news separated in 2 categories


  • fetch_news() adds new “description” item and renames “image_url” to “image”

  • all fetch_news() item properties are now presented even if they are None


  • simplified import from from karpet.karpet import Karpet to from karpet import Karpet


  • added fetch_news() method for retrieving crypto news


  • added fetch_exchanges() method for retrieving symbol exchange list

  • removed obsolete library dependency


  • twitter scraping added


  • initial release


This is my personal library I use in my long-term project. I can pretty much guarantee it will live for a long time then. I will add new features over time and I more than welcome any help or bug reports. Feel free to open an issue or merge request.

The code is is licensed under MIT license.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

karpet-0.3.3.tar.gz (13.0 kB view hashes)

Uploaded source

Built Distribution

karpet-0.3.3-py3-none-any.whl (10.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page