Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

News ep #5

Merged
merged 3 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading