FeedAPI

by krismuniz

GitHub Readme.md

FeedAPI

Code-Style:Standard License:MIT

FeedAPI (i.e. feed-api) is a simple, ready-to-use microservice for parsing RSS feeds, optimizing each item using metadata and converting them to JSONFeed format.

How it works

Infographic: How FeedAPI works

FeedAPI takes an RSS Feed link, parses it, scrapes and collects OpenGraph and <meta/> tags data from each item to ensure all items have all the data necessary in the proper format, and finally it presents the results in a minimal, developer-friendly format, JSONFeed.

Usage

To get a specific feed, simply add that URL to the url query parameter. Remember to safely escape it (e.g. use encodeURIComponent or something). Optionally, you may pass a limit query parameter to limit the number of items returned.

Example

To get The Economist's Science and Technology RSS Feed, just pass the escaped url to the root (/) endpoint.

curl https://your-url.now.sh/?url=http%3A%2F%2Fwww.economist.com%2Fsections%2Fscience-technology%2Frss.xml

A successfully-parsed rss feed will result in a feed object with the following shape:

{
  "version": "https://jsonfeed.org/version/1",
  "title": "String (free-text)",
  "homepage_url": "String (url)",
  "feed_url": "String (url)",
  "description": "String (free-text)",
  "author": {
    "name": "String (free-text)",
    "url": "String (url)"
  },
  "items": [
    {
      "url": "String (url)",
      "title": "String (free-text)",
      "content_text": "String (free-text)",
      "image": "String (url)",
      "date_published": "String (date-format:rfc3339)",
      "author":{  
        "name": "String (free-text)",
        "url": "String (url)"
      }
    }
  ]
}

Not all fields will always be listed, it varies depending on the feed supplied. For more information, read the JSONFeed v1 Spec

One-click Cloud Deploys

You can deploy a FeedAPI server to any of these services with just one click!

Deploy

Deploy to now

Remix on Glitch

Deploy Locally

Clone the Repo

$ git clone git@github.com:krismuniz/feed-api.git feed-api

Install dependencies

$ npm install

Start the server with a PORT environment variable (default port is 3000)

$ PORT=3000 npm start

License

MIT © Kristian Muñiz