Skip to main content

Newsfeeds API

The Newsfeeds API provides endpoints for managing RSS/Atom newsfeeds in Joomla.

Base URL

/api/index.php/v1/newsfeeds

Endpoints Overview

MethodEndpointDescription
GET/newsfeeds/feedsRetrieve all newsfeeds
GET/newsfeeds/feeds/{id}Retrieve specific newsfeed
POST/newsfeeds/feedsCreate 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

ParameterTypeDescription
idintegerNewsfeed 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

FieldTypeDescription
namestringNewsfeed name
linkstringURL to the RSS/Atom feed
catidintCategory ID

Optional fields

FieldTypeDefaultDescription
aliasstringautoURL-friendly name
numarticlesint5Number of articles to show
publishedint1Publication status
descriptionstring""Description
accessint1Access level
languagestring"*"Language code
orderingint0Order

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

ValueStatus
-2Trash
0Unpublished
1Published
2Archived

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
GET /api/index.php/v1/newsfeeds/feeds?filter[search]=news

Feed Formats

The API supports the following feed formats:

FormatDescription
RSS 2.0Most commonly used RSS format
RSS 1.0Older RDF-based format
AtomModern 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