Interested in working with us? We offer a superb REMOTE work opportunity for a DEVOP.

Click here to find out more.

API: Newsfeed

About the Newsfeed API

The Newsfeed API offers a way to stay updated on what happens on Spreaker, in particular the people you follow and favorited shows. You’ll also receive content suggestions based on the topics you expressed interest in.

A Newsfeed item has several properties:

Property Type Description
item_id Numeric Unique item identifier
type String Item type. See below for detailed information about this field
who List of User The list of users involved
who_more Numeric The number of users involved other than the ones listed above
is_suggested Boolean Indicated if this item is an automatic suggestion from Spreaker
created_at Timestamp The timestamp of when the action took place
episodes List of Episode The list of episodes involved

Item Types

The various fields in the Newsfeed Item should be interpreted differently according to the item type.

Type Description Usage Example
SINGLE_BROADCAST A user published a new episode users[0] published episodes[0]
BROADCASTS_BY_WHO A user published a list of new episodes users[0] published episodes.join(', ')
BROADCASTS_BY_COLLECTION A user published a list of new episodes. All these episodes belong to the same show users[0] published episodes.join(', ')
SINGLE_LIKE A user liked an episode users[0] liked episodes[0]
LIKES_BY_WHO A user liked a list of episodes users[0] liked episodes.join(', ')
LIKES_BY_RESOURCE Some users liked an episode users.join(', ') and who_more more liked episodes[0]
SINGLE_LISTEN A user listened to an episode users[0] listened to episodes[0]
LISTENS_BY_WHO A user listened to a list of episodes users[0] listened to episodes.join(', ')
LISTENS_BY_RESOURCE Some users listened to an episode users.join(', ') and who_more more listened to episodes[0]

Retrieving the Newsfeed

GET /v2/users/USER-ID/newsfeed

This API returns a paginated list of newsfeed items. All parameters are optional.

Parameter Type Description
l String Language to use when building tailored suggestions
filter String Filter for returned items. The only supported value is created_only, which will filter results in such a way that items only related to new published episodes with be included. Episodes that were liked or listened to by people you follow, for example, will be excluded.

Example

curl -H "Authorization: Bearer OAUTH-TOKEN" 'https://api.spreaker.com/v2/users/2/newsfeed?l=it&filter=created_only&limit=3'
{
    "response": {
        "items": [{
            "item_id": 141881694,
            "type": "BROADCASTS_BY_COLLECTION",
            "timestamp": 1469091692,
            "is_suggested": true,
            "who": [{
                "user_id": 5383031, ...
            }],
            "who_more": 0,
            "episodes": [{
                "episode_id": 2751468, ...
            }, {
                "episode_id": 2673352, ...
            }]
        }, {
            "item_id": 141880027,
            "type": "BROADCASTS_BY_WHO",
            "timestamp": 1469082405,
            "is_suggested": false,
            "who": [{
                "user_id": 4029809, ...
            }],
            "who_more": 0,
            "episodes": [{
                "episode_id": 9028750, ...
            }, {
                "episode_id": 9024236, ...
            }]
        }, {
            "item_id": 141880026,
            "type": "SINGLE_BROADCAST",
            "timestamp": 1469049609,
            "is_suggested": true,
            "who": [{
                "user_id": 5894232, ...
            }],
            "who_more": 0,
            "episodes": [{
                "episode_id": 3204803, ...
            }]
        }],
        "next_url": "https://api.spreaker.com/v2/users/2/newsfeed?l=it&last_id=141880026&limit=3"
    }
}