Newsfeeds API
The Newsfeeds API provides endpoints for managing RSS/Atom newsfeeds in Joomla.
Base URL
/api/index.php/v1/newsfeeds
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
| GET | /newsfeeds/feeds | Retrieve all newsfeeds |
| GET | /newsfeeds/feeds/{id} | Retrieve specific newsfeed |
| POST | /newsfeeds/feeds | Create new newsfeed |
| PATCH | /newsfeeds/feeds/{id} | Update newsfeed |
| DELETE | /newsfeeds/feeds/{id} | Delete newsfeed |
Retrieve all newsfeeds
GET /api/index.php/v1/newsfeeds/feeds
Response
{
"data": [
{
"type": "newsfeeds",
"id": "1",
"attributes": {
"name": "Joomla News",
"alias": "joomla-news",
"link": "https://www.joomla.org/announcements.feed",
"catid": 5,
"numarticles": 5,
"published": 1,
"description": "Official Joomla announcements",
"language": "*"
}
}
]
}
Retrieve specific newsfeed
GET /api/index.php/v1/newsfeeds/feeds/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
| id | integer | Newsfeed ID |
Example
curl -X GET "https://yoursite.com/api/index.php/v1/newsfeeds/feeds/1" \
-H "X-Joomla-Token: YOUR_API_TOKEN"
Create newsfeed
POST /api/index.php/v1/newsfeeds/feeds
Request Body
{
"name": "Tech News",
"alias": "tech-news",
"link": "https://example.com/feed.rss",
"catid": 5,
"numarticles": 10,
"published": 1,
"description": "Latest tech news",
"access": 1,
"language": "*"
}
Required fields
| Field | Type | Description |
|---|---|---|
| name | string | Newsfeed name |
| link | string | URL to the RSS/Atom feed |
| catid | int | Category ID |
Optional fields
| Field | Type | Default | Description |
|---|---|---|---|
| alias | string | auto | URL-friendly name |
| numarticles | int | 5 | Number of articles to show |
| published | int | 1 | Publication status |
| description | string | "" | Description |
| access | int | 1 | Access level |
| language | string | "*" | Language code |
| ordering | int | 0 | Order |
Example
curl -X POST "https://yoursite.com/api/index.php/v1/newsfeeds/feeds" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "BBC News",
"link": "http://feeds.bbci.co.uk/news/rss.xml",
"catid": 5,
"numarticles": 10
}'
Update newsfeed
PATCH /api/index.php/v1/newsfeeds/feeds/{id}
Request Body
{
"numarticles": 15,
"description": "Updated description"
}
Example
curl -X PATCH "https://yoursite.com/api/index.php/v1/newsfeeds/feeds/1" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"numarticles": 15
}'
Delete newsfeed
DELETE /api/index.php/v1/newsfeeds/feeds/{id}
Example
curl -X DELETE "https://yoursite.com/api/index.php/v1/newsfeeds/feeds/1" \
-H "X-Joomla-Token: YOUR_API_TOKEN"
Newsfeed States
| Value | Status |
|---|---|
| -2 | Trash |
| 0 | Unpublished |
| 1 | Published |
| 2 | Archived |
Newsfeed Categories
Newsfeeds are organized in categories.
Retrieve categories
GET /api/index.php/v1/newsfeeds/categories
Create category
POST /api/index.php/v1/newsfeeds/categories
{
"title": "Technology Feeds",
"alias": "technology-feeds",
"description": "RSS feeds about technology"
}
Filtering
By category
GET /api/index.php/v1/newsfeeds/feeds?filter[catid]=5
By publication status
GET /api/index.php/v1/newsfeeds/feeds?filter[published]=1
Search
GET /api/index.php/v1/newsfeeds/feeds?filter[search]=news
Feed Formats
The API supports the following feed formats:
| Format | Description |
|---|---|
| RSS 2.0 | Most commonly used RSS format |
| RSS 1.0 | Older RDF-based format |
| Atom | Modern alternative to RSS |
tip
Verify that the feed URL is correct and accessible before creating a newsfeed. Invalid URLs will cause errors when displaying.
Example: Add multiple feeds
# Add multiple feeds in a script
feeds=(
"https://feeds.bbci.co.uk/news/technology/rss.xml|BBC Tech"
"https://rss.nytimes.com/services/xml/rss/nyt/Technology.xml|NYT Tech"
)
for feed in "${feeds[@]}"; do
IFS='|' read -r url name <<< "$feed"
curl -X POST "https://yoursite.com/api/index.php/v1/newsfeeds/feeds" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"name\": \"$name\", \"link\": \"$url\", \"catid\": 5}"
done