Build a Python news application that fetches real-time headlines and articles using NewsAPI and GNews API. Get top trending stories by topic or country.
The Python News Application is a simple yet powerful command-line tool that allows users to fetch the latest news and headlines in real-time using the NewsAPI and GNews API.
Users can choose between two modes:
News Mode: Enter a topic (e.g., “technology”, “sports”, “politics”) and get the latest published articles from around the world.
Headlines Mode: Fetch the top headlines for a specific country using its ISO country code (e.g., us for the USA, pk for Pakistan).
This project demonstrates how Python interacts with REST APIs, handles JSON data, and presents it in a readable format. It’s perfect for learning about API integration, HTTP requests, and data parsing in real-world applications.
⚙️ Features
Fetches real-time news using NewsAPI or GNews API
User input for custom topics or country-based headlines
Displays up to 10 latest headlines with numbering
Clean command-line interface
Easy to modify or extend with GUI later
🧠 Technologies Used
Python
Requests Library (for API communication)
NewsAPI & GNews API (for fetching real-time news data)
JSON Parsing
Project Preview
Ready to Grow Your Business Online?
Let’s chat and discover how our all-in-one digital solutions can help you attract, engage, and convert more customers.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.