The News API surfaces the coffee sector articles displayed in CoffePrice. Articles are auto-aggregated and AI-generated on a scheduled basis, but admins can also create, edit, and clean up records manually. The two read endpoints are public and require no authentication. Base URL:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JaiderT/CoffeePrice/llms.txt
Use this file to discover all available pages before exploring further.
/api/noticias
Rate limiting: Public GET endpoints are rate-limited to prevent abuse. Exceeding the limit returns 429 Too Many Requests.
GET /api/noticias
Returns all news articles sorted by creation date (newest first). An optionalcategoria query parameter filters the results. When this endpoint is called, the platform also asynchronously checks whether new articles need to be fetched — this refresh happens in the background and does not delay the response.
Auth: None (public)
Query parameters
| Parameter | Type | Description |
|---|---|---|
categoria | string | Filter by article category. Accepted values: mercado, produccion, internacional, fnc, clima, consejos, el_pital. |
200 OK — Array of noticia objects.
Response fields
MongoDB ObjectId of the article.
Article headline.
Short summary of the article.
Full article body text.
Name of the original source (e.g., news outlet or agency).
null for AI-generated articles without an explicit source.URL of the original source article, if available.
URL of the article’s cover image.
One of:
mercado, produccion, internacional, fnc, clima, consejos, el_pital.Original publication date of the source article. May be
null for AI-generated content.true if the article was created by the AI generation service.Timestamp when the record was inserted into the database.
Timestamp of the most recent update to the record.
GET /api/noticias/:id
Returns a single news article by its MongoDB ObjectId. Auth: None (public)200 OK — Single noticia object (same fields as the list response above).
Response 404 Not Found
POST /api/noticias
Manually creates a new news article. On success, the platform checks for any active news alert subscriptions and dispatches email notifications to subscribed users matching the article’s category. Auth: Admin onlyRequest body
Article headline.
Short summary of the article content.
Full article body text.
Name of the original source or publication.
URL pointing to the article’s cover image.
Article category. Must be one of:
mercado, produccion, internacional, fnc, clima, consejos, el_pital.201 Created — Returns the newly created noticia object.
Response 400 Bad Request — If required fields are missing or a schema validation fails.
PUT /api/noticias/:id
Updates an existing news article. All fields are optional — only the fields provided in the body are updated. Auth: Admin onlyUpdated headline.
Updated summary.
Updated article body.
Updated source name.
Updated image URL.
Updated category.
200 OK — Returns the updated noticia object.
Response 404 Not Found — If no article exists with the given :id.
DELETE /api/noticias/:id
Permanently deletes a news article. This is a hard delete — the record cannot be recovered. Auth: Admin only200 OK
404 Not Found — If no article exists with the given :id.
POST /api/noticias/generar-automaticas
Triggers the AI-powered news generation pipeline for the current day. The service fetches external coffee-sector sources, summarises them using the configured AI model, and saves the results as new noticia records. Useful for manually triggering a generation cycle outside of the scheduled job. Auth: Admin only200 OK
500 Internal Server Error — If the AI generation service encounters an error.
POST /api/noticias/limpiar-danadas
Scans the news collection for records with broken or missing data (e.g. emptytitulo, malformed sourceUrl, or corrupt auto-generated content) and removes them. Supports a dry-run mode to preview what would be deleted without committing changes.
Auth: Admin only
Request body
If
true, reports the number of suspect records found without deleting them. Default: false.If
true, only evaluates auto-generated articles (autoGenerada: true). Default: true.Maximum number of records to scan in a single run. Default:
150.200 OK (dry run)
200 OK (live run)