• Getting started

    Here and in the following subsections, we will explain how to use the API of our Internet Radio control panel to obtain information about the what is on air and other data using programmatic methods. Using our API, you can build your own scripts, applications and modules for your radio website, mobile application and any integration where programmatic interaction with the radio server is required.

    To work with the API, you must already have our Internet Radio Control Panel installed and configured. To work with the API, you need to know the URL of your control panel: the address at which you usually enter the broadcaster’s interface, where your channels, playlists, broadcast grid and other sections are.

  • Authentication

    Most API requests are aimed at getting information about the status of the radio, but in some cases there is a need:

    • get information that is not public, for example, a list of DJs on the radio with access passwords
    • make changes on the radio server, for example, add a new channel, server, create a playlist and so on.

    In such cases, the API will require authorization upon request. Our Internet Radio platform supports a standard authorization mechanism for the API: keys that you can manage in the Settings -> API Keys section of the Internet Radio control panel.

  • What's on air

    Endpoint: /api/v2/history/
    HTTP methods: GET
    Authentication: not required
    Parameters:
    limit: the number of records in response
    offset: offest, idicates the starting record
    server: radio server ID

    The history of tracks on the radio, the last track in the output of this API is the track that is playing right now on the radio.

    Example

    import requests
    
    response = requests.get("https://demoaccount.s02.radio-tochka.com:8080/api/v2/history/?limit=1&offset=0&server=1")
    print(response.json())

    Example Output

    {
       "count":500,
       "next":"https://demoaccount.s02.radio-tochka.com:8080/api/v2/history/?limit=1&offset=1&server=1",
       "previous":"None",
       "results":[
          {
             "album":"Ozzmosis (Expanded Edition)",
             "all_music_id":1190,
             "author":"Ozzy Osbourne",
             "author_other":"None",
             "comment":"None",
             "composer":"None",
             "dj_name":"AutoDJ",
             "genre":"None",
             "id":11552,
             "img_fetched":true,
             "img_large_url":"https://demoaccount.s02.radio-tochka.com:8080/media/tracks/trackImage1190_large.jpg",
             "img_medium_url":"https://demoaccount.s02.radio-tochka.com:8080/media/tracks/trackImage1190_medium.jpg",
             "img_url":"https://demoaccount.s02.radio-tochka.com:8080/media/tracks/trackImage1190.jpg",
             "isrc":"None",
             "jingle_id":"None",
             "label":"None",
             "length":296347,
             "lyricist":"",
             "metadata":"Ozzy Osbourne - I Just Want You",
             "n_listeners":0,
             "performance_type":"None",
             "playlist_title":"All music",
             "publisher":"None",
             "title":"I Just Want You",
             "ts":1733763534000,
             "year":"None"
          }
       ]
    }

    Description

    • album: track album
    • all_music_id: the ID of the track in the server’s music library. If the track is a jingle, this parameter is null. If the track was played live and not from the Auto DJ’s music library, this parameter is null.
    • author: track artist
    • author_other: co-author
    • comment: track comments
    • composer: composer
    • dj_name: the name of the DJ who played this track.
    • genre: genre of composition
    • id: track history record ID (unique value)
    • img_fetched: the system attempted to download the track cover from music services (Apple Music, Spotify, MusicBrainz) if it is missing in the mp3 tags of the file
    • img_large_url: - the URL of the track cover image in the maximum resolution for this track with no compression
    • img_medium_url: - a medium-sized version of the image that the system obtained by compressing the original image to 500x500 pixels
    • img_url: a mini track cover, usually in a resolution of 100x100 pixels
    • isrc: ISRC track code (used in royalty reports)
    • jingle_id: if the track is a jingle, this parameter contains the jingle ID in the Auto-DJ content database
    • label: label
    • length: track duration in milliseconds
    • lyricist: the author of the lyrics
    • metadata: the final metadata with which the track was aired is usually the “Artist - Name”, but the metadata may also contain other data, depending on the format of the meta data, which is specified in the “Settings” section of the radio panel: for example, the name of the DJ
    • n_listeners: the number of listeners on the radio at the time the track started playing
    • performance_type: type of performance: vocal, instrumental, reading, etc.
    • playlist_title: the name of the playlist that was on the air can be null for jingles and for tracks played during live streams
    • publisher: publisher
    • title: track name
    • ts: the broadcasting time (integer) in milliseconds, timezone: UTC
    • year: track year

  • Playlists

    /api/v2/playlists/ playlists.views.PlaylistViewSet playlist-list /api/v2/playlists// playlists.views.PlaylistViewSet playlist-detail /api/v2/playlists//add_recording/ playlists.views.PlaylistViewSet playlist-add-recording /api/v2/playlists//add_tracks/ playlists.views.PlaylistViewSet playlist-add-tracks /api/v2/playlists//add_tracks_ordered/ playlists.views.PlaylistViewSet playlist-add-tracks-ordered /api/v2/playlists//clean_duplicates/ playlists.views.PlaylistViewSet playlist-clean-duplicates /api/v2/playlists//copy/ playlists.views.PlaylistViewSet playlist-copy /api/v2/playlists//excel/ playlists.views.PlaylistViewSet playlist-excel /api/v2/playlists//order_tracks/ playlists.views.PlaylistViewSet playlist-order-tracks /api/v2/playlists//shuffle_tracks/ playlists.views.PlaylistViewSet playlist-shuffle-tracks /api/v2/playlists//start_broadcasting/ playlists.views.PlaylistViewSet playlist-start-broadcasting /api/v2/playlists/<playlist_pk>/tracks/ playlists.views.PlaylistTracksViewSet track-list /api/v2/playlists/<playlist_pk>/tracks// playlists.views.PlaylistTracksViewSet track-detail /api/v2/playlists/<playlist_pk>/tracks/bulk_delete/ playlists.views.PlaylistTracksViewSet track-bulk-delete /api/v2/playlists/<playlist_pk>/tracks/bulk_move/ playlists.views.PlaylistTracksViewSet track-bulk-move

    Playlists API. Getting all the playlist for a radio server. Endpoint: /api/v2/playlists/ Params: server:int - radio server ID Example: /api/v2/playlists/?server=1

    Description: Gets all server playlists as an array. Available without authentication.

  • Podcasts

    Endpoint: /api/v2/podcasts/
    HTTP methods: GET
    Authentication: not required
    Parameters:
    limit: the number of records in response (optional)
    offset: offest, idicates the starting record (optional)
    server: radio server ID (optional)

    Gets a list of podcasts.

    Example

    import requests
    
    response = requests.get("https://demoaccount.s02.radio-tochka.com:8080/api/v2/podcasts/?server=1")
    print(response.json())

    Example Output

    [
        {
            "id": 2,
            "folder": "the-retro-podcast",
            "image": "https://radio.com:8080/media/podcast_covers/podcast1.jpg",
            "episodes_count": 5,
            "feed_url": "https://radio.com:8080/api/v2/podcasts/2/feed.xml",
            "public_page_url": "https://radio.com:8080/public/podcasts/2/",
            "title": "The Retro Podcast",
            "description": "There are many variations of passages of Lorem Ipsum",
            "published": true,
            "server": 1
        },
    ]

    Description

    • folder: podcast folder on the server filesystem
    • image: podcast cover image
    • episodes_count: the number of episoded in this podcast
    • feed_url: RSS feed URL for this podcast
    • public_page_url: public page URL for this podcast, allows to browse the podcast via a browser
    • title: podcast title
    • description: podcast description
    • published: true if podcast is published (not a draft)
    • server: radio server ID the podcast belongs to
    Endpoint: /api/v2/podcasts/
    HTTP methods: POST
    Authentication: required
    Parameters:
    title: podcast title, string
    published: boolean
    description: podcast description, string
    server: radio server ID

    Create a podcast on the radio with specified radio server ID. If you also need to include podcast cover into the podcast creation request, you need to send your POST request with multipart/form-data header and specify the podcats cover via the image parameter.