> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrape.st/llms.txt
> Use this file to discover all available pages before exploring further.

# RSS

> Monitor RSS feeds for new content in real-time

Monitor RSS feeds and get notified when new entries are published. Track any public RSS or Atom feed — blog posts, news sites, release notes, and more.

## What You Can Do

| Capability       | Endpoint            | Description                         |
| ---------------- | ------------------- | ----------------------------------- |
| **Track Feed**   | `POST /track/rss`   | Monitor an RSS feed for new entries |
| **List Tracked** | `GET /track/rss`    | List all tracked RSS feeds          |
| **Untrack**      | `DELETE /track/rss` | Stop tracking a feed                |

## Track an RSS Feed

Start monitoring an RSS feed for new entries.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://scrape.st/track/rss \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"sid": "https://blog.example.com/rss"}'
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch("https://scrape.st/track/rss", {
    method: "POST",
    headers: {
      "x-api-key": "YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ sid: "https://blog.example.com/rss" }),
  });
  const data = await res.json();
  ```

  ```python Python theme={null}
  import requests

  res = requests.post(
      "https://scrape.st/track/rss",
      headers={"x-api-key": "YOUR_API_KEY"},
      json={"sid": "https://blog.example.com/rss"},
  )
  print(res.json())
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "data": {
    "id": "src_rss_001",
    "source": "RSS",
    "externalId": "aHR0cHM6Ly9ibG9nLmV4YW1wbGUuY29tL3Jzcw=="
  },
  "message": "Now tracking https://blog.example.com/rss on rss"
}
```

<Note>
  The feed URL is **base64-encoded** internally and stored as the `externalId`.
  You don't need to encode it yourself — just pass the raw URL as the `sid`.
</Note>

## List Tracked Feeds

Retrieve all RSS feeds you are currently tracking.

```bash theme={null}
curl -X GET https://scrape.st/track/rss \
  -H "x-api-key: YOUR_API_KEY"
```

## Stop Tracking

Remove an RSS feed from your tracked sources. You can identify the source by its original URL (`sid`) or its internal ID (`iid`).

<CodeGroup>
  ```bash curl (by URL) theme={null}
  curl -X DELETE https://scrape.st/track/rss \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"sid": "https://blog.example.com/rss"}'
  ```

  ```bash curl (by internal ID) theme={null}
  curl -X DELETE https://scrape.st/track/rss \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"iid": "src_rss_001"}'
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch("https://scrape.st/track/rss", {
    method: "DELETE",
    headers: {
      "x-api-key": "YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ sid: "https://blog.example.com/rss" }),
  });
  const data = await res.json();
  ```

  ```python Python theme={null}
  import requests

  res = requests.delete(
      "https://scrape.st/track/rss",
      headers={"x-api-key": "YOUR_API_KEY"},
      json={"sid": "https://blog.example.com/rss"},
  )
  print(res.json())
  ```
</CodeGroup>

## How It Works

<Note>
  RSS feeds are **polled periodically**. New entries trigger webhooks and stream
  events just like other sources — there is no difference in how you consume the
  data.
</Note>

## Webhook Event Shape

When a tracked feed publishes a new item, your webhook receives a `SourceEvent` object. This is the exact shape sent via `JSON.stringify` to your webhook URL:

```json theme={null}
{
  "mid": "posts-42",
  "sid": "aHR0cHM6Ly90aGVibG9jay5jby9yc3M",
  "source": "rss",
  "timestamp": 1712072400000,
  "content": "Short summary of the feed item…",
  "images": [],
  "payload": {
    "id": "https://blog.example.com/posts/42",
    "title": "Post Title",
    "link": "https://blog.example.com/posts/42",
    "pubDate": "2024-04-02T15:30:00.000Z",
    "author": "Jane Doe",
    "summary": "Short summary of the feed item…",
    "feedUrl": "https://blog.example.com/rss"
  }
}
```

| Field       | Type   | Description                                     |
| ----------- | ------ | ----------------------------------------------- |
| `mid`       | string | Message ID — the item GUID, or its link if none |
| `sid`       | string | Source ID — the feed URL                        |
| `source`    | string | `"rss"`                                         |
| `timestamp` | number | Unix timestamp (ms) when the event was received |
| `content`   | string | Item summary (`contentSnippet`)                 |
| `images`    | array  | Always empty — RSS items carry no images        |
| `payload`   | object | Full `RssData` object (see fields above)        |

## Delivery Methods

RSS events are delivered through all the same channels as other sources:

* **[Webhooks](/rest-api-reference/create-webhook)** — Push to your endpoint
* **[WebSocket](/streams/websocket-connections)** — Real-time bidirectional stream
* **[SSE](/streams/public-sse)** — Server-sent events with auto-reconnect

## API Reference

* [Create Tracking](/rest-api-reference/create-tracking) — `POST /track/rss`
* [List Tracked Sources](/rest-api-reference/list-tracking) — `GET /track/rss`
* [Delete Tracking](/rest-api-reference/delete-tracking) — `DELETE /track/rss`
