The DailyNews REST API is a JSON REST API built with Node.js, Express, and TypeScript, backed by a MongoDB database. It exposes six endpoints for managing news feed items — including live web scraping from El País and El Mundo on every list request. No authentication is required; all endpoints are public and accept and returnDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/miikorz/DailyNews/llms.txt
Use this file to discover all available pages before exploring further.
application/json.
Base URL
PORT environment variable. All endpoint paths are relative to this base URL.
Endpoints Summary
| Method | Path | Description |
|---|---|---|
GET | /feed | List all feeds (triggers live scraping) |
GET | /feed/:id | Retrieve a single feed by MongoDB ObjectId |
POST | /feed | Create a new feed item |
PUT | /feed/:id | Update an existing feed item by ObjectId |
DELETE | /feed/:id | Remove a feed item by ObjectId |
POST | /feed/search | Search feeds by title substring |
Response Format
Every response — success or error — is wrapped in a consistent JSON envelope. Success responses carry the payload indata and set error to null:
data to null and populate error with a machine-readable code and a human-readable message:
HTTP Status Codes
| Code | Constant | Description |
|---|---|---|
200 | REQUEST_SUCCESSFUL | The request completed successfully |
204 | DELETED_SUCCESSFULLY | The resource was deleted; no content body needed |
400 | BAD_REQUEST | The request was malformed or missing required fields |
404 | NOT_FOUND | The requested feed item does not exist |
500 | INTERNAL_SERVER_ERROR | An unexpected server-side error occurred |
Error Codes
These are the values of theSERVER_STATUS enum used in the error.code field, together with their corresponding SERVER_MESSAGES strings.
error.code | error.message |
|---|---|
INTERNAL_SERVER_ERROR | Unexpected error occurred |
NOT_FOUND | Feed not found |
BAD_REQUEST | Bad request |
DELETED message ("Feed deleted successfully") is returned in the data field on a successful DELETE, not in the error envelope.
There is currently no authentication on any endpoint. All six routes are fully public — no API keys, tokens, or session cookies are required.
Endpoint Pages
GET /feed
List all news feeds. Triggers live scraping of El País and El Mundo before returning the combined stored result set.
GET /feed/:id
Retrieve a single news feed item from MongoDB by its ObjectId.
POST /feed
Create a new news feed item. Requires
title and link.PUT /feed/:id
Partially update an existing news feed item by ObjectId.
DELETE /feed/:id
Remove a news feed item from MongoDB by ObjectId.
POST /feed/search
Case-insensitive title substring search across stored feed items.