We've had a couple of queries about whether it's possible to access the content API in ATOM or RSS format, and I thought I'd share with you all the ways that we are using to do so.
We currently use the Content API and Yahoo Pipes to drive some of our twitter feeds. The reason for this is that twitter accounts such as @guardiannews tweet everything that is included in the news tag. But followers have pointed out that there is a lot of duplication between the news tweets and sections like football, technology and media, all of which have their own specific twitter accounts.
which selects all articles in date order that are in the media section, but with any content that has the tone/letters, tone/obituaries and media/greenslade tags applied to it removed from the results.
This gives us back a JSON object that we could then parse nicely.
However, our twitter feed bots don't accept our API as an input, like many online systems they accept RSS feeds, and the Content API doesn't have an RSS or ATOM format available. So at this point we turn to Yahoo Pipes as a simple Json to RSS converter.
As you can see, I've started with a Url Builder and Text Input, so that you can specify your API key. I've hard coded the query parameters for now, but I'm sure you can imagine it's very easy to hook in a number of Text Input boxes for each query parameter. We've also used before a single Text Input that contains the content api url to hit.
If you want the debugging to work, you will ahve to enter your api key into the debug field of the API key text field, since the URL above is invalid and returns an error. Once you've done that, you can click on the Fetch Data box, which is the next step. This should show you the results json broken down into a nice tree for you.
We pipe the results data into the Create RSS box, and we have to tell the RSS generator where to get the required RSS fields from. The drop downs should make this fairly easy, you can select item.webTitle for title, or you could select item.fields.headline to select the headline for example. In this case we want a very simple RSS feed, so we only fill in the Title, Link and PubDate fields.
Hopefully this has helped you if you wanted an RSS feed from the content api, which should help you integrate the API into other tools and applications.
Don't forget that using the API in this manner still requires that you follow the terms and conditions in the same way as if you had built a custom integration.