EPG API (ENG)

EPG API (ENG)

INTRODUCTION

EPG API is used to get the TV program information (EPG data) for linear channels.

Note
See also Channels API for additional documentation

API PATH

/api/channels

API METHODS

GET EPG EVENTS

REQUEST

Parameters:

RequirementNameDescriptionValues
MandatoryorganizationId id
OptionallcIdLinear Channel Idid
Optionalkeyword  
OptionalfromEvent start time fromtimestamp
OptionaltoEvent start time totimestamp
Optionalstartstart index 
Optionallimit  
Optionalorderby  
Optionalorder asc, desc
Optional/Testingreturn all
OptionalprotectionThe protection typesmartjoglmtv
OptionalurlThe encoded URL for protection 
 

*If lcId (Linear Channel ID) is present, the EPG data for that channel will be returned. Otherwise all channels data for organizationId will be returned.

RESPONSE

channels.json
{
  "channels": [
    {
      "logicalChannel": 1,
      "networkId": 2,
      "onId": 2,
      "primaryLanguage": "eng",
      "title": "FOX",
      "serviceId": 23083,
      "tsId": 2,
      "description": "FOX description",
      "devices": [
        {
          "id": 63001,
          "name": "1280x720 (4564 Kbps)",
        },
        {
          "id": 63002,
          "name": "1280x720 (6564 Kbps)",
          "url": "rtsp://46.137.171.102:1935/live/DemoStream"
        },
        {
          "id": 71112,
          "name": "640x360 (1264 Kbps)",
        }
      ],
      "bsId": 10
    }
 ]
}
epg.json
{
  "events": [
    {
      "videoUrls": [],
      "trailerUrls": [],
      "serviceId": 23083,
      "eventId": 185666,
      "description": {
        "fin": {
          "shortDescription": "Intialainen keittiö. Jakson teemana on intialainen keittiö, ja sen mausteinen eksotiikka. Santeri kokkaa lehtikaalisipsejä, kookos-katkarapucurrya ja kurkumalassia. Vapaa-ajan ohjelma. 24Kitchen.",
          "name": "24kitchen: Kapinakokki Santeri Hämäläinen",
          "longDescription": "Intialainen keittiö. Jakson teemana on intialainen keittiö, ja sen mausteinen eksotiikka. Santeri kokkaa lehtikaalisipsejä, kookos-katkarapucurrya ja kurkumalassia. Vapaa-ajan ohjelma. 24Kitchen."
        },
        "eng": {
          "shortDescription": "Intialainen keittiö. Jakson teemana on intialainen keittiö, ja sen mausteinen eksotiikka. Santeri kokkaa lehtikaalisipsejä, kookos-katkarapucurrya ja kurkumalassia. Vapaa-ajan ohjelma. 24Kitchen.",
          "name": "24kitchen: Kapinakokki Santeri Hämäläinen",
          "longDescription": "Intialainen keittiö. Jakson teemana on intialainen keittiö, ja sen mausteinen eksotiikka. Santeri kokkaa lehtikaalisipsejä, kookos-katkarapucurrya ja kurkumalassia. Vapaa-ajan ohjelma. 24Kitchen."
        }
      },
      "primaryLanguage": "eng",
      "ratings": [
        {
          "rating": 0,
          "country": 902
        }
      ],
      "info": {
        "startTime": "2014-07-08T08:45:00Z",
        "imageLarge": "",
        "duration": 1800,
        "imageMedium": "",
        "freeCaMode": 0,
        "contentType": 48,
        "imageSmall": ""
      }
    }
  ]
}

CHANNELS/EPG API V1.0 (DEPRECATED)

REQUEST

RequirementNameDescriptionValues
Mandatoryorganization_id id
Optionallc_idLinear Channel Idid
Optionalkeyword  
OptionalfromEvent start time fromtimestamp
OptionaltoEvent start time totimestamp
Optionalstartstart index 
Optionallimit  
Optionalorderby  
Optionalorder asc, desc
Optional/Testingreturn all
OptionalprotectionThe protection typesmartjoglmtv
OptionalurlThe encoded URL for protection 
 
  • Organization ID is hard-coded in the application, i.e. one client will always be making requests with same organization_id.
  • If lc_id is absent a list of channels is returned. If present, epg/events for that channel are returned. Other filters apply accordingly (i.e. to the content being returned).
  • NOTE: The parameter "return" is for internal/testing purposes only. This will return all channel data, regardless of its release date. By default (i.e. without this parameter), the service only returns data that has release date before/equal-to the request time.

XML RESPONSE EXAMPLES

channels.xml
<linear-channel-list>
    <channel service-id="1">
        <title>CNN</title>
        <description>Test video</description>
        <icon-small-url></icon-small-url>
        <icon-medium-url></icon-medium-url>
        <icon-large-url></icon-large-url>
        <device-list>
            <device id="1">
                <name>iphone</name>
                <icon-url></icon-url>
            </device>
            <device id="2">
                <name>android_phone</name>
                <icon-url></icon-url>
            </device>
        </device-list>
    </channel>
    <channel service-id="2">
        <title>NBC</title>
        <description>
            To josh with someone or be joshed by someone. It?s an odd phrase that comes from the name ?Joshua? and is used in everyday language meaning to joke or fool.
        </description>
        <device-list>
            <device id="1">
                <name>iphone</name>
                <icon-url></icon-url>
            </device>
            <device id="2">
                <name>android_phone</name>
                <icon-url></icon-url>
            </device>
        </device-list>
    </channel>
</linear-channel-list>
epg.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE eit SYSTEM "eit.dtd">
<eit total-events="2">
    <event>
        <id event-id="773" service-id="1"/>
        <info>
            <start-time>2010-09-30T13:00:00Z</start-time>
            <duration>1800</duration>
            <content-type>32</content-type>
            <free-ca-mode>0</free-ca-mode>
        </info>
        <description>
            <language-code>dan</language-code>
            <name>1 DR Update - nyheder og vejr</name>
            <short-description>DR Update med seneste nyt og dagens vejr.</short-description>
            <long-description>Se flere nyheder p?r.dk/update</long-description>
        </description>
    </event>
    <event>
        <id event-id="1014" service-id="1"/>
        <info>
            <start-time>2010-09-30T14:30:00Z</start-time>
            <duration>1800</duration>
            <content-type>20</content-type>
            <free-ca-mode>0</free-ca-mode>
        </info>
        <description>
            <language-code>eng</language-code>
            <name>1 News</name>
            <short-description>Daily news</short-description>
            <long-description></long-description>
        </description>
    </event>
</eit>

JSON RESPONSE EXAMPLES

channels.json
{"linear-channel-list":
    [
 
    {"icon-large-url":"",
    "logical-channel":0,
    "on-id":0,
    "device-list":[],
    "title":"MTV",
    "description":"",
    "bs-id":0,
    "service-id":17402,
    "network-id":0,
    "icon-medium-url":"",
    "ts-id":0},
 
    {"icon-large-url":"",
    "logical-channel":0,
    "on-id":0,
    "device-list":
        [{"id":18401,"name":"Preview","video-url":"www.test.url"},
         {"id":18501,"name":"Preview","video-url":"www.test.url"},
         {"id":18701,"name":"Preview","video-url":"www.test.url"}],
    "title":"CNN",
    "description":"",
    "bs-id":0,
    "service-id":18002,
    "network-id":0,
    "icon-medium-url":"",
    "ts-id":0}
 
    ]
}
epg.json
{"events":
    [{"video-url-list":
        [{"name":"Preview","url":"www.test.url"}],
    "id":
        {"service-id":17402,
        "event-id":17529},
    "trailer-url-list":
        [{"name":"Preview","url":"www.test.url"}],
    "description":
        [{"long-description":"Dutch TMZ","name":"Dutch TMZ","short-description":"Dutch TMZ","code":"nld"},
         {"long-description":"TMZ","name":"TMZ","short-description":"TMZ","code":"eng"}],
    "ratings":
        [{"rating":0,"country":902}],
    "info":
         "content-type":0,
         "duration":1800,
         "free-ca-mode":0,
         "start-time":"2013-09-03T08:00:00Z",
    }],
"total-events":1}

STREAM TOKEN PROTECTION

It is possible to define that stream is token protected for a channel.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE eit SYSTEM "eit.dtd">
<linear-channel-list>
	<channel service-id="52957" network-id="1" on-id="1" ts-id="1" broadcast-sid="1" logical-channel="1">
		<title>LMTV</title>
		<description>LMTV</description>
		<icon-small-url>https://213.157.93.29:4443/</icon-small-url>
		<icon-medium-url>https://213.157.93.29:4443/</icon-medium-url>
		<icon-large-url>https://213.157.93.29:4443/</icon-large-url>
	        <device-list>
		        <device id="52958">
		        	<name>1280x720 (4564 Kbps)</name>
                		<video-url>http://chkg.tdf-cdn.com/8336/index.m3u8</video-url>
		        	<protection>
					<type>smartjoglmtv</type>
		        	</protection>
	        	</device>
	        </device-list>
	</channel>
</linear-channel-list>
{"channels":
	[{"logicalChannel":1,
	"imageLarge":"",
	"title":"LMTV",
	"imageMedium":"",
	"serviceId":52957,
	"description":"LMTV",
	"tsId":1,
	"networkId":1,
	"onId":1,
	"devices":
		[{"protection":{"type":"smartjoglmtv"},
		"id":52958,
		"name":"1280x720 (4564 Kbps)",
		"url":"http://chkg.tdf-cdn.com/8336/index.m3u8"}],
	"imageSmall":"",
	"bsId":1}]
}

If the stream is token protected, then every time the stream should be played a new URL should be requested from the server. The parameter "protection" defines the type of the protection. The parameter "url" defines the encoded URL that should be used in token generation. The response will contain the token protected URL to play.
Example request: http://suite.icareus.com/json-connector-portlet/lc-json-connector?protection=smartjoglmtv&url=http%3A%2F%2Fchkg.tdf-cdn.com%2F8336%2Findex.m3u8
Example responce: http://chkg.tdf-cdn.com/8336/de38ae92fcf4de9d6d4b144cd88f01f8/52b84d0b/index.m3u8