Skip to content

Shineii86/AniNewsAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

100 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📰 Anime News API

Vercel Version Scraping Status License

Last Commit Repo Size GitHub Stars GitHub Forks API Status

🛰️ A powerful, real-time anime news API that aggregates fresh articles from 7+ reliable sources with intelligent caching and advanced date parsing.


✨ What's New in v2.0.0

  • 🆕 2 New Sources: Added Anime Herald and Comic Book
  • 🔧 Fixed Date Parsing: Properly handles all date formats including relative times ("2 hours ago")
  • 🚀 Better Performance: Improved concurrent fetching with retry logic
  • 📡 RSS Fallback: All sources now have RSS fallback when web scraping fails
  • 🏥 Health Check: New /api/health endpoint for monitoring
  • 📊 Statistics: New /api/stats endpoint for cache metrics
  • 🔄 Force Refresh: New refresh=true parameter to bypass cache

📦 Features

  • Real-time Scraping from 7+ sources
  • 🔁 Smart Caching with auto-refresh (10 minutes)
  • 🏷️ Tag Filtering across all sources
  • 📄 Full Article Content by slug
  • 📡 RSS Fallback for reliability
  • 🚀 Concurrent Fetching with retry logic
  • 📅 Advanced Date Parsing (handles "X hours ago", "Yesterday", etc.)
  • 🏥 Health Monitoring endpoint
  • 📊 Cache Statistics endpoint

🗞️ News Sources (7 Total)

Source Description Type Status
Anime News Network Industry-leading anime news Official ✅ Active
Anime Corner Community-driven anime news Community ✅ Active
MyAnimeList Popular anime database news Official ✅ Active
Otaku USA Magazine Anime culture magazine Community ✅ Active
Crunchyroll Official streaming news Official ✅ Active
Anime Herald Anime news and reviews Community 🆕 New
Comic Book Anime and manga coverage Community 🆕 New

📡 API Endpoints

GET /api/news

Returns the latest anime news articles from all sources.

Query Parameters:

Param Type Default Description
limit Number 20 Max articles (1-100)
sort String latest latest or oldest
source String all Filter by source (see below)
refresh Boolean false Force cache refresh

Available Sources:

  • all - All sources (default)
  • ann - Anime News Network
  • animecorner - Anime Corner
  • myanimelist - MyAnimeList
  • otakuusa - Otaku USA Magazine
  • crunchyroll - Crunchyroll
  • animeherald - Anime Herald
  • comicbook - Comic Book

Example Response:

{
  "success": true,
  "data": [
    {
      "title": "New Anime Series Announced for 2026",
      "slug": "ann-new-anime-series-announced-for-2026",
      "source": "Anime News Network",
      "excerpt": "A new anime series has been announced...",
      "date": "2026-04-13T10:30:00.000Z",
      "image": "https://example.com/image.jpg",
      "link": "https://www.animenewsnetwork.com/news/...",
      "tags": ["news", "anime", "2026"]
    }
  ],
  "meta": {
    "total": 20,
    "source": "all",
    "sort": "latest",
    "limit": 20,
    "responseTime": "245ms",
    "timestamp": "2026-04-13T10:30:00.000Z",
    "availableSources": ["all", "ann", "animecorner", "myanimelist", "otakuusa", "crunchyroll", "animeherald", "comicbook"]
  }
}

Example Requests:

GET /api/news?limit=10&sort=latest
GET /api/news?source=ann&limit=5
GET /api/news?source=myanimelist&refresh=true
GET /api/news?limit=50&sort=oldest

GET /api/news/tags

Filter articles by tags or get available tags.

Query Parameters:

Param Type Required Description
tag String No Tag to filter by
source String No Source filter

Examples:

GET /api/news/tags                    # Get all available tags
GET /api/news/tags?tag=official       # Filter by 'official' tag
GET /api/news/tags?tag=news&source=ann # Filter by tag and source

GET /api/news/:slug

Get full article content by slug.

Example:

GET /api/news/ann-new-anime-series-announced-for-2026

GET /api/health

Health check and system status.

Example Response:

{
  "success": true,
  "status": "healthy",
  "uptime": 3600,
  "timestamp": "2026-04-13T10:30:00.000Z",
  "cache": {
    "hits": 150,
    "misses": 25,
    "keys": ["news_all", "news_ann"],
    "ttl": 600
  },
  "version": "2.0.0"
}

GET /api/stats

Cache statistics and performance metrics.


🚀 Quick Start

Deploy to Vercel

Deploy with Vercel

Local Development

# Clone the repository
git clone https://github.com/Shineii86/AniNewsAPI.git
cd AniNewsAPI

# Install dependencies
npm install

# Start development server
npm run dev

# API will be available at http://localhost:3000

🔧 Configuration

Environment Variables

# Optional: Set cache duration (in seconds)
CACHE_TTL=600

# Optional: Set Chrome executable path for Puppeteer
CHROME_EXECUTABLE_PATH=/usr/bin/chromium-browser

Caching Strategy

  • Memory Cache: Fast in-memory storage (10 minutes TTL)
  • File Cache: Persistent disk storage for backup
  • Auto-refresh: Cache automatically refreshes on expiry
  • Force Refresh: Use ?refresh=true to bypass cache

📊 Performance

  • Response Time: ~200-500ms (cached)
  • Concurrent Sources: 7 sources fetched simultaneously
  • Cache Duration: 10 minutes
  • Retry Logic: 3 attempts per source with exponential backoff
  • Timeout: 15 seconds per source

🛠️ Technical Details

Architecture

  • Runtime: Node.js (Vercel Functions / Express)
  • Scraping: Cheerio + Axios + RSS Parser
  • Caching: Node-cache + File system
  • Deployment: Vercel Serverless / Express Server

Error Handling

  • Graceful fallback when sources fail
  • RSS fallback for all sources
  • Detailed error logging
  • Structured error responses
  • Timeout protection (15s per source)

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Adding New Sources

To add a new anime news source:

  1. Create a new scraper in utils/fetchNewSource.js
  2. Follow the existing pattern for data structure
  3. Add the source to api/news.js SOURCES object
  4. Update the README documentation
  5. Test thoroughly

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgments


🔗 Links


💕 Loved My Work?

🚨 Follow me on GitHub

Give a star to this project

Banner

For inquiries or collaborations

Telegram Badge Instagram Badge Pinterest Badge Gmail Badge

Copyright © 2026 Shinei Nouzen All Rights Reserved

Last Commit

Made With ❤️ For The Anime Community

About

Real-time Anime News API that scrapes live articles from Crunchyroll & ANN — supports smart caching, tag filtering, full article content, and Vercel deployment. Built for anime devs.

Topics

Resources

License

Stars

Watchers

Forks

Contributors