Skip to content

Commit

Permalink
Merge pull request #5 from itzmestar/news-ep
Browse files Browse the repository at this point in the history
News ep
  • Loading branch information
itzmestar committed Apr 28, 2024
2 parents 54deffe + 0a75e5e commit 7426263
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,26 @@ from messari import Messari
messari = Messari(key='xxxxxxxxxxxxxxx')
# Get the paginated list of all assets and their metrics and profiles.
# Get a list of all assets and their market caps, sorted by market cap descending.
response = messari.get_all_assets()
# Get the ID, name, symbol, slug, market cap, sector, category, and tags for a single asset.
response = messari.get_asset_by_id(asset_id=asset_id)
# Get market data for a specific asset.
response = messari.get_market_data_by_asset(asset_id=asset_id)
# Get a list ROI data for all assets.
response = messari.get_roi()
# Get a single assets ROI data.
response = messari.get_roi_by_asset(asset_id=asset_id)
# Get a list of market specific data for all markets.
response = messari.get_markets()
# Get a list of exchanges with market data.
response = messari.get_exchanges()
```

-------
Expand Down
2 changes: 1 addition & 1 deletion messari/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__title__ = 'messari'
__description__ = 'Unofficial Messari API client.'
__url__ = 'https://github.com/itzmestar/Messari'
__version__ = '2.0.0'
__version__ = '2.1.0'
__build__ = 0x010001
__author__ = 'Tarique Anwer'
__author_email__ = 'itzmetariq@gmail.com'
Expand Down
28 changes: 27 additions & 1 deletion messari/messari.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def _get(self, endpoint, params=None):

def get_all_assets(self, **query_params):
"""
Get the paginated list of all assets and their metrics and profiles.
Returns a list of all assets and their market caps, sorted by market cap descending.
Each query parameter supports filtering on multiple, comma-separated values.
:param query_params: dict of query parameters to filter the list
:return: JSON response
Expand Down Expand Up @@ -234,3 +235,28 @@ def get_supported_assets(self, **kwargs):
path = f'/intel/v1/assets'

return self._get(path, params=kwargs)

def get_news_feed(self, **kwargs):
"""
Returns a list of all news articles, along with AI-generated summaries for each piece of content.
"""
path = f'/news/v1/news/feed'

return self._get(path, params=kwargs)

def get_news_sources(self, **kwargs):
"""
Returns a list of all news sources. Sources are the publications that Messari monitors.
"""
path = f'/news/v1/news/sources'

return self._get(path, params=kwargs)

def get_news_assets(self, **kwargs):
"""
Returns a list of all assets that have been tagged in news articles.
:return:
"""
path = f'/news/v1/news/assets'

return self._get(path, params=kwargs)

0 comments on commit 7426263

Please sign in to comment.