Skip to content
Davide Santangelo edited this page Jan 15, 2024 · 16 revisions

RSS is a type of web feed that allows users and applications to access updates to online content in a standardized, computer-readable format — RSS Wiki.

All feeds have some of the following properties, with required properties in bold:

Field Description
id The feed's unique UUID.
title The title of the feed.
description The description of the feed.
url the url of the feed.
image the url of image.
created_at The create row DateTime.
updated_at The update row DateTime.
items_count the number of items.
language the language of the feed.
synchronized_at the datetime of last import.

Search

curl -G -H "Authorization: Token {TOKEN}" https://<URL>/api/feeds/search.json -d "q={q}"
{
  "data": [
    {
      "id": "adc84872-567c-4f32-a437-e6d50995ccf6",
      "type": "feed",
      "attributes": {
        "title": "The Guardian",
        "url": "https://www.theguardian.com/uk/rss",
        "description": "Latest news, sport, business, comment, analysis and reviews from the Guardian, the world's leading liberal voice",
        "image": {
          "url": "https://assets.guim.co.uk/images/guardian-logo-rss.c45beb1bafa34b347ac333af2e6fe23f.png",
          "link": "https://www.theguardian.com",
          "title": "The Guardian"
        },
        "language": "en-gb",
        "items_count": 178
      }
    },
    {
      "id": "a10e25e5-9900-4189-a6a4-b83bdfe59b75",
      "type": "feed",
      "attributes": {
        "title": "SitePoint",
        "url": "https://www.sitepoint.com/feed/",
        "description": "Learn CSS | HTML5 | JavaScript | Wordpress | Tutorials-Web Development | Reference | Books and More",
        "image": null,
        "language": null,
        "items_count": 100
      }
    }
  ]
}

List

curl -G -H "Authorization: Token {TOKEN}" https://<URL>/api/feeds.json
{
  "data": [
    {
      "id": "78087019-bba5-4d3c-acfc-e50238bbe693",
      "type": "feed",
      "attributes": {
        "title": "NYT > World News",
        "url": "https://www.nytimes.com/svc/collections/v1/publish/https://www.nytimes.com/section/world/rss.xml",
        "description": "",
        "image": {
          "url": "https://static01.nyt.com/images/misc/NYT_logo_rss_250x40.png",
          "link": "https://www.nytimes.com/section/world",
          "title": "NYT > World News"
        },
        "language": "en-us",
        "items_count": 10
      }
    }
  ]
}

Create

curl -X POST -H "Authorization: Token {TOKEN}" https://<URL>/api/feeds.json -d "url"="{URL}"
{
  "data": {
    "id": "ad5e17a6-01d8-4835-be19-da67ae3be206",
    "type": "task",
    "attributes": {
      "status": "enqueued",
      "task_type": "feed_store",
      "enqueued_at": "2023-03-07T21:37:03.522Z",
      "started_at": null,
      "finished_at": null,
      "error_message": null
    },
    "relationships": {
      "feed": {
        "data": {
          "id": "753b309f-7c55-47a3-9a55-cce5a834b1e2",
          "type": "feed"
        }
      }
    }
  }
}

Show

curl -G -H "Authorization: Token {TOKEN}" https://<URL>/api/feeds/{id}.json
{
  "data": {
    "id": "753b309f-7c55-47a3-9a55-cce5a834b1e2",
    "type": "feed",
    "attributes": {
      "title": "BBC News - Health",
      "url": "https://www.bbc.com/news/health/rss.xml",
      "description": "BBC News - Health",
      "image": {
        "url": "https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif",
        "link": "https://www.bbc.co.uk/news/",
        "title": "BBC News - Health"
      },
      "language": "en-gb",
      "items_count": 33
    }
  }
}

Update

curl -X PATCH -H "Authorization: Token {TOKEN}" https://<URL>/api/feeds/{id}.json
{
  "data": {
    "id": "0035594b-089e-47ab-aa28-1b4336565226",
    "type": "task",
    "attributes": {
      "status": "enqueued",
      "task_type": "feed_update",
      "enqueued_at": "2023-03-08T08:33:47.618Z",
      "started_at": null,
      "finished_at": null,
      "error_message": null
    },
    "relationships": {
      "feed": {
        "data": {
          "id": "753b309f-7c55-47a3-9a55-cce5a834b1e2",
          "type": "feed"
        }
      }
    }
  }
}

Tasks

curl -G -H "Authorization: Token {TOKEN}" https://<URL>/api/feeds/{id}/tasks.json
{
  "data": [
    {
      "id": "f0d8e3cb-3ce8-43a5-a3f9-f37ee4920a91",
      "type": "task",
      "attributes": {
        "status": "succeeded",
        "task_type": "feed_store",
        "enqueued_at": "2023-03-08T14:02:34.151Z",
        "started_at": "2023-03-08T14:02:34.166Z",
        "finished_at": "2023-03-08T14:02:35.064Z",
        "error_message": null
      },
      "relationships": {
        "feed": {
          "data": {
            "id": "c2f5f8e9-65df-4d90-a0d0-3c6859178086",
            "type": "feed"
          }
        }
      }
    }
  ]
}
Clone this wiki locally