API: Episodes
In this page
- The Episode object
- Retrieving a Single Episode
- Example
- Updating an Episode
- Example
- Deleting an Episode
- Example
- Downloading an Episode
- Example
- Playing an Episode
- Example
- Uploading a Recorded Episode
- Example
- Creating a Draft Episode
- Example
- Retrieving a User’s Episodes
- Example
- Retrieving a Show’s Episodes
- Example
- Adding an Episode to Likes
- Example
- Removing an Episode from Likes
- Example
- Checking if an User likes an Episode
- Example
- Retrieving Liked Episodes
- Example
- Retrieving Users that Liked an Episode
- Example
- Adding an Episode to Bookmarks
- Example
- Removing an Episode from Bookmarks
- Example
The Episode object
An Episode is an audio track that can be listened to. It can be recorded or broadcasted live, and always belongs to a Show. An episode could be a podcast episode, a music track or song, a radio show episode, or a live broadcast.
An episode has several properties. Each API can return an Episode model all those properties, or just a subset. All the properties are listed here:
Property | Type | Description |
---|---|---|
episode_id |
Numeric | Unique episode identifier |
type |
String | The episode type. It could be DRAFT , RECORDED , LIVE or EXTERNAL |
title |
String | Episode title |
description |
String | Episode description |
duration |
Numeric | Episode duration expressed in milliseconds |
site_url |
String | Public URL of the episode on Spreaker’s website |
image_original_url |
String | Original size image URL |
image_url |
String | 200x200px size image URL |
published_at |
String | The date/time on which this episode has been published |
auto_published_at |
String | The date/time on which this episode has been scheduled to be published later |
author |
User | The author/owner of the episode |
author_id |
Numeric | User ID of the episode author |
show |
Show | The show the episode belongs to |
show_id |
Numeric | Show ID of the show this episodes belongs to |
download_enabled |
Boolean | true if the author allowed this episode to be downloaded, otherwise false |
plays_count |
Numeric | The number of overall plays of this episode (both live and on demand). The value is null if the Statistics are temporarily not available. |
downloads_count |
Numeric | The number of overall downloads of this episode. The value is null if the Statistics are temporarily not available. |
plays_ondemand_count |
Numeric | The number of overall on demand plays of this episode. The value is null if the Statistics are temporarily not available. |
plays_live_count |
Numeric | The number of overall live plays of this episode. The value is null if the Statistics are temporarily not available. |
likes_count |
Numeric | The number of overall likes of this episode. The value is null if the Statistics are temporarily not available. |
messages_count |
Numeric | The number of overall messages of this episode. The value is null if the Statistics are temporarily not available. |
is_on_air |
Boolean | This property is exported only on LIVE episodes. The value is true if the episode’s live stream is currently active (broadcasting), otherwise it’s false |
is_non_stop |
Boolean | This property is exported only on LIVE episodes. The value is true if the episode live stream is 24/7 (non stop), otherwise it’s false |
encoding_status |
String | The episode’s status, whether it’s either processing or encoding. The episode can be listened to only when the encoding_status is READY . |
waveform_url |
String | URL of the episode’s waveform data points (see Displaying the Episode Waveform for more information). The value is null if the episode has no waveform (ie. LIVE episodes or DRAFT episodes without any media file yet). |
tags |
Array | List of tags/keywords related to the content. |
hidden |
Boolean | Whether the episode is accessible publicly, either on website or RSS feeds. |
visibility |
String | The specific visibility status of the episode. It could be PUBLIC , PRIVATE or LIMITED . |
site_limited_url |
String | The site link that gives access to a LIMITED episode. This is generated when the visibility of an episode is changed to LIMITED . LIMITED episodes are not listed on the website or RSS feeds. |
site_limited_key |
String | The episode private key that provides access to the episode. |
media_id |
Numeric | The ID of the episode media |
media_url |
String | URL of the episode’s media. The value is null if the episode has no media or media is not available (ie. LIVE episodes or DRAFT episodes without any media file yet). |
download_url |
String | URL for episodes’s download. |
playback_url |
String | URL for episodes’s playback. |
The type
field can have the following values:
LIVE
: the episode is currently LIVE. By playing this episode you’ll be able to listen directly to its live stream. Theduration
field could be absent or null, because the duration of a live episode is unknown.RECORDED
: the episode has been uploaded, or it was once a LIVE episode that ended and has been archived. You can safely read and display theduration
field.EXTERNAL
: the episode is not hosted on Spreaker, but on a 3rd party and is available to be listened to. You can safely read and display theduration
field. This type of episode cannot be created via APIs.DRAFT
: the episode is in a draft state and has not been published yet. In this state, the episode could have no audio file associated with it yet: once it does have an audio file, it can be immediately published by settingpublished_at
, or scheduled to be published later by settingauto_published_at
(in both cases thetype
will switch toRECORDED
).
The encoding_status
field can have the following values:
PENDING
: the episode is in queue and waiting to be processed or it has no audio file yet (see Working with draft episodes).PROCESSING
: the episode is currently processing. This operation could take a while, depending on the episode’s duration.READY
: the episode has been successfully processed and is ready to be listened to.ERROR
: an error occurred while processing the episode.
The visibility
field can have the following values:
PUBLIC
: the episode is publicly accessible through Website, Widget, Apps and on RSS feed.PRIVATE
: the episode is not accessible in any platform in a public way. Only the owner of the episode can see it.LIMITED
: the episode is accessible on the Website through a special url and in the Widget using the following query parameterepisode_key=<SITE_LIMITED_KEY>
Retrieving a Single Episode
The returned Episode contains most of all its public information, from its title
and description
, to its author
(a User model) and its show
(a Show model).
Example
The response body is a JSON object containing all the episodes fields (plus the author
and show
public fields).
Updating an Episode
Authenticated: yes. Owner: yes
The API POST /v2/episodes/EPISODE-ID
supports these parameters, none of which are required, as you should specify only the ones you want to update:
Parameter | Type | Description |
---|---|---|
title |
String | Max length: 140 |
description |
String | - |
show_id |
Numeric | The unique show ID that this episode belongs to. Changing this value means moving the episode to another show. |
explicit |
Boolean | true if the episode contains explicit content (defaults to false ) |
download_enabled |
Boolean | true if the episode can be downloaded (defaults to true ) |
hidden |
Boolean | true if the episode should not be visible on public pages and listings (defaults to false ) |
visibility |
String | The specific visibility status of the episode. It could be PUBLIC , PRIVATE or LIMITED . If the LIMITED visibility is set but it’s not available, PRIVATE will be used instead. |
tags |
String | Comma-separated list of tags/keywords related to the content. Adding tags improves searchability. |
location_latitude |
Numeric | Latitude of the GPS coordinates related to this episode |
location_longitude |
Numeric | Longitude of the GPS coordinates related to this episode |
image_file |
File | At least 400x400, Max size: 5MB, Formats: JPG, PNG |
image_crop |
String | Comma-separated coordinates (top left X, top left Y, bottom right X, bottom right Y) used to crop an image_file . If not specified, the image_file will not be cropped. This parameter is effective only if the request contains an image_file . |
published_at |
String | The date/time when the episode was published. It can be edited only for RECORDED episodes. |
auto_published_at |
String | The date/time when the episode has been scheduled to be published (as in published at a later date/time). If the episode has been scheduled to be published later, it can be edited by changing the date / time it will be published or by setting an empty string to switch it back to an “unscheduled” state. |
media_file |
File | The audio file that should be associated with this episode. You can use this API to both upload a media_file for the first time, or replace the media_file associated with an episode that already has one. |
chapters |
String | JSON-encoded array of chapters that should be associated with this episode. Chapters are a sort of bookmarks for your episode and are mainly used to give listeners an easy way to fast forward to certain topics within your episode. See Uploading an Episode with Chapters for more information about the format. |
autoshares |
String | Enable auto-sharing to social networks. The value can be a comma separated list of values: FACEBOOK , TWITTER , TUMBLR . Auto-sharing can be configured only on non published episodes and it’s required your account to be connected to the respective social network in order to work. |
season_episode_type |
String | Type of the episode. It could be FULL , TRAILER , and BONUS . |
season_number |
Numeric | Season number of the episode. |
episode_number |
Numeric | Episode number of the episode. |
rss_guid |
String | Unique identifier for the episode exposed in the RSS feed. |
Example
The response body is a JSON object containing all the episode fields (and some related data).
Deleting an Episode
Authenticated: yes
Delete a particular episode. This requires the request to be authenticated with the episode’s author credentials.
Example
Downloading an Episode
Authenticated: optional
Downloads a particular episode. This action is only available on episodes with download_enabled
set to true
or if the request is authenticated as the owner of the content.
We strongly suggest to use a well formatted User-Agent of all your requests, and expecially for episode play and download endpoints, because the name of your application will appear in our Sources Statistics. See User Agent format to learn more.
Example
Playing an Episode
Plays/streams a particular episode.
We strongly suggest to use a well formatted User-Agent of all your requests, and expecially for episode play and download endpoints, because the name of your application will appear in our Sources Statistics. See User Agent format guide to learn more.
Example
Uploading a Recorded Episode
Authenticated: yes. Owner: yes
The API POST /v2/shows/SHOW-ID/episodes
creates a new RECORDED
episode with the uploaded media_file
audio file. The request must be authenticated with the SHOW-ID
’s owner credentials.
The only required parameters are the title
and media_file
: all other parameters are optional and can be edited later. Check out the Upload an Episode guide to get more information and working examples.
Example
The response body is a JSON object containing all the episode fields (and some related data).
Creating a Draft Episode
Authenticated: yes.
The API POST /v2/episodes/drafts
creates a new DRAFT
episode and supports all the parameters of the Updating an Episode API.
The only required parameters are the title
and show_id
: all other parameters are optional and can be edited later. Check out the working with draft episodes guide to get more details about draft episodes.
Example
The response body is a JSON object containing all the episode fields (and some related data).
Retrieving a User’s Episodes
This API returns a paginated list of Episodes that belong to a USER-ID
. Each has just a subset of Episode properties.
Parameter | Type | Description |
---|---|---|
filter |
String | Filter episodes by listenable or editable (defaults to listenable ). If you specify filter=editable the request must be authenticated with the USER-ID ’s owner credentials. |
direction |
String | Scans episodes forward or backward according to their natural order (defaults to forward ). If you specify direction=backward the request must also include last_id . |
Example
The response body is a paginated list of Episodes.
Retrieving a Show’s Episodes
This API returns a paginated list of Episodes that belong to a SHOW-ID
. Each has just a subset of Episode properties.
Parameter | Type | Description |
---|---|---|
filter |
String | Filter episodes by listenable or editable (defaults to listenable ). If you specify filter=editable the request must be authenticated with the SHOW-ID ’s owner credentials. |
sorting |
String | Sort episodes by newest first or oldest first (defaults to show’s settings - usually it’s newest ). |
direction |
String | Scans episodes forward or backward according to their natural order (defaults to forward ). If you specify direction=backward the request must also include last_id . |
Example
The response body is a paginated list of Episodes.
Adding an Episode to Likes
Authenticated: yes
This API does not have any additional parameters. You can add an episode to your Likes list only on your own account, so the USER-ID
parameter must match the owner of the token you’re using to authenticate the request.
Example
The response body is an empty object.
Removing an Episode from Likes
Authenticated: yes
This API does not have any additional parameters. You can remove an episode from Likes only on your own account, so the USER-ID
parameter must match the owner of the token you’re using to authenticate the request.
Example
The response body is an empty object
Checking if an User likes an Episode
Authenticated: yes
This API does not have any additional parameters, and return 200
if you like EPISODE-ID
, 404
otherwise. You can check Likes only on your own account, so the USER-ID
parameter must match the owner of the token you’re using to authenticate the request.
Example
The response body is an empty object
Retrieving Liked Episodes
This API returns a paginated list of Episodes liked by the USER-ID
. Each has just a subset of Episode properties.
Example
The response body is a paginated list of Episodes.
Retrieving Users that Liked an Episode
This API returns a paginated list of Users that liked the EPISODE-ID
. Each has just a subset of User properties.
Example
The response body is a paginated list of Users.
Adding an Episode to Bookmarks
Authenticated: yes
This API does not have any additional parameters. You can add an episode to bookmarks only on your own account, so the USER-ID
parameter must match the owner of the token you’re using to authenticate the request.
Example
The response body is an empty object
Removing an Episode from Bookmarks
Authenticated: yes
This API does not have any additional parameters. You can remove an episode from bookmarks only on your own account, so the USER-ID
parameter must match the owner of the token you’re using to authenticate the request.
Example
The response body is an empty object