{"openapi":"3.0.0","info":{"version":"1.0.0","title":"News API","description":"A professional news API built with Hono, Cloudflare Workers, and Drizzle ORM. Features comprehensive article management with AI-powered content processing, pagination, filtering, and real-time statistics.","contact":{"name":"API Support","email":"support@newsapi.com"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"/","description":"Current environment"}],"tags":[{"name":"Info","description":"API information and health endpoints"},{"name":"Articles","description":"News article management and retrieval"},{"name":"Categories","description":"Article category management"},{"name":"Feeds","description":"RSS feed source management"},{"name":"Statistics","description":"Article and system statistics"}],"components":{"schemas":{},"parameters":{}},"paths":{"/":{"get":{"summary":"API Information","description":"Get comprehensive information about the News API including available endpoints and features","tags":["Info"],"responses":{"200":{"description":"API information retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"API name","example":"News API"},"version":{"type":"string","description":"API version","example":"1.0.0"},"description":{"type":"string","description":"API description","example":"A professional news API built with Hono, Cloudflare Workers, and Drizzle ORM"},"features":{"type":"array","items":{"type":"string"},"description":"API features","example":["Article management","AI-powered content processing","Real-time statistics"]},"endpoints":{"type":"object","properties":{"swagger":{"type":"string","description":"Swagger UI endpoint","example":"/swagger"},"docs":{"type":"string","description":"OpenAPI specification endpoint","example":"/doc"},"articles":{"type":"string","description":"Articles API endpoint","example":"/api/articles"}},"required":["swagger","docs","articles"]}},"required":["name","version","description","features","endpoints"]}}}}}}},"/health":{"get":{"summary":"Health check","description":"Check if the API and database connections are working properly","tags":["Info"],"responses":{"200":{"description":"API is healthy and operational","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"Health status","example":"ok"},"timestamp":{"type":"string","description":"Current timestamp","example":"2025-06-17T10:00:00Z"},"database":{"type":"string","description":"Database connection status","example":"connected"}},"required":["status","timestamp","database"]}}}},"500":{"description":"API health check failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message","example":"Something went wrong"}},"required":["error"]}}}}}}},"/message":{"get":{"summary":"Get a greeting message","description":"Returns a simple greeting message (legacy endpoint for backward compatibility)","tags":["Info"],"responses":{"200":{"description":"Successful response with greeting message","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"A greeting message","example":"Hello Hono!"}},"required":["message"]}}}}}}},"/api/articles":{"get":{"summary":"Get news articles with pagination and filtering","description":"Retrieve a paginated list of news articles with optional filtering by category, status, feed, search terms, and date range.","tags":["Articles"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"category","in":"query"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"feedName","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["pubDate","createdAt","title"],"default":"pubDate"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sortOrder","in":"query"},{"schema":{"type":"string"},"required":false,"name":"dateFrom","in":"query"},{"schema":{"type":"string"},"required":false,"name":"dateTo","in":"query"},{"schema":{"type":"string"},"required":false,"name":"includeInactive","in":"query"}],"responses":{"200":{"description":"Successfully retrieved articles","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"aiSummary":{"type":"string","nullable":true},"keyPoints":{"type":"string","nullable":true},"businessImpact":{"type":"string","nullable":true},"technicalAspect":{"type":"string","nullable":true},"environmentalAspect":{"type":"string","nullable":true},"otherAspects":{"type":"string","nullable":true},"attractiveTitle":{"type":"string","nullable":true,"description":"AI-generated clickable title"},"seoSlug":{"type":"string","nullable":true,"description":"AI-generated SEO-friendly slug"},"aiProcessedAt":{"type":"string","nullable":true,"description":"ISO 8601 date string"},"category":{"type":"string","nullable":true}},"required":["id","aiSummary","keyPoints","businessImpact","technicalAspect","environmentalAspect","otherAspects","attractiveTitle","seoSlug","aiProcessedAt","category"]}},"pagination":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"totalPages":{"type":"number"},"hasNext":{"type":"boolean"},"hasPrev":{"type":"boolean"}},"required":["page","limit","total","totalPages","hasNext","hasPrev"]}},"required":["data","pagination"]}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}}}}},"/api/articles/{id}":{"get":{"summary":"Get article by ID","description":"Retrieve a single news article by its unique identifier.","tags":["Articles"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Successfully retrieved article","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"link":{"type":"string"},"pubDate":{"type":"string","nullable":true,"description":"ISO 8601 date string"},"category":{"type":"string"},"feedName":{"type":"string"},"feedUrl":{"type":"string"},"author":{"type":"string","nullable":true},"guid":{"type":"string","nullable":true},"status":{"type":"string"},"isNotScrappable":{"type":"boolean","nullable":true},"retryCount":{"type":"number","nullable":true},"maxRetries":{"type":"number","nullable":true},"fullContent":{"type":"string","nullable":true},"contentFetchedAt":{"type":"string","nullable":true,"description":"ISO 8601 date string"},"contentLength":{"type":"number","nullable":true},"aiSummary":{"type":"string","nullable":true},"keyPoints":{"type":"string","nullable":true},"businessImpact":{"type":"string","nullable":true},"technicalAspect":{"type":"string","nullable":true},"environmentalAspect":{"type":"string","nullable":true},"otherAspects":{"type":"string","nullable":true},"attractiveTitle":{"type":"string","nullable":true,"description":"AI-generated clickable title"},"seoSlug":{"type":"string","nullable":true,"description":"AI-generated SEO-friendly slug"},"aiProcessedAt":{"type":"string","nullable":true,"description":"ISO 8601 date string"},"lastProcessedAt":{"type":"string","nullable":true,"description":"ISO 8601 date string"},"createdAt":{"type":"string","description":"ISO 8601 date string"},"updatedAt":{"type":"string","description":"ISO 8601 date string"}},"required":["id","title","description","link","pubDate","category","feedName","feedUrl","author","guid","status","isNotScrappable","retryCount","maxRetries","fullContent","contentFetchedAt","contentLength","aiSummary","keyPoints","businessImpact","technicalAspect","environmentalAspect","otherAspects","attractiveTitle","seoSlug","aiProcessedAt","lastProcessedAt","createdAt","updatedAt"]}}}},"400":{"description":"Invalid article ID","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}}}}},"/api/articles/slug/{slug}":{"get":{"summary":"Get article by SEO slug","description":"Retrieve a specific article using its SEO-friendly slug. This is useful for creating human-readable URLs.","tags":["Articles"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Article retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"link":{"type":"string"},"pubDate":{"type":"string","nullable":true,"description":"ISO 8601 date string"},"category":{"type":"string"},"feedName":{"type":"string"},"feedUrl":{"type":"string"},"author":{"type":"string","nullable":true},"guid":{"type":"string","nullable":true},"status":{"type":"string"},"isNotScrappable":{"type":"boolean","nullable":true},"retryCount":{"type":"number","nullable":true},"maxRetries":{"type":"number","nullable":true},"fullContent":{"type":"string","nullable":true},"contentFetchedAt":{"type":"string","nullable":true,"description":"ISO 8601 date string"},"contentLength":{"type":"number","nullable":true},"aiSummary":{"type":"string","nullable":true},"keyPoints":{"type":"string","nullable":true},"businessImpact":{"type":"string","nullable":true},"technicalAspect":{"type":"string","nullable":true},"environmentalAspect":{"type":"string","nullable":true},"otherAspects":{"type":"string","nullable":true},"attractiveTitle":{"type":"string","nullable":true,"description":"AI-generated clickable title"},"seoSlug":{"type":"string","nullable":true,"description":"AI-generated SEO-friendly slug"},"aiProcessedAt":{"type":"string","nullable":true,"description":"ISO 8601 date string"},"lastProcessedAt":{"type":"string","nullable":true,"description":"ISO 8601 date string"},"createdAt":{"type":"string","description":"ISO 8601 date string"},"updatedAt":{"type":"string","description":"ISO 8601 date string"}},"required":["id","title","description","link","pubDate","category","feedName","feedUrl","author","guid","status","isNotScrappable","retryCount","maxRetries","fullContent","contentFetchedAt","contentLength","aiSummary","keyPoints","businessImpact","technicalAspect","environmentalAspect","otherAspects","attractiveTitle","seoSlug","aiProcessedAt","lastProcessedAt","createdAt","updatedAt"]}}}},"400":{"description":"Invalid SEO slug","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}},"404":{"description":"Article not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}}}}},"/api/articles/stats":{"get":{"summary":"Get article statistics","description":"Retrieve comprehensive statistics about the news articles including counts by status, category, and processing state.","tags":["Articles","Statistics"],"responses":{"200":{"description":"Successfully retrieved article statistics","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"},"byStatus":{"type":"object","additionalProperties":{"type":"number"}},"byCategory":{"type":"object","additionalProperties":{"type":"number"}},"withAiSummary":{"type":"number"},"withFullContent":{"type":"number"},"recentArticles":{"type":"number"}},"required":["total","byStatus","byCategory","withAiSummary","withFullContent","recentArticles"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}}}}},"/api/categories":{"get":{"summary":"Get all article categories","description":"Retrieve all available article categories with their article counts.","tags":["Categories"],"responses":{"200":{"description":"Successfully retrieved categories","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"count":{"type":"number"}},"required":["category","count"]}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}}}}},"/api/feeds":{"get":{"summary":"Get all feed sources","description":"Retrieve all RSS feed sources with their article counts.","tags":["Feeds"],"responses":{"200":{"description":"Successfully retrieved feed sources","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"feedName":{"type":"string"},"feedUrl":{"type":"string"},"count":{"type":"number"}},"required":["feedName","feedUrl","count"]}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}}}}},"/api/articles/{id}/related":{"get":{"summary":"Get related articles","description":"Retrieve articles related to a specific article based on category and other factors. Excludes the current article from results.","tags":["Articles"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Successfully retrieved related articles","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"aiSummary":{"type":"string","nullable":true},"keyPoints":{"type":"string","nullable":true},"businessImpact":{"type":"string","nullable":true},"technicalAspect":{"type":"string","nullable":true},"environmentalAspect":{"type":"string","nullable":true},"otherAspects":{"type":"string","nullable":true},"attractiveTitle":{"type":"string","nullable":true,"description":"AI-generated clickable title"},"seoSlug":{"type":"string","nullable":true,"description":"AI-generated SEO-friendly slug"},"aiProcessedAt":{"type":"string","nullable":true,"description":"ISO 8601 date string"},"category":{"type":"string","nullable":true}},"required":["id","aiSummary","keyPoints","businessImpact","technicalAspect","environmentalAspect","otherAspects","attractiveTitle","seoSlug","aiProcessedAt","category"]}},"count":{"type":"number"},"articleId":{"type":"number"}},"required":["data","count","articleId"]}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}},"404":{"description":"Base article not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["error"]}}}}}}}}}