APIHandler

public enum APIHandler

Retieves data from OttoRadio API

  • With no required parameters, this service is designed to provide timely and relevant stories with as little effort as possible. Add desired length for a more fine-tuned playlist.

    Build a theme playlist: Append a search query to create a playlist tailored around a central theme. There is no limit to the theme. It can be a topic, a concept, or an entity. To enhance the experience, we make additional efforts to optimize the content around highly-demanded themes.

    Declaration

    Swift

    public static func retrievePlaylist(query: String?, length: Int?, mix: PlaylistMix?, callback: @escaping ((Playlist?) -> Void))

    Parameters

    query

    Search query used to generate a themed playlist. e.g., self-driving car, virtual reality

    length

    Playlist length in minutes. Default is 30 minutes.

    mix

    Specifies the mix of news and podcasts.

    callback

    Callback with data when finished

  • Provides a list of relevant podcast episodes. This flexible service allows for the retrieval of recent podcasts, trending podcasts, and themed podcasts.

    Declaration

    Swift

    public static func retrievePodcasts(type: RelevanceRankingType, query: String?, count: Int?, callback: @escaping (([Story]?) -> Void))

    Parameters

    type

    Type determines the relevance ranking.

    query

    Search query used to retrieve podcast episodes.

    count

    Number of stories desired. Default 5 stories, maximum value is 50.

    callback

    Callback with data when finished

  • Provides a list of relevant news stories. This flexible service allows for the retrieval of recent news, trending news, and themed news.

    Declaration

    Swift

    public static func retrieveNews(type: RelevanceRankingType, query: String?, count: Int?, callback: @escaping (([Story]?) -> Void))

    Parameters

    type

    Type determines the relevance ranking.

    query

    Search query used to retrieve news stories.

    count

    Number of stories desired. Default 5 stories, maximum value is 50.

    callback

    Callback with data when finished