Cast Rewinder has a small API.
For all of you developers out there, there's a small RESTful API you can access via GET and POST methods.
GET
The API endpoint is rewind.website/api/get, here’s all the arguments you can pass:
url
required, the URL for a feed, or the URL for an iTunes or SoundCloud podcast pagefrequency
accepts values:monthly
weekly
default valuedaily
custom_days
start_date
accepts dates values, defaults to today, format `YYYY-MM-DD`start_date_timezone
accepts timezone values, in the form of a TZ name, as defined in the official list of tz database time zones. E.g.America/Los_Angeles
orEurope/Isle_of_Man
(spaces in the name are replaced by “_”) defaults to “Etc/UTC”, or +00:00option_start_at
accepts positive integers, defaults to 1option_order
accepts values:asc
default valuedesc
option_format
accepts values:feed_rss
default valuefeed_atom
feed_json
option_keepdates
accepts values:false
default valuetrue
If frequency
has the value custom_days
, you have to provide an argument for each selected day, a failure to do so results in a stern warning and defaults the frequency to weekly.
custom_day_mon=y
for publication on mondayscustom_day_tue=y
for publication on tuesdayscustom_day_wed=y
for publication on wednesdayscustom_day_thu=y
for publication on thursdayscustom_day_fri=y
for publication on fridayscustom_day_sat=y
for publication on saturdayscustom_day_sun=y
for publication on sundays
Here’s a couple of examples:
- Basic request: rewind.website/api/get?url=https://itunes.apple.com/us/podcast/99-invisible/id394775318
- Complex request: rewind.website/api/get?url=https://itunes.apple.com/us/podcast/99-invisible/id394775318&frequency=custom_days&custom_day_mon=y&custom_day_tue=y&custom_day_sun=y&start_date=2018-07-01&start_date_timezone=Europe/Paris&option_start_at=1&option_order=desc&option_format=feed_atom&option_keepdates=true
POST
The API endpoint is rewind.website/api/post. You have to transmit the request in JSON format, as application/json
. The arguments are pretty much the same as in the GET method.
Here is a sample JSON for a POST request, all these values are defaults:
{
"url": <your url>,
"frequency": "custom_days",
"custom_day_mon": false,
"custom_day_tue": false,
"custom_day_wed": false,
"custom_day_thu": false,
"custom_day_fri": false,
"custom_day_sat": false,
"custom_day_sun": false,
"start_date" : <today>,
"start_date_timezone" : "Etc/UTC",
"option_start_at": 1,
"option_order": "asc",
"option_format": "feed_rss",
"option_keepdates": false
}
Response
The API response to a well-formed request will be a JSON object containing the feed ID and the URL.
{
"feed_id": 16,
"url": "https://rewind.website/16/mon-tue-sun/20180708+0000"
}
With the feed ID you can build your own feed URLs, if you follow the right frequency, start date and options arguments.