Skip to content

ChiragBawa-8/newsdata-api-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NewsData.io API Examples

Quick and easy examples to get you started with the newsdata.io API. Fetch news articles, headlines, and crypto updates in just a few lines of Python.

What's Inside

Examples are grouped by the NewsData.io endpoint they demonstrate.

Latest news (latest_api)

  • latest_headlines.py - Get the latest tech news from the US
  • news_with_images.py - Fetch news with images only
  • domain_specific_news.py - Pull articles from specific domains
  • multi_country_news.py - Query several countries/languages at once + deduplicate
  • ai_insights_news.py - Show the AI fields: sentiment, ai_tag, ai_region, ai_org, keywords
  • full_content_pagination.py - Full article body + automatic multi-page pagination

Crypto news (crypto_api)

  • crypto_news.py - Track cryptocurrency-related articles by coin + sentiment
  • crypto_sentiment_tags.py - Filter by coin, crypto AI tags and sentiment
  • crypto_history.py - Historical crypto news over a date range

News archive (archive_api)

  • archive_endpoint.py - Search historical news archives
  • archive_full_content.py - Archive search by category + sentiment over a date range

News sources (sources_api)

  • news_sources.py - Discover which publishers NewsData.io indexes

Market / financial news (market_api)

  • financial_market_news.py - Stock-ticker filtered business news with sentiment

News count (count_api)

  • news_count.py - Article volume over time (trend analytics, no article payload)

Quick Start

  1. Get your API key from newsdata.io

  2. Install dependencies

    pip install -r requirements.txt
  3. Set up your API key

    cp .env.example .env
    # Edit .env and add your API key
  4. Run any example

    python latest_headlines.py

That's It!

Each script is self-contained and shows a different use case. Pick one, run it, and see what you get. Modify the parameters to fit your needs.

Need Help?

Check out the newsdata.io documentation for all available parameters and features.

About

Ready-to-run Python examples for the NewsData.io API — fetch latest headlines, crypto news, image-rich articles, domain-specific feeds, and historical archives using the official newsdataapi SDK.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages