API Documentation
Access Context News data programmatically via our REST API. All endpoints return JSON and support CORS.
Base URL
http://localhost:3000/apiFor authenticated endpoints, include an API key in the Authorization header:
Authorization: Bearer YOUR_API_KEYEndpoints
GET
/api/articlesList articles with pagination, filtering, and search
Parameters
pagenumberPage number (default: 1)limitnumberItems per page (default: 20, max: 100)categorystringFilter by categorysearchstringSearch in title and summarytagstringFilter by tagResponse
{
"articles": [...],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8
}
}GET
/api/articles/:slugGet a single article by slug
Response
{
"id": "...",
"title": "...",
"slug": "...",
"summary": "...",
"content": "...",
"aiSummary": "...",
"source": "...",
"sourceUrl": "...",
"category": "...",
"tags": ["...", "..."],
"publishedAt": "..."
}POST
/api/articlesCreate 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 tagsimageUrlstringImage URLfeaturedbooleanFeatured article flagResponse
{ "id": "...", "title": "...", ... }GET
/api/categoriesList all categories with article counts
Response
{
"categories": [
{ "name": "AI & Machine Learning", "count": 42 },
...
]
}GET
/api/searchFull-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/rssContent-Type: application/rss+xml
Atom 1.0
/feed/atomContent-Type: application/atom+xml
JSON Feed 1.1
/feed/jsonContent-Type: application/feed+json