Turn RSS into JSON with Zapier – and filter it!

T

We love two write utilities but not always. When we can it’s a little faster to use tools like Zapier to transport and transform data from one place to another.

Most of our customers use Zapier too so it’s a great way to sharpen our skills. You can do pretty much anything you want with Zapier – it’s just about how much time you’re willing to put in to figure it out.

Zapier Logo – move data from RSS into JSON

We needed a way to move data from an RSS feed into JSON. The RSS feed was already being polled by Zapier so I needed to figure out how to parse it with Zapier (if possible). At first it wasn’t clear how.

What Zaps do I need?

I thought there might be a Zap called “Parser” or “JSON” and there was not. So I did a little searching. There were no articles specifically doing what I needed. There were however a few that gave me ideas.

Leading me to Using javascript in Zapier to work with data And this Reddit post – How to Make a Discord Webhook That Automatically Announces New Blog Posts

The first article had me looking for an easy way to parse RSS with Javascript, and before spending too much time on that I determined it wasn’t going to be easy. The last post helped me realize I was over-thinking the problem – and instead of transforming the data I needed to just use a “Webhook” zap to POST the data.

Zapier was already parsing the RSS feed. I still wanted to add some structure so that would be easier to work with on the receiving end. The solution was starting to take shape.

RSS feeds use XML to maintain uniformity. The title, link and description elements are required you can read more about that in this w3schools.com article on RSS.

Cube, Tetris, Play, Blocs, Bloc
Zapier is like Tetris – with the right Zaps in place it’s powerful

RSS, Filter and Webhook

For our particular solution we have one Zap prior to the Webhook – the “Filter” Zap. We don’t want every single notification from the RSS feed. We look for specific terms in the content and filter them out.

You can also filter content that only contains what you want.

With filtering now I can move on to creating the the JSON payload. The Zapier Webhook gives you payload choices – I needed JSON which provides two fields. Key and Value. The left smaller field you get to decide (it won’t be filled by the RSS data). I wanted to simulate what I was receiving from the RSS feed so I created three field sets – title, link and description. In the right hand fields I added their corresponding elements from the RSS feed.

The URL field that is above the data should be where you want to send the JSON Payload. For testing try using Postbin or Requestbin (a public bin is quickest to test) remember with either solution don’t send sensitive data to a publicly assessable tool.

That’s it! I ended up with a JSON Payload of very specific content from an RSS feed with just three Zaps! Thanks for reading – and see the shared Zap link below.

Zap – RSS by Zapier → Filter by Zapier & Webhooks by Zapier

About the author

Jon Cavanaugh

Add comment

By Jon Cavanaugh

Recent Posts

Recent Comments