Modern web application for searching and analyzing news articles with AI-powered classification.
- 🔍 Search Any Topic - Search for any news topic across 17+ categories
- 🤖 AI Classification - Automatic analysis with OpenAI (gpt-4o-mini)
- 🌍 17 News Categories - Business, Technology, Sports, Health, and more
- 📊 Export Options - Download results as JSON, CSV, or Excel
- 🌙 Dark Mode - Toggle between light and dark themes
- 📜 Search History - View the 50 most recent searches (shared across users)
- ⚡ Real-Time Updates - Live progress tracking with status updates
- 🔧 Custom API Settings - Support for Azure OpenAI and custom base URLs
- 🚀 Multi-User Ready - Each user provides their own API keys
pip install -r requirements.txtpython main.pyThen open: http://localhost:8000
You'll need two API keys (entered in the browser UI):
- NewsData.io - Get free key (200 requests/day)
- OpenAI - Get API key
Your keys are stored only in your browser's localStorage and never on the server.
- Enter API Keys - Add your NewsData.io and OpenAI keys
- Search Query - Enter any topic (e.g., "Quantum Computing", "Climate Change")
- Configure Filters - Select language, country, and category (optional)
- Analyze - Click "Search & Analyze" and watch real-time progress
- View Results - Browse classified articles with AI insights
- Export - Download results in your preferred format
OpenNewsAgent/
├── main.py # FastAPI application entry point
├── config.py # Application configuration
├── models.py # Pydantic data models
├── services/
│ ├── news_fetcher.py # NewsData.io API integration
│ ├── ai_analyzer.py # OpenAI classification service
│ └── job_manager.py # Job state management
├── static/
│ └── index.html # Single-page web UI
├── results/ # Job results storage (JSON files)
└── requirements.txt # Python dependencies
- ✅ No Server Storage - API keys are only stored in your browser
- ✅ Per-Request - Keys are sent with each request, never persisted
- ✅ Multi-User - Each user provides their own keys
- ✅ Your Cost - You pay for your own OpenAI/NewsData.io usage
17 News Categories:
- Top Stories
- Business
- Entertainment
- Environment
- Food
- Health
- Politics
- Science
- Sports
- Technology
- Tourism
- World
- Crime
- Domestic
- Education
- Lifestyle
- Other
- Languages: English, German, Spanish, French, Italian, and more
- Countries: US, UK, Germany, France, and 50+ others
Support for Azure OpenAI or custom OpenAI-compatible endpoints:
-
Standard OpenAI (default):
- Leave "API Base URL" empty
- Uses
https://api.openai.com/v1
-
Azure OpenAI:
- Enter your Azure OpenAI base URL (e.g.,
https://your-resource.openai.azure.com/openai) - Check ✅ "This is an Azure OpenAI endpoint"
- Set API Version (e.g
2024-10-21) - Enter your Azure API key
- Use your deployment name as the model (not the base model name)
- Enter your Azure OpenAI base URL (e.g.,
-
Custom Endpoints:
- Enter your custom base URL
- Keep Azure checkbox unchecked for OpenAI-compatible APIs
- NewsData.io: 200 API calls/day
- OpenAI: Varies by account (pay-as-you-go)
Interactive API docs available at: http://localhost:8000/api/docs
POST /api/search- Start a new search jobGET /api/jobs- List recent jobs (limit: 50)GET /api/jobs/{job_id}- Get job detailsGET /api/jobs/{job_id}/results- Get analysis resultsGET /api/jobs/{job_id}/download- Download results (JSON/CSV/Excel)
No database required - stores results as JSON files.
Or connect your repo to your hosting provider of choice:
- Choose a host (GitHub Actions, Render, Fly, Heroku, or your own server)
- Push the repository to your chosen provider or configure CI to run
pip install -r requirements.txtandpython main.py - Ensure environment variables or secrets for API keys are set per-hosting provider documentation
After deployment, users can access your app and enter their own API keys.
- Backend: FastAPI 0.124.4 (async Python)
- AI: OpenAI 2.11.0 (AsyncOpenAI)
- News API: NewsData.io
- Data Export: Pandas 2.3.3, openpyxl
- Web Server: Uvicorn 0.38.0
- Frontend: Vanilla JavaScript (no framework)
MIT License - see LICENSE file for details.
