API Documentation
URL
https://api.rss2json.com/v1/api.json
Method
GET
URL params
Name | Required | Type | Description |
---|---|---|---|
rss_url |
Yes | String, Escaped URL | rss feed you want to convert to json, the url need to be escaped (eg. https%3A%2F%2Fnews.ycombinator.com%2Frss ) |
api_key |
No | String | A valid api key, (you can get yours by creating an account then head to `My Account` > `API Key`) . |
order_by |
No | String | Order the results by chosen value, Possible values : pubDate , author or title . ( api_key is required to use this parameter) |
order_dir |
No | String | Order direction of feed items to return, Possible values : asc or desc ,Default value : desc . ( api_key is required to use this parameter) |
count |
No | Integer | Count of feed items to return, default is 10 . ( api_key is required to use this parameter) |
callback |
No | Alphanumeric | callback name if you want to use JSONP . |
Sample Call
api call using jQuery.ajax()
$.ajax({
url: 'https://api.rss2json.com/v1/api.json',
method: 'GET',
dataType: 'json',
data: {
rss_url: 'https://news.ycombinator.com/rss',
api_key: '0000000000000000000000000000000000000000', // put your api key here
count: 2
}
}).done(function (response) {
if(response.status != 'ok'){ throw response.message; }
console.log('====== ' + response.feed.title + ' ======');
for(var i in response.items){
var item = response.items[i];
console.log(item.title);
}
});