TVHeadend JSON API
Tvheadends JSON API in Beispielen.
Serverstatus
Serverinformationen abrufen
http://192.168.0.3:9981/api/serverinfo
{
"sw_version": "4.1-2195~g65dfd15",
"api_version": 18,
"name": "Tvheadend",
"capabilities": [
"caclient",
"tvadapters",
"satip_client",
"satip_server",
"trace",
"libav"
]
}
Aktuelle Streams
http://192.168.0.3:9981/api/status/subscriptions
{
"entries": [
{
"id": 31,
"start": 1505153963,
"errors": 0,
"state": "Läuft",
"hostname": "192.168.0.140",
"title": "VLC/2.2.4 LibVLC/2.2.4",
"channel": "zdf_neo HD",
"service": "Sundtek DVB-C (III) : DVB-C #0/Berlin/642MHz/zdf_neo HD",
"profile": "pass",
"in": 1423536,
"out": 1423536,
"total_in": 14512660,
"total_out": 14512660
}
],
"totalCount": 1
}
Aktuelle Verbindungen
http://192.168.0.3:9981/api/status/connections
{
"entries": [
{
"id": 20,
"peer": "192.168.0.140",
"started": 1505153963,
"type": "HTTP"
},
{
"id": 3,
"peer": "192.168.0.144",
"started": 1505144075,
"type": "HTSP",
"user": ""
}
],
"totalCount": 2
}
Noch mehr
http://192.168.0.3:9981/api/status/inputs
http://192.168.0.3:9981/api/service/list
Kanäle
Liste der Kanäle in Kurzform.
http://192.168.0.3:9981/api/channel/list
{
"entries": [
{
"key": "8abd1c8c95f9f9c0f1c6d71e6cdece24",
"val": "zdf_neo HD"
},
{
"key": "f16d8c8d4163345bae5f5044d9ae7772",
"val": "MDR Sachsen HD"
},
{
"key": "9fa4b9915c6bae745f9400e08b391a6f",
"val": "rbb Berlin HD"
},
...
]
}
Detailierte Liste der Kanäle.
http://192.168.0.3:9981/api/channel/grid?
{
"entries": [
{
"uuid": "8abd1c8c95f9f9c0f1c6d71e6cdece24",
"enabled": true,
"autoname": true,
"name": "zdf_neo HD",
"number": 13,
"epgauto": true,
"epggrab": [],
"dvr_pre_time": 0,
"dvr_pst_time": 0,
"epg_running": -1,
"services": [
"7bc63cfd770cbca1791fbc0d5f108037"
],
"tags": [
"243a331b032fc149bf3053b38275ea40",
"b57d304bb784f6c73810b0b2979b4024"
],
"bouquet": ""
},
]
}
Kanaltags abrufen
http://192.168.0.3:9981/api/channeltag/list
{
"entries": [
{
"key": "243a331b032fc149bf3053b38275ea40",
"val": "TV channels"
},
{
"key": "b57d304bb784f6c73810b0b2979b4024",
"val": "HDTV"
},
{
"key": "0d098c879b2c37a78d04d81c147bbafd",
"val": "SDTV"
}
]
}
Detailierte Informationen geht über die Angabe der UUID eines Kanals:
http://192.168.0.3:9981/api/idnode/load?uuid=8abd1c8c95f9f9c0f1c6d71e6cdece24
{
"entries": [
{
"uuid": "8abd1c8c95f9f9c0f1c6d71e6cdece24",
"id": "8abd1c8c95f9f9c0f1c6d71e6cdece24",
"text": "zdf_neo HD",
"caption": "Kanäle",
"class": "channel",
"event": "channel",
"params": [
{
"id": "enabled",
"type": "bool",
"caption": "Aktiviert",
"description": "Aktiviere/deaktiviere den Kanal.",
"default": false,
"value": true
},
{
"id": "autoname",
"type": "bool",
"caption": "Automatisch vom Netzwerk benennen",
"description": "Always use the name defined by the network.",
"default": false,
"nosave": true,
"advanced": true,
"value": true
},
{
"id": "name",
"type": "str",
"caption": "Name",
"description": "The name given to/of the channel (This is how it'll appear in your EPG.)",
"default": "",
"value": "zdf_neo HD"
},
{
"id": "number",
"type": "s64",
"caption": "Nummer",
"description": "The position the channel will appear on your EPG. This is not used by Tvheadend internally, but rather intended to be used by HTSP clients for mapping to remote control buttons, presentation order, etc.",
"default": 0,
"intsplit": 1000000,
"value": 13
},
{
"id": "icon",
"type": "str",
"caption": "Benutzerlogo",
"description": "The URL (or path) to the icon to use/used for the channel.",
"default": "",
"advanced": true
},
{
"id": "icon_public_url",
"type": "str",
"caption": "Logo-URL",
"description": "The imagecache path to the icon to use/used for the channel.",
"default": "",
"rdonly": true,
"nosave": true,
"expert": true,
"hidden": true
},
{
"id": "epgauto",
"type": "bool",
"caption": "EPG Quelle automatisch zuordnen",
"description": "Automatically link EPG data to the channel (using the channel name for matching). If you turn this option off, only the OTA EPG grabber will be used for this channel unless you've specifically set a different EPG Source.",
"default": false,
"advanced": true,
"value": true
},
{
"id": "epggrab",
"type": "str",
"caption": "EPG-Quelle",
"description": "Name of the module, grabber or channel that should be used to update this channels EPG info.",
"list": 1,
"nosave": true,
"advanced": true,
"enum": {
"type": "api",
"uri": "epggrab/channel/list",
"event": "epggrab_channel",
"params": {
"enum": true
}
},
"value": []
},
{
"id": "dvr_pre_time",
"type": "int",
"caption": "Vor-Aufname-Polster",
"description": "Start recording earlier than the EPG/timer defined start time by x minutes, for example if a program is to start at 13:00 and you set a padding of 5 minutes it will start recording at 12:54:30 (including a warming-up time of 30 seconds). If this isn't set the pre-recording padding if set in the DVR entry or DVR profile will be used.",
"default": 0,
"advanced": true,
"value": 0
},
{
"id": "dvr_pst_time",
"type": "int",
"caption": "Nach-Aufname-Polster",
"description": "Aufnahme nach der geplanten Stop Zeit für x Minuten fortsetzen.",
"default": 0,
"advanced": true,
"value": 0
},
{
"id": "epg_running",
"type": "int",
"caption": "Benutze EPG Laufend Status",
"description": "Use EITp/f to decide event start/stop. This is also known as \"Accurate Recording\". See Help for details.",
"default": 0,
"advanced": true,
"enum": [
{
"key": -1,
"val": "Nicht gesetzt"
},
{
"key": 0,
"val": "Deaktiviert"
},
{
"key": 1,
"val": "Aktiviert"
}
],
"value": -1
},
{
"id": "services",
"type": "str",
"caption": "Services",
"description": "Services associated with the channel.",
"list": 1,
"advanced": true,
"enum": {
"type": "api",
"uri": "service/list",
"event": "service",
"params": {
"enum": true
}
},
"value": [
"7bc63cfd770cbca1791fbc0d5f108037"
]
},
{
"id": "tags",
"type": "str",
"caption": "Tags",
"description": "Tags linked/to link to the channel.",
"list": 1,
"enum": {
"type": "api",
"uri": "channeltag/list",
"event": "channeltag",
"params": {
"all": 1
}
},
"value": [
"243a331b032fc149bf3053b38275ea40",
"b57d304bb784f6c73810b0b2979b4024"
]
},
{
"id": "bouquet",
"type": "str",
"caption": "Bouquet (auto)",
"description": "The bouquet the channel is associated with.",
"default": "",
"rdonly": true,
"advanced": true,
"enum": {
"type": "api",
"uri": "bouquet/list",
"event": "bouquet"
},
"value": ""
},
{
"id": "epg_parent",
"type": "str",
"caption": "Benutze EPG von",
"description": "Reuse the EPG from another channel.",
"default": "",
"expert": true,
"enum": {
"type": "api",
"uri": "channel/list",
"event": "channel",
"params": {
"all": 1
}
}
}
]
}
]
}
EPG
Ausführliches EPG
http://192.168.0.3:9981/api/epg/events/grid
{
"totalCount": 5660,
"entries": [
{
"eventId": 1224631,
"episodeId": 1224632,
"channelName": "ZDFinfo",
"channelUuid": "a4e161cdb64050f356d0d021e45be21a",
"channelNumber": "24",
"start": 1505148300,
"stop": 1505153700,
"title": "Verschwörung auf dem Prüfstand",
"subtitle": "Die 9/11-Experimente",
"summary": "Die 9/11-Experimente",
"description": "Stürzte das World Trade Center infolge der Flugzeugeinschläge ein oder wurden die Türme gesprengt? Und was passierte wirklich mit dem Pentagon?\"Verschwörung auf dem Prüfstand\" sucht nach Antworten auf diese bis heute heftig umstrittenen Fragen um den 11. September 2001.Altersfreigabe: 6",
"widescreen": 1,
"genre": [
128
],
"nextEventId": 1224665
},
...
]
}
Aufnahmen
Alle Aufnahmen anzeigen
http://192.168.0.3:9981/api/dvr/entry/grid
{
"entries": [
{
"uuid": "1b265536736c3e3d2f470d1e1d9b1664",
"enabled": true,
"start": 1505231880,
"start_extra": 0,
"start_real": 1505231850,
"stop": 1505233200,
"stop_extra": 0,
"stop_real": 1505233200,
"duration": 1320,
"channel": "afe07ca9993ddf156e5ab49e24e18eb9",
"channel_icon": "",
"channelname": "KiKA HD",
"title": {
"ger": "Möwenweg-Time-2017-09-12_17:58"
},
"disp_title": "Möwenweg-Time-2017-09-12_17:58",
"disp_subtitle": "",
"disp_description": "",
"pri": 0,
"retention": 0,
"removal": 0,
"config_name": "bb9483c1436a5c1dab71d9df0fd55d95",
"creator": "192.168.0.140",
"filename": "",
"errorcode": 0,
"errors": 0,
"data_errors": 0,
"dvb_eid": 0,
"noresched": false,
"norerecord": false,
"autorec": "",
"autorec_caption": "",
"timerec": "",
"timerec_caption": "Möwenweg(null)",
"parent": "",
"child": "",
"content_type": 0,
"broadcast": 0,
"url": "",
"filesize": 0,
"status": "Scheduled for recording",
"sched_status": "scheduled",
"duplicate": 0,
"comment": "Time recording"
},
..
]
}
Jeweils fertige, kommende oder fehlgeschlagene Aufnahmen anzeigen:
http://192.168.0.3:9981/api/dvr/entry/grid_finished
http://192.168.0.3:9981/api/dvr/entry/grid_upcoming
http://192.168.0.3:9981/api/dvr/entry/grid_failed
Anzahl der Einträge (Paging) festlegen.
Die Standardabfrage listet jeweils 50 Einträge auf. Beginnend mit dem ersten Eintrag (0).
Bei der Ausgabe der detailierten Listen (grid) der Kanälen, Aufnahmen und EPG kann mit dem Parameter &limit=NN kann die maximale Anzahl von Einträgen erweitert werden.
Mit dem Parameter &start=XX kann festgelegt, werden ab welchem Eintrag die Ausgabe beginnen soll.
Videostream
Zum anschauen des Videobildes eines Kanales wird wieder die UUID benötigt. Geliefert wird ein
http://192.168.0.3:9981/stream/channel/8abd1c8c95f9f9c0f1c6d71e6cdece24