• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
ashryanio

ashryanio

fetchRssForSubcurrent

Public
Like
fetchRssForSubcurrent
Home
Code
2
README.md
H
index.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
5/31/2025
Viewing readonly version of main branch: v10
View latest version
README.md

Substack RSS Feed Fetcher

An HTTP GET endpoint that fetches full RSS files from a list of Substack publications.

Features

  • ✅ Fetches full RSS content from Substack feeds
  • ✅ Supports multiple feeds in a single request
  • ✅ Concurrent fetching for better performance
  • ✅ Error handling with detailed feedback
  • ✅ Flexible input methods (query parameters or hardcoded defaults)
  • ✅ Returns structured JSON with metadata

Usage

Default Behavior

By default, the endpoint fetches the hardcoded example feed:

GET /

Returns RSS content from https://jtbx.substack.com/feed

Custom Feeds via Query Parameters

You can specify custom feeds using the feeds query parameter:

Comma-separated URLs:

GET /?feeds=https://jtbx.substack.com/feed,https://stratechery.substack.com/feed

JSON array format:

GET /?feeds=["https://jtbx.substack.com/feed","https://stratechery.substack.com/feed"]

Response Format

The endpoint returns a JSON response with the following structure:

{ "success": true, "feeds": [ { "url": "https://jtbx.substack.com/feed", "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>...", "fetchedAt": "2025-05-31T18:49:29.163Z", "success": true } ], "errors": [], "totalRequested": 1, "totalSuccessful": 1, "totalFailed": 0, "fetchedAt": "2025-05-31T18:49:29.163Z" }

Response Fields

  • success: Overall success status
  • feeds: Array of successfully fetched feeds
    • url: The RSS feed URL
    • content: Full RSS XML content
    • fetchedAt: Timestamp when the feed was fetched
    • success: Individual feed success status
  • errors: Array of failed feeds with error details
  • totalRequested: Total number of feeds requested
  • totalSuccessful: Number of successfully fetched feeds
  • totalFailed: Number of failed feeds
  • fetchedAt: Overall request timestamp

Error Handling

The endpoint gracefully handles various error scenarios:

  1. Invalid URLs: Returns 400 with error details
  2. Network failures: Individual feed failures are captured in the errors array
  3. Invalid query parameters: Returns 400 with usage examples

Error Response Example

{ "success": false, "error": "Invalid URL: not-a-valid-url", "timestamp": "2025-05-31T18:49:29.163Z" }

Examples

Single Feed

curl "https://your-endpoint.com/?feeds=https://jtbx.substack.com/feed"

Multiple Feeds

curl "https://your-endpoint.com/?feeds=https://jtbx.substack.com/feed,https://stratechery.substack.com/feed"

JSON Array Format

curl "https://your-endpoint.com/?feeds=[\"https://jtbx.substack.com/feed\",\"https://stratechery.substack.com/feed\"]"

Technical Details

  • Built with TypeScript for Val Town
  • Uses concurrent fetching with Promise.all() for performance
  • Validates URLs before making requests
  • Returns full RSS XML content (not parsed)
  • Includes comprehensive error handling and logging
  • CORS enabled for browser usage

Use Cases

  • RSS feed aggregation
  • Content monitoring and analysis
  • Building custom RSS readers
  • Data collection for research
  • Newsletter content backup

Rate Limiting

The endpoint respects standard HTTP rate limiting. For high-volume usage, consider implementing caching or batching strategies.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.