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

Popular posts from this blog

Quotation marks to wrap an element in HTML

The Basic Structure of a Full-Stack Web App

Unlocking Web Design: A Guide to Mastering CSS Layout Modes