Webportal v2

embedded apps

API Reference - media.stationsList

Required Privacy: Location
Operation:

This API allows to retrieve the current available radio stations for all bands.

This API will output 0 to 3 {bandType} arrays (where {bandType} is fm, am, and/or DAB). These array contains one entry for each radio station available in this band.

Input Parameter
No input params
Output Data
Data name Description Type Unit/Values Example
{bandType}[n]
 .sid

Station ID of this radio station.

int

n/a

201
{bandType}[n]
 .preset

Preset of this radio station.

number

- 0 to 14: 'radio presets'

- -1: 'if not a preset'
-1
{bandType}[n]
 .used

Indicates if this radio is currently playing.

number

- 1: currently playing

- 0: not currently playing
1
{bandType}[n]
 .programName

Current radio program name of this radio station.

string

n/a

playing Aya Nakamura - Djadja
{bandType}[n]
 .freq

Current radio frequence of this radio station. Value of the FM/AM frequency or DAB channel index.

int

khz (FM/AM) or channel index (DAB)

100000
{bandType}[n]
 .serviceIndex

Service Index of this radio station.

int

n/a

1
{bandType}[n]
 .serviceCount

Service Count of this radio station.

int

n/a

10
{bandType}[n]
 .channelName

Current radio channel name of this radio station.

string

n/a

BBC ONE England
Code Example
1
2
3
4
5
6
7
8
9
10
11
12
13
webportal.get(
    /* api name */
    "media.stationsList",
    /* parameters */
     null
  )
  /* callback for `REPLY` messages */
  .then((message) => {
    if (message.status === 200) {
      /* handle `REPLY` success */
    }
    else { /* handle `REPLY` error */ }
  })
1
2
3
4
5
6
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0", 
  "type": "GET", 
  "api": "media.stationsList",
  "params":  null
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// --- format of the `REPLY` message ---

{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
  "type": "REPLY",
  "api": "media.stationsList",
  "status": 200,
  "statusText": "OK", 
  "data": {
    // FM band
    "fm": [
      // First station in FM band
      {
        "sid": 201,        
        "preset": 0,       
        "used": 1,         
        "programName": "Radio One", 
        "freq": 97800,     
        "serviceIndex": 0, 
        "serviceCount": 0, 
        "channelName": ""  
      },
      // Second station in FM band
      {
        "sid": 42,
        "preset": -1,
        "used": 0,
        "programName": "...",
        "freq": 99900,
        "serviceIndex": 0,
        "serviceCount": 0,
        "channelName": ""
      },
      {
        "sid": 43,
        "number": 1,
        "used": 0,
        "programName": "...",
        "freq": 100300,
        "serviceIndex": 0,
        "serviceCount": 0,
        "channelName": ""
        }
    ],
    // AM band
    "am": [
      // First station in AM band
      {
        "sid": 12,
        "preset": -1,
        "used": 0
        "programName": "...",
        "freq": 587,
        "serviceIndex": 0,
        "serviceCount": 0,
        "channelName": ""
      },
      // Second station in AM band
      {
        "sid": 13,
        "preset": -1,
        "used": 0
        "programName": "...",
        "freq": 812,
        "serviceIndex": 0,
        "serviceCount": 0,
        "channelName": ""
      }
    ],
    // DAB
    "dab": [
      // First station in DAB
      {
        "sid": 23,
        "preset": -1,
        "used": 0
        "programName": "...",
        "freq": 0,
        "serviceIndex": 1,  
        "serviceCount": 13, 
        "channelName": "6A" 
      },
      // Second station in DAB
      {
          "sid": 24,
          "preset": -1,
          "used": 0
          "programName": "...",
          "freq": 0,
          "serviceIndex": 2,
          "serviceCount": 13,
          "channelName": "6A"
      }
    ]
  } 
}

false