API Documentation

Access Context News data programmatically via our REST API. All endpoints return JSON and support CORS.

Base URL
http://localhost:3000/api

For authenticated endpoints, include an API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Endpoints

GET/api/articles
List articles with pagination, filtering, and search

Parameters

pagenumberPage number (default: 1)
limitnumberItems per page (default: 20, max: 100)
categorystringFilter by category
searchstringSearch in title and summary
tagstringFilter by tag

Response

{
  "articles": [...],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "totalPages": 8
  }
}
GET/api/articles/:slug
Get a single article by slug

Response

{
  "id": "...",
  "title": "...",
  "slug": "...",
  "summary": "...",
  "content": "...",
  "aiSummary": "...",
  "source": "...",
  "sourceUrl": "...",
  "category": "...",
  "tags": ["...", "..."],
  "publishedAt": "..."
}
POST/api/articles
Create a new article

Parameters

titlestringArticle title (required)
summarystringArticle summary (required)
contentstringFull article content (required)
sourcestringSource name (required)
sourceUrlstringSource URL (required)
categorystringCategory (required)
tagsstring[]Array of tags
imageUrlstringImage URL
featuredbooleanFeatured article flag

Response

{ "id": "...", "title": "...", ... }
GET/api/categories
List all categories with article counts

Response

{
  "categories": [
    { "name": "AI & Machine Learning", "count": 42 },
    ...
  ]
}
GET/api/search
Full-text search across articles

Parameters

qstringSearch query (required)
limitnumberMax results (default: 20)

Response

{ "results": [...], "total": 42 }

Feed Formats

Subscribe to Context News using your preferred feed format:

RSS 2.0

/feed/rss

Content-Type: application/rss+xml

Atom 1.0

/feed/atom

Content-Type: application/atom+xml

JSON Feed 1.1

/feed/json

Content-Type: application/feed+json