A modern, real-time cryptocurrency news aggregator with sentiment analysis built with React.js, Chart.js, and the NewsData.io Crypto News API. This project demonstrates how to build a production-grade news tracking application with data visualization and sentiment analysis.
π Get started in seconds β grab a free NewsData.io API key. The free tier gives you 200 API credits/day with no credit card required, and is the only News API with built-in coin tracking across 200+ countries and 89 languages.
- Real-time Crypto News: Fetch latest cryptocurrency news from NewsData.io
- Sentiment Analysis: Automatic sentiment detection (Positive, Negative, Neutral)
- Interactive Charts: Beautiful visualizations using Chart.js
- Sentiment distribution doughnut chart
- Sentiment timeline chart
- Trending Topics: Track popular cryptocurrencies being discussed
- Advanced Filtering: Filter by search query, cryptocurrency, and sentiment
- Responsive Design: Works perfectly on desktop, tablet, and mobile
- Auto-refresh: News updates every 5 minutes automatically
- Modern UI: Dark theme with smooth animations
Live Demo (Coming soon)
- Node.js (v14 or higher)
- npm or yarn
- NewsData.io API key (Get one free here)
git clone https://github.com/newsdata-io/newsdata-crypto-tracker.git
cd newsdata-crypto-trackernpm install
# or
yarn installCreate a .env file in the root directory:
cp .env.example .envEdit .env and add your NewsData.io API key:
REACT_APP_NEWSDATA_API_KEY=your_api_key_here
REACT_APP_NEWSDATA_BASE_URL=https://newsdata.io/api/1
REACT_APP_REFRESH_INTERVAL=300000npm start
# or
yarn startThe app will open at http://localhost:3000
Handles all communication with NewsData.io API:
import { fetchCryptoNews } from './services/api';
const data = await fetchCryptoNews();Visualizations powered by Chart.js:
- Doughnut chart for sentiment distribution
- Line chart for sentiment over time
Beautiful news cards with:
- Article image
- Sentiment badge
- Source and timestamp
- Read more link
The app uses keyword-based sentiment analysis to categorize news as:
- Positive (π): "surge", "rally", "gain", "bullish"
- Negative (π): "crash", "drop", "bearish", "loss"
- Neutral (β): Everything else
Automatically extracts and displays the most mentioned cryptocurrencies:
- Bitcoin, Ethereum, BNB, Cardano, Solana, etc.
- Shows mention count for each topic
News automatically refreshes every 5 minutes (configurable in .env)
GET https://newsdata.io/api/1/crypto?apikey=YOUR_KEY
Response Structure:
{
"status": "success",
"totalResults": 100,
"results": [
{
"article_id": "abc123",
"title": "Bitcoin surges to new high",
"description": "Bitcoin price reaches...",
"link": "https://...",
"pubDate": "2024-02-03 10:30:00",
"source_id": "cryptonews",
"image_url": "https://..."
}
]
}| Variable | Description | Default |
|---|---|---|
REACT_APP_NEWSDATA_API_KEY |
Your NewsData.io API key | Required |
REACT_APP_NEWSDATA_BASE_URL |
API base URL | https://newsdata.io/api/1 |
REACT_APP_REFRESH_INTERVAL |
Auto-refresh interval (ms) | 300000 (5 min) |
npm test
# or
yarn testnpm run build
# or
yarn buildThis creates an optimized production build in the build/ folder.
Contributions are welcome! Please follow these steps:
Solution: Make sure you've created a .env file and added your API key
Solution: Check browser console for errors and verify API key is valid
Solution: Ensure Chart.js dependencies are installed: npm install chart.js react-chartjs-2
This project is licensed under the MIT License - see the LICENSE file for details.
- NewsData.io for providing the crypto news API
- Chart.js for amazing charting library
- React for the powerful UI framework
β Star this repo if you find it helpful!