News API Client in Python
from newsapi import NewsApiClient
news_api = NewsApiClient(api_key="YOURAPIKEY")
# YOURAPIKEY get from https://newsapi.org/ by making an account first
top_headlines = news_api.get_top_headlines(q="amazon")
# q represents keywords or phrases that NEWS must contain
print(top_headlines)
all_articles = news_api.get_everything(q="amazon")
print(all_articles)
sources = news_api.get_sources()
print(sources)
Comments
Post a Comment
Write something to CodeWithAbdur!