GET /v1/teletext/pages/{page}.{format} Get teletext page data

Returns teletext page data in JSON or XML format. E.g. /v1/teletext/pages/100.json

Parameters

Name Description
page Teletext page number.
format Document format. Available formats: json, xml.

Teletext page structure

The xml file contains the node “teletext” which contains the node “page” Within the node “page” there will be one node “subpage” for every subpage of the exported teletext page.

The node “teletext” contains the following attributes:

  • network contains the name of the network as defined in FAB Network Controller
  • xml:space=“preserve” is required because teletext is using spaces for text positioning

The node “page” contains the following attributes:

  • number contains the teletext page number
  • name contains the page name as defined in the TOP Structure
  • time contains the timestamp of the last modification of the teletext page
  • subpagecount contains the number of subpages
  • prevpg contains the previous existing teletext page number
  • nextpg contains the next existing page number
  • toptype this is always “Block”

The node “subpage” contains the following attributes:

  • number is the subpage number of the content within this xml node
  • time is the duration of the display of the content within this xml node in seconds

The node “subpage” contains several nodes “content” with the same content in different representations which are defined by the value of the attribute “type”. Every teletext line is exported in a separate node “line” and the attribute “number” defined the teletext line number.

The content type “text” contains only text. All teletext control characters are replaced by spaces.

The content type “all” contains text and all teletext control characters. Teletext control characters with codes from 0 to 31 are replaced by keywords within {}.

Code Keyword Description
0 {Black} Text colour black
1 {Red} Text colour red
2 {Green} Text colour green
3 {Yellow} Text colour yellow
4 {Blue} Text colour blue
5 {Magenta} Text colour magenta
6 {Cyan} Text colour cyan
7 {White} Text colour white
8 {Flash} Flash on
9 {Steady} Flash off
10 {EB} End box
11 {SB} Start box
12 {NH} Normal height
13 {DH} Double height
14 {DW} Double width
15 {DS} Double size
16 {GBlack} Graphics colour black
17 {GRed} Graphics colour red
18 {GGreen} Graphics colour green
19 {GYellow} Graphics colour yellow
20 {GBlue} Graphics colour blue
21 {GMagenta} Graphics colour magenta
22 {GCyan} Graphics colour cyan
23 {GWhite} Graphics colour white
24 {Conceal} Conceal text
25 {CG} Contiguous graphics
26 {SG} Separated graphics
27 {ESC} Escape
28 {BB} Black Background
29 {NB} New background
30 {Hold} Hold graphics
31 {Release} Release graphics

The content type “structured” contains text and all necessary information regarding the representation of the text for every character. Every “line” node contains one or more “run” nodes. Every “run” node shall be displayed using the same foreground and background color. The following attributes are used in “run” nodes:

  • bg contains the name of the background color
  • fg contains the name of the foreground color
  • length contains the number of characters that shall be displayed for this run
  • charcode contains the hex number of the teletext character code used in the text of this run. This attribute is only present for characters with a graphic color (colors starting with g). Please check the teletext specification for a table of graphic characters.

The text within the “run” node is the text that shall be displayed using the specified background and foreground color.

Code Color name Description
0 black Text colour black
1 red Text colour red
2 green Text colour green
3 yellow Text colour yellow
4 blue Text colour blue
5 magenta Text colour magenta
6 cyan Text colour cyan
7 white Text colour white
16 gblack Graphics colour black
17 gred Graphics colour red
18 ggreen Graphics colour green
19 gyellow Graphics colour yellow
20 gblue Graphics colour blue
21 gmagenta Graphics colour magenta
22 gcyan Graphics colour cyan
23 gwhite Graphics colour white

The colors starting with the character g are teletext graphic colors. Special teletext symbols are defined for display in the teletext specification.

Response

200 OK on success

Response contains a JSON or XML document with the teletext page data.

Example files:

404 Not Found if page does not match a teletext page, if there was an error reading the page or if page or format is invalid

cURL example

Parts of the response examples are removed (“…”) for brevity. See example files above for full responses.

XML

curl -XGET "https://external.api.yle.fi/v1/teletext/pages/100.xml?app_id=YOUR_APP_ID&app_key=YOUR_APP_KEY"

<teletext network="YLE" xml:space="preserve">
  <page number="100" name="Uutiset" time="2020-05-05T10:43:26" subpagecount="4" nextpg="101" toptype="Block" animated="yes">
    <subpage number="1" time="8">.../subpage>
    <subpage number="2" time="8">...</subpage>
    <subpage number="3" time="8">...</subpage>
    <subpage number="4" time="8">...</subpage>
  </page>
</teletext>

JSON

curl -XGET "https://external.api.yle.fi/v1/teletext/pages/100.json?app_id=YOUR_APP_ID&app_key=YOUR_APP_KEY"

{
  "teletext": {
    "network": "YLE",
    "xml": "preserve",
    "page": {
      "number": "100",
      "name": "Uutiset",
      "time": "2020-05-05T10:43:26",
      "subpagecount": "4",
      "nextpg": "101",
      "toptype": "Block",
      "animated": "yes",
      "subpage": [
        {
        "number": "1",
        "time": "8",
        "content": [...]
        },{
        "number": "2",
        "time": "8",
        "content": [...]
        },{
        "number": "3",
        "time": "8",
        "content": [...]
        },{
        "number": "4",
        "time": "8",
        "content": [...]
        }
      ]
    }
  }
}

GET /v1/teletext/images/{page}/{subpage}.png Get teletext page image

Returns teletext page as a PNG image. E.g. /v1/teletext/images/100/1.png

Parameters

Name Description
page Teletext page number.
subpage Teletext subpage number.

Response

200 OK on success

Response contains a PNG image of the requested teletext page.

PNG image data, 720 x 456, 8-bit colormap, non-interlaced

404 Not Found if page or subpage does not match a teletext page, if there was an error reading the page, or if page or subpage is invalid

cURL example

curl -XGET \
"https://external.api.yle.fi/v1/teletext/images/100/1.png?app_id=YOUR_APP_ID&app_key=YOUR_APP_KEY" \
-o 100-1.png

teletext page 100/1