EpisodesByTVShow

TV Shows datasource lets you create subscriptions for TV Shows and get updates when a new episode is released.

Hooks Query Language lets you customize what data and when you want to receive.

 

InputOutputCreditsFreshness
TVShowEpisodeTVMaze5 minutes

 

What you can get from this API

  • Get an update when a new Episode is released for a TV Show

How to use

As every datasource at Hooks, you can choose to pull the data in your preferred format or to set up a webhook to receive the data when something happens.  

As we offer many datasources, we have developed a custom SQL-Like language (Hooks Query Language) to be able to query each datasource in the same format. To create a subscription the first thing you need to do is to define an HQL query and then send this query to create subscription endpoint.

TV Shows datasource has a mandatory parameter TVShow and you can use an optional WHERE clause where you can filter the output data (Episode) in order to receive just the data you need. Hooks will then call your webhook once new data is available for your query. 

Step 1: Find a TV Show

TV Shows datasource has a mandatory input TVShow. You should specify which TVShow you want to get updates for using the FROM clause. For example, to create a subscription for “Get an update 1 hour before new Game of Thrones episode is released”  you can use the following query: 

SELECT * FROM 
EpisodesByTVShow(name = 'Game of Thrones') 
WHERE start_datetime.countdown = 3600

You can also use a TVShow id to create a subscription:

SELECT * FROM EpisodesByTVShow(id = 'TVShow_82') 
WHERE start_datetime.countdown = 3600

Please make sure that the id or the name of a TVShow is the one we have in our database. If you use a wrong name or id the HQL query will return an error and explain the reason.

To search for a TV Show, you can use an ambiguous query so Hooks will reply with an “Entity query is ambiguous” error and show you the list of possible values:

 

SELECT * FROM EpisodesByTVShow(name like 'Game of%')

This query will return a list of TVShows with a name starting with ‘Game of’:

{
    "status": "error",
    "error": {
        "message": "entity query is ambiguous"
    },
    "ambiguous_entities": [
        {
            "_entity_type": "TVShow",
            "_id": "TVShow_82",
            "externals": {
                "imdb": "tt0944947",
                "thetvdb": 121361,
                "tvrage": 24493
            },
            "genres": [
                "Drama",
                "Adventure",
                "Fantasy"
            ],
            "id": "TVShow_82",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
            },
            "language": "English",
            "name": "Game of Thrones",
            "network": {
                "country": {
                    "code": "US",
                    "name": "United States",
                    "timezone": "America/New_York"
                },
                "id": 8,
                "name": "HBO"
            },
            "officialSite": "http://www.hbo.com/game-of-thrones",
            "premiered": "2011-04-17",
            "rating": {
                "average": 9.3
            },
            "runtime": 60,
            "schedule": {
                "days": [
                    "Sunday"
                ],
                "time": "21:00"
            },
            "status": "Running",
            "summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
            "tvmaze_id": 82,
            "type": "Scripted",
            "updated": 1517168016,
            "url": "http://www.tvmaze.com/shows/82/game-of-thrones",
            "webChannel": {
                "country": {
                    "code": "US",
                    "name": "United States",
                    "timezone": "America/New_York"
                },
                "id": 22,
                "name": "HBO Go"
            },
            "weight": 99
        },
        {
            "_entity_type": "TVShow",
            "_id": "TVShow_5354",
            "externals": {
                "imdb": "tt3776022",
                "thetvdb": 282055,
                "tvrage": 42185
            },
            "genres": [],
            "id": "TVShow_5354",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/22/55403.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/22/55403.jpg"
            },
            "language": "English",
            "name": "Game of Crowns",
            "network": {
                "country": {
                    "code": "US",
                    "name": "United States",
                    "timezone": "America/New_York"
                },
                "id": 52,
                "name": "Bravo"
            },
            "officialSite": "http://www.bravotv.com/game-of-crowns",
            "premiered": "2014-07-13",
            "rating": {
                "average": null
            },
            "runtime": 60,
            "schedule": {
                "days": [
                    "Sunday"
                ],
                "time": "22:00"
            },
            "status": "To Be Determined",
            "summary": "<p><b>Game of Crowns</b> is a docu-series that follows six pageant wives competing on the \"Mrs.\" circuit whose lives revolve around glamour, perfection and winning at any cost. The cast includes Shelley Carbone, Lynne Diamante, Leha Guilmette, Lori-Ann Marchese, Susanna Paliotta, and Vanassa Sebastian. From trophy wives to pageant moms, these ultra-competitive ladies share their love of the game and will stop at nothing to win local and national pageants for beauty queen status. In each hour-long episode, the ladies will compete to snatch the spotlight while viewers watch their intense preparation that includes obsessing over the perfect swimsuit, working tirelessly with trainers and honing their interview skills with coaches -- all while being dedicated mothers and wives. How will the women settle their scores both on the stage and off?</p>",
            "tvmaze_id": 5354,
            "type": "Reality",
            "updated": 1478154125,
            "url": "http://www.tvmaze.com/shows/5354/game-of-crowns",
            "webChannel": null,
            "weight": 0
        },
        {
            "_entity_type": "TVShow",
            "_id": "TVShow_16859",
            "externals": {
                "imdb": "tt3525596",
                "thetvdb": 278591,
                "tvrage": null
            },
            "genres": [],
            "id": "TVShow_16859",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/56/141207.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/56/141207.jpg"
            },
            "language": "English",
            "name": "Game of Arms",
            "network": {
                "country": {
                    "code": "US",
                    "name": "United States",
                    "timezone": "America/New_York"
                },
                "id": 20,
                "name": "AMC"
            },
            "officialSite": null,
            "premiered": "2014-02-25",
            "rating": {
                "average": null
            },
            "runtime": 60,
            "schedule": {
                "days": [
                    "Tuesday"
                ],
                "time": "22:00"
            },
            "status": "Ended",
            "summary": "<p><i>Game of Arms</i> is a look inside the raw and highly competitive world of American arm wrestling. The series follows the members of five regional arm wrestling clubs in Erie, PA, Kansas City, KS, New York, NY, Sacramento, CA and Baton Rouge, LA as they hit the road and wager their reputation, relationships and money for the sport. Game of Arms not only focuses on the technique and skill in this high-stakes world, but also the family, careers and personal struggles of each man outside of the sport. Each episode features a dramatic regional match, leading to a tournament finale where the entire cast will compete for prize money and bragging rights.</p>",
            "tvmaze_id": 16859,
            "type": "Reality",
            "updated": 1462658234,
            "url": "http://www.tvmaze.com/shows/16859/game-of-arms",
            "webChannel": null,
            "weight": 0
        },
        {
            "_entity_type": "TVShow",
            "_id": "TVShow_5071",
            "externals": {
                "imdb": "tt4074374",
                "thetvdb": 295641,
                "tvrage": null
            },
            "genres": [
                "Drama",
                "Action",
                "Crime"
            ],
            "id": "TVShow_5071",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/50/125757.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/50/125757.jpg"
            },
            "language": "English",
            "name": "Game of Silence",
            "network": {
                "country": {
                    "code": "US",
                    "name": "United States",
                    "timezone": "America/New_York"
                },
                "id": 1,
                "name": "NBC"
            },
            "officialSite": "http://www.nbc.com/game-of-silence",
            "premiered": "2016-04-12",
            "rating": {
                "average": 7.5
            },
            "runtime": 60,
            "schedule": {
                "days": [
                    "Thursday"
                ],
                "time": "22:00"
            },
            "status": "Ended",
            "summary": "<p>Five best friends have a dark secret they thought was buried 25 years ago, but they soon discover that you can't hide your past forever. A gripping new drama about friendship, love, revenge and the moral dilemma of how far one will go in the pursuit of justice.</p><p>Jackson Brooks is a successful attorney who seems to have it all. He's engaged to his boss, Marina, and he's on the fast track to becoming partner at his firm, but his world is turned upside down when his long-lost childhood friends unexpectedly reappear after 25 years.</p>",
            "tvmaze_id": 5071,
            "type": "Scripted",
            "updated": 1516296268,
            "url": "http://www.tvmaze.com/shows/5071/game-of-silence",
            "webChannel": null,
            "weight": 40
        },
        {
            "_entity_type": "TVShow",
            "_id": "TVShow_10170",
            "externals": {
                "imdb": "tt3780362",
                "thetvdb": 278339,
                "tvrage": null
            },
            "genres": [],
            "id": "TVShow_10170",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/34/86753.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/34/86753.jpg"
            },
            "language": "English",
            "name": "Game of Stones",
            "network": {
                "country": {
                    "code": "US",
                    "name": "United States",
                    "timezone": "America/New_York"
                },
                "id": 66,
                "name": "Discovery Channel"
            },
            "officialSite": "http://www.discovery.com/tv-shows/game-of-stones/",
            "premiered": "2014-02-28",
            "rating": {
                "average": null
            },
            "runtime": 60,
            "schedule": {
                "days": [],
                "time": ""
            },
            "status": "Ended",
            "summary": "<p><i><b>\"Game of Stones\"</b></i> is about an \"extreme gem hunter\" named Don Kogen, who is described as a \"legend\" in the business. Kogen, who is CEO of Gem Guys Inc., specializes in rare stones \"from the most dangerous and lawless places on earth, racing the clock to be the first to each new find, always staying one step ahead of the competition.\"</p>",
            "tvmaze_id": 10170,
            "type": "Documentary",
            "updated": 1459451369,
            "url": "http://www.tvmaze.com/shows/10170/game-of-stones",
            "webChannel": null,
            "weight": 0
        },
        {
            "_entity_type": "TVShow",
            "_id": "TVShow_15938",
            "externals": {
                "imdb": null,
                "thetvdb": null,
                "tvrage": null
            },
            "genres": [],
            "id": "TVShow_15938",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/53/133810.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/53/133810.jpg"
            },
            "language": "English",
            "name": "Game of Homes",
            "network": {
                "country": {
                    "code": "CA",
                    "name": "Canada",
                    "timezone": "Canada/Atlantic"
                },
                "id": 286,
                "name": "W Network"
            },
            "officialSite": "http://www.wnetwork.com/shows/game-homes",
            "premiered": "2015-03-17",
            "rating": {
                "average": null
            },
            "runtime": 60,
            "schedule": {
                "days": [
                    "Tuesday"
                ],
                "time": "22:00"
            },
            "status": "Running",
            "summary": "<p>In <b>Game of Homes</b>, teams of skilled amateur home renovators compete for the chance to trade their skills for the prize of a lifetime. The teams save rundown houses that are marked to be torn down and revive them into dream homes. Each team must redo the houses room by room, as they cope with small budgets, tight deadlines and even tighter living spaces.</p><p>The action-based series pits each team's skill, ingenuity and teamwork against each other. In the finale, in addition to the judges, the public will cast their vote.</p><p>The winning couple each week receives a prize that is theirs to keep. In the dramatic finale, the team whose finished house is voted the best – WINS THEIR HOUSE AND A PLOT OF LAND TO PUT IT ON!</p>",
            "tvmaze_id": 15938,
            "type": "Reality",
            "updated": 1477448915,
            "url": "http://www.tvmaze.com/shows/15938/game-of-homes",
            "webChannel": null,
            "weight": 0
        },
        {
            "_entity_type": "TVShow",
            "_id": "TVShow_21155",
            "externals": {
                "imdb": null,
                "thetvdb": null,
                "tvrage": null
            },
            "genres": [
                "Romance"
            ],
            "id": "TVShow_21155",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/100/251499.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/100/251499.jpg"
            },
            "language": "English",
            "name": "Game of Clones",
            "network": {
                "country": {
                    "code": "GB",
                    "name": "United Kingdom",
                    "timezone": "Europe/London"
                },
                "id": 41,
                "name": "E4"
            },
            "officialSite": "http://www.channel4.com/programmes/game-of-clones",
            "premiered": "2017-02-27",
            "rating": {
                "average": null
            },
            "runtime": 30,
            "schedule": {
                "days": [
                    "Monday",
                    "Tuesday",
                    "Wednesday",
                    "Thursday",
                    "Friday"
                ],
                "time": "19:30"
            },
            "status": "Running",
            "summary": "<p>Singletons create their perfect match as an avatar and then are paired off with ten real prospective partners who have a similar look. The dopplegangers then enter a house with the singleton who sets them challenges and eliminates them based on their performance.</p>",
            "tvmaze_id": 21155,
            "type": "Reality",
            "updated": 1489486786,
            "url": "http://www.tvmaze.com/shows/21155/game-of-clones",
            "webChannel": null,
            "weight": 0
        },
        {
            "_entity_type": "TVShow",
            "_id": "TVShow_33267",
            "externals": {
                "imdb": null,
                "thetvdb": 331912,
                "tvrage": null
            },
            "genres": [
                "Action",
                "Thriller",
                "Mystery"
            ],
            "id": "TVShow_33267",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/134/336017.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/134/336017.jpg"
            },
            "language": "Chinese",
            "name": "Game of Hunting",
            "network": {
                "country": {
                    "code": "CN",
                    "name": "China",
                    "timezone": "Asia/Urumqi"
                },
                "id": 276,
                "name": "Hunan Television"
            },
            "officialSite": null,
            "premiered": "2017-11-06",
            "rating": {
                "average": 6
            },
            "runtime": 45,
            "schedule": {
                "days": [
                    "Monday"
                ],
                "time": "19:30"
            },
            "status": "Running",
            "summary": "<p>Zheng Qiu Dong is a persistent man when pursuing his ideals. He survives through business failures, economic pitfalls purposely set up by adversaries and unfortunate romances without losing his moral principles to become an elite of the financial world, described metaphorically as the \"hunting ground\".</p>",
            "tvmaze_id": 33267,
            "type": "Scripted",
            "updated": 1513508208,
            "url": "http://www.tvmaze.com/shows/33267/game-of-hunting",
            "webChannel": null,
            "weight": 0
        }
    ]
}

 

Optional: Pull the data

You can use fetch endpoint to request the data currently available for your HQL query. Hooks will return the latest data available for HQL query. The result may be empty if we currently don’t have any data available for your query.

To pull the data for “Get an update 1 hour before new Game of Thrones episode is released” you can use:

curl -H "Content-type: application/json" -d '{
	"query": "SELECT * FROM EpisodesByTVShow(name = \'Game of Thrones\') WHERE start_datetime.countdown = 3600" }' 'http://api.hooksdata.io/v1/subscriptions'

This will return an empty result because, as all the current episodes have already started, all the start_datetime.countdownattributes of each episode have a negative value.

{
    "matches_count": 0,
    "results": []
}

To pull the data for season 1 episodes of Game of Thrones, just change the WHERE condition to WHERE season=1:

curl -H "Content-type: application/json" -d '{
	"query": "SELECT * FROM EpisodesByTVShow(name = \'Game of Thrones\') WHERE season = 1" }' 'http://api.hooksdata.io/v1/subscriptions'

The above request will return:

{
    "matches_count": 10,
    "results": [
        {
            "_entity_type": "Episode",
            "_id": "Episode_4952",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2668.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2668.jpg"
            },
            "link": "http://www.tvmaze.com/episodes/4952/game-of-thrones-1x01-winter-is-coming",
            "number": 1,
            "runtime": 60,
            "season": 1,
            "start_datetime": {
                "countdown": -216035133,
                "datetime": "2011-04-18T01:00:00+0000",
                "timestamp": 1303088400
            },
            "summary": "Lord Eddard Stark, ruler of the North, is summoned to court by his old friend, King Robert Baratheon, to serve as the King's Hand. Eddard reluctantly agrees after learning of a possible threat to the King's life. Eddard's bastard son Jon Snow must make a painful decision about his own future, while in the distant east Viserys Targaryen plots to reclaim his father's throne, usurped by Robert, by selling his sister in marriage.",
            "title": "Winter is Coming",
            "tvmaze_episode_id": 4952,
            "tvshow": {
                "_entity_type": "TVShow",
                "_id": "TVShow_82",
                "externals": {
                    "imdb": "tt0944947",
                    "thetvdb": 121361,
                    "tvrage": 24493
                },
                "genres": [
                    "Drama",
                    "Adventure",
                    "Fantasy"
                ],
                "id": "TVShow_82",
                "image": {
                    "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
                    "original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
                },
                "language": "English",
                "name": "Game of Thrones",
                "network": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 8,
                    "name": "HBO"
                },
                "officialSite": "http://www.hbo.com/game-of-thrones",
                "premiered": "2011-04-17",
                "rating": {
                    "average": 9.3
                },
                "runtime": 60,
                "schedule": {
                    "days": [
                        "Sunday"
                    ],
                    "time": "21:00"
                },
                "status": "Running",
                "summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
                "tvmaze_id": 82,
                "type": "Scripted",
                "updated": 1517168016,
                "url": "http://www.tvmaze.com/shows/82/game-of-thrones",
                "webChannel": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 22,
                    "name": "HBO Go"
                },
                "weight": 99
            }
        },
        {
            "_entity_type": "Episode",
            "_id": "Episode_4953",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2669.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2669.jpg"
            },
            "link": "http://www.tvmaze.com/episodes/4953/game-of-thrones-1x02-the-kingsroad",
            "number": 2,
            "runtime": 60,
            "season": 1,
            "start_datetime": {
                "countdown": -215430333,
                "datetime": "2011-04-25T01:00:00+0000",
                "timestamp": 1303693200
            },
            "summary": "An incident on the Kingsroad threatens Eddard and Robert's friendship. Jon and Tyrion travel to the Wall, where they discover that the reality of the Night's Watch may not match the heroic image of it.",
            "title": "The Kingsroad",
            "tvmaze_episode_id": 4953,
            "tvshow": {
                "_entity_type": "TVShow",
                "_id": "TVShow_82",
                "externals": {
                    "imdb": "tt0944947",
                    "thetvdb": 121361,
                    "tvrage": 24493
                },
                "genres": [
                    "Drama",
                    "Adventure",
                    "Fantasy"
                ],
                "id": "TVShow_82",
                "image": {
                    "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
                    "original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
                },
                "language": "English",
                "name": "Game of Thrones",
                "network": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 8,
                    "name": "HBO"
                },
                "officialSite": "http://www.hbo.com/game-of-thrones",
                "premiered": "2011-04-17",
                "rating": {
                    "average": 9.3
                },
                "runtime": 60,
                "schedule": {
                    "days": [
                        "Sunday"
                    ],
                    "time": "21:00"
                },
                "status": "Running",
                "summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
                "tvmaze_id": 82,
                "type": "Scripted",
                "updated": 1517168016,
                "url": "http://www.tvmaze.com/shows/82/game-of-thrones",
                "webChannel": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 22,
                    "name": "HBO Go"
                },
                "weight": 99
            }
        },
        {
            "_entity_type": "Episode",
            "_id": "Episode_4954",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2671.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2671.jpg"
            },
            "link": "http://www.tvmaze.com/episodes/4954/game-of-thrones-1x03-lord-snow",
            "number": 3,
            "runtime": 60,
            "season": 1,
            "start_datetime": {
                "countdown": -214825533,
                "datetime": "2011-05-02T01:00:00+0000",
                "timestamp": 1304298000
            },
            "summary": "Jon Snow attempts to find his place amongst the Night's Watch. Eddard and his daughters arrive at King's Landing.",
            "title": "Lord Snow",
            "tvmaze_episode_id": 4954,
            "tvshow": {
                "_entity_type": "TVShow",
                "_id": "TVShow_82",
                "externals": {
                    "imdb": "tt0944947",
                    "thetvdb": 121361,
                    "tvrage": 24493
                },
                "genres": [
                    "Drama",
                    "Adventure",
                    "Fantasy"
                ],
                "id": "TVShow_82",
                "image": {
                    "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
                    "original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
                },
                "language": "English",
                "name": "Game of Thrones",
                "network": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 8,
                    "name": "HBO"
                },
                "officialSite": "http://www.hbo.com/game-of-thrones",
                "premiered": "2011-04-17",
                "rating": {
                    "average": 9.3
                },
                "runtime": 60,
                "schedule": {
                    "days": [
                        "Sunday"
                    ],
                    "time": "21:00"
                },
                "status": "Running",
                "summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
                "tvmaze_id": 82,
                "type": "Scripted",
                "updated": 1517168016,
                "url": "http://www.tvmaze.com/shows/82/game-of-thrones",
                "webChannel": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 22,
                    "name": "HBO Go"
                },
                "weight": 99
            }
        },
        {
            "_entity_type": "Episode",
            "_id": "Episode_4955",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2673.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2673.jpg"
            },
            "link": "http://www.tvmaze.com/episodes/4955/game-of-thrones-1x04-cripples-bastards-and-broken-things",
            "number": 4,
            "runtime": 60,
            "season": 1,
            "start_datetime": {
                "countdown": -214220733,
                "datetime": "2011-05-09T01:00:00+0000",
                "timestamp": 1304902800
            },
            "summary": "Tyrion stops at Winterfell on his way home and gets a frosty reception from Robb Stark. Eddard's investigation into the death of his predecessor gets underway.",
            "title": "Cripples, Bastards, and Broken Things",
            "tvmaze_episode_id": 4955,
            "tvshow": {
                "_entity_type": "TVShow",
                "_id": "TVShow_82",
                "externals": {
                    "imdb": "tt0944947",
                    "thetvdb": 121361,
                    "tvrage": 24493
                },
                "genres": [
                    "Drama",
                    "Adventure",
                    "Fantasy"
                ],
                "id": "TVShow_82",
                "image": {
                    "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
                    "original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
                },
                "language": "English",
                "name": "Game of Thrones",
                "network": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 8,
                    "name": "HBO"
                },
                "officialSite": "http://www.hbo.com/game-of-thrones",
                "premiered": "2011-04-17",
                "rating": {
                    "average": 9.3
                },
                "runtime": 60,
                "schedule": {
                    "days": [
                        "Sunday"
                    ],
                    "time": "21:00"
                },
                "status": "Running",
                "summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
                "tvmaze_id": 82,
                "type": "Scripted",
                "updated": 1517168016,
                "url": "http://www.tvmaze.com/shows/82/game-of-thrones",
                "webChannel": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 22,
                    "name": "HBO Go"
                },
                "weight": 99
            }
        },
        {
            "_entity_type": "Episode",
            "_id": "Episode_4956",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2674.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2674.jpg"
            },
            "link": "http://www.tvmaze.com/episodes/4956/game-of-thrones-1x05-the-wolf-and-the-lion",
            "number": 5,
            "runtime": 60,
            "season": 1,
            "start_datetime": {
                "countdown": -213615933,
                "datetime": "2011-05-16T01:00:00+0000",
                "timestamp": 1305507600
            },
            "summary": "Catelyn's actions on the road have repercussions for Eddard. Tyrion enjoys the dubious hospitality of the Eyrie.",
            "title": "The Wolf and the Lion",
            "tvmaze_episode_id": 4956,
            "tvshow": {
                "_entity_type": "TVShow",
                "_id": "TVShow_82",
                "externals": {
                    "imdb": "tt0944947",
                    "thetvdb": 121361,
                    "tvrage": 24493
                },
                "genres": [
                    "Drama",
                    "Adventure",
                    "Fantasy"
                ],
                "id": "TVShow_82",
                "image": {
                    "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
                    "original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
                },
                "language": "English",
                "name": "Game of Thrones",
                "network": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 8,
                    "name": "HBO"
                },
                "officialSite": "http://www.hbo.com/game-of-thrones",
                "premiered": "2011-04-17",
                "rating": {
                    "average": 9.3
                },
                "runtime": 60,
                "schedule": {
                    "days": [
                        "Sunday"
                    ],
                    "time": "21:00"
                },
                "status": "Running",
                "summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
                "tvmaze_id": 82,
                "type": "Scripted",
                "updated": 1517168016,
                "url": "http://www.tvmaze.com/shows/82/game-of-thrones",
                "webChannel": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 22,
                    "name": "HBO Go"
                },
                "weight": 99
            }
        },
        {
            "_entity_type": "Episode",
            "_id": "Episode_4957",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2676.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2676.jpg"
            },
            "link": "http://www.tvmaze.com/episodes/4957/game-of-thrones-1x06-a-golden-crown",
            "number": 6,
            "runtime": 60,
            "season": 1,
            "start_datetime": {
                "countdown": -213011133,
                "datetime": "2011-05-23T01:00:00+0000",
                "timestamp": 1306112400
            },
            "summary": "Viserys is increasingly frustrated by the lack of progress towards gaining his crown.",
            "title": "A Golden Crown",
            "tvmaze_episode_id": 4957,
            "tvshow": {
                "_entity_type": "TVShow",
                "_id": "TVShow_82",
                "externals": {
                    "imdb": "tt0944947",
                    "thetvdb": 121361,
                    "tvrage": 24493
                },
                "genres": [
                    "Drama",
                    "Adventure",
                    "Fantasy"
                ],
                "id": "TVShow_82",
                "image": {
                    "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
                    "original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
                },
                "language": "English",
                "name": "Game of Thrones",
                "network": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 8,
                    "name": "HBO"
                },
                "officialSite": "http://www.hbo.com/game-of-thrones",
                "premiered": "2011-04-17",
                "rating": {
                    "average": 9.3
                },
                "runtime": 60,
                "schedule": {
                    "days": [
                        "Sunday"
                    ],
                    "time": "21:00"
                },
                "status": "Running",
                "summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
                "tvmaze_id": 82,
                "type": "Scripted",
                "updated": 1517168016,
                "url": "http://www.tvmaze.com/shows/82/game-of-thrones",
                "webChannel": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 22,
                    "name": "HBO Go"
                },
                "weight": 99
            }
        },
        {
            "_entity_type": "Episode",
            "_id": "Episode_4958",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2677.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2677.jpg"
            },
            "link": "http://www.tvmaze.com/episodes/4958/game-of-thrones-1x07-you-win-or-you-die",
            "number": 7,
            "runtime": 60,
            "season": 1,
            "start_datetime": {
                "countdown": -212406333,
                "datetime": "2011-05-30T01:00:00+0000",
                "timestamp": 1306717200
            },
            "summary": "Eddard's investigations in King's Landing reach a climax and a dark secret is revealed.",
            "title": "You Win or You Die",
            "tvmaze_episode_id": 4958,
            "tvshow": {
                "_entity_type": "TVShow",
                "_id": "TVShow_82",
                "externals": {
                    "imdb": "tt0944947",
                    "thetvdb": 121361,
                    "tvrage": 24493
                },
                "genres": [
                    "Drama",
                    "Adventure",
                    "Fantasy"
                ],
                "id": "TVShow_82",
                "image": {
                    "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
                    "original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
                },
                "language": "English",
                "name": "Game of Thrones",
                "network": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 8,
                    "name": "HBO"
                },
                "officialSite": "http://www.hbo.com/game-of-thrones",
                "premiered": "2011-04-17",
                "rating": {
                    "average": 9.3
                },
                "runtime": 60,
                "schedule": {
                    "days": [
                        "Sunday"
                    ],
                    "time": "21:00"
                },
                "status": "Running",
                "summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
                "tvmaze_id": 82,
                "type": "Scripted",
                "updated": 1517168016,
                "url": "http://www.tvmaze.com/shows/82/game-of-thrones",
                "webChannel": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 22,
                    "name": "HBO Go"
                },
                "weight": 99
            }
        },
        {
            "_entity_type": "Episode",
            "_id": "Episode_4959",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2678.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2678.jpg"
            },
            "link": "http://www.tvmaze.com/episodes/4959/game-of-thrones-1x08-the-pointy-end",
            "number": 8,
            "runtime": 60,
            "season": 1,
            "start_datetime": {
                "countdown": -211801533,
                "datetime": "2011-06-06T01:00:00+0000",
                "timestamp": 1307322000
            },
            "summary": "Tyrion joins his father's army with unexpected allies. Events in King's Landing take a turn for the worse as Arya's lessons are put to the test.",
            "title": "The Pointy End",
            "tvmaze_episode_id": 4959,
            "tvshow": {
                "_entity_type": "TVShow",
                "_id": "TVShow_82",
                "externals": {
                    "imdb": "tt0944947",
                    "thetvdb": 121361,
                    "tvrage": 24493
                },
                "genres": [
                    "Drama",
                    "Adventure",
                    "Fantasy"
                ],
                "id": "TVShow_82",
                "image": {
                    "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
                    "original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
                },
                "language": "English",
                "name": "Game of Thrones",
                "network": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 8,
                    "name": "HBO"
                },
                "officialSite": "http://www.hbo.com/game-of-thrones",
                "premiered": "2011-04-17",
                "rating": {
                    "average": 9.3
                },
                "runtime": 60,
                "schedule": {
                    "days": [
                        "Sunday"
                    ],
                    "time": "21:00"
                },
                "status": "Running",
                "summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
                "tvmaze_id": 82,
                "type": "Scripted",
                "updated": 1517168016,
                "url": "http://www.tvmaze.com/shows/82/game-of-thrones",
                "webChannel": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 22,
                    "name": "HBO Go"
                },
                "weight": 99
            }
        },
        {
            "_entity_type": "Episode",
            "_id": "Episode_4960",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2679.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2679.jpg"
            },
            "link": "http://www.tvmaze.com/episodes/4960/game-of-thrones-1x09-baelor",
            "number": 9,
            "runtime": 60,
            "season": 1,
            "start_datetime": {
                "countdown": -211196733,
                "datetime": "2011-06-13T01:00:00+0000",
                "timestamp": 1307926800
            },
            "summary": "Catelyn must negotiate with the irascible Lord Walder Frey.",
            "title": "Baelor",
            "tvmaze_episode_id": 4960,
            "tvshow": {
                "_entity_type": "TVShow",
                "_id": "TVShow_82",
                "externals": {
                    "imdb": "tt0944947",
                    "thetvdb": 121361,
                    "tvrage": 24493
                },
                "genres": [
                    "Drama",
                    "Adventure",
                    "Fantasy"
                ],
                "id": "TVShow_82",
                "image": {
                    "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
                    "original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
                },
                "language": "English",
                "name": "Game of Thrones",
                "network": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 8,
                    "name": "HBO"
                },
                "officialSite": "http://www.hbo.com/game-of-thrones",
                "premiered": "2011-04-17",
                "rating": {
                    "average": 9.3
                },
                "runtime": 60,
                "schedule": {
                    "days": [
                        "Sunday"
                    ],
                    "time": "21:00"
                },
                "status": "Running",
                "summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
                "tvmaze_id": 82,
                "type": "Scripted",
                "updated": 1517168016,
                "url": "http://www.tvmaze.com/shows/82/game-of-thrones",
                "webChannel": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 22,
                    "name": "HBO Go"
                },
                "weight": 99
            }
        },
        {
            "_entity_type": "Episode",
            "_id": "Episode_4961",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2681.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2681.jpg"
            },
            "link": "http://www.tvmaze.com/episodes/4961/game-of-thrones-1x10-fire-and-blood",
            "number": 10,
            "runtime": 60,
            "season": 1,
            "start_datetime": {
                "countdown": -210591933,
                "datetime": "2011-06-20T01:00:00+0000",
                "timestamp": 1308531600
            },
            "summary": "Daenerys must realize her destiny. Jaime finds himself in an unfamiliar predicament.",
            "title": "Fire and Blood",
            "tvmaze_episode_id": 4961,
            "tvshow": {
                "_entity_type": "TVShow",
                "_id": "TVShow_82",
                "externals": {
                    "imdb": "tt0944947",
                    "thetvdb": 121361,
                    "tvrage": 24493
                },
                "genres": [
                    "Drama",
                    "Adventure",
                    "Fantasy"
                ],
                "id": "TVShow_82",
                "image": {
                    "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
                    "original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
                },
                "language": "English",
                "name": "Game of Thrones",
                "network": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 8,
                    "name": "HBO"
                },
                "officialSite": "http://www.hbo.com/game-of-thrones",
                "premiered": "2011-04-17",
                "rating": {
                    "average": 9.3
                },
                "runtime": 60,
                "schedule": {
                    "days": [
                        "Sunday"
                    ],
                    "time": "21:00"
                },
                "status": "Running",
                "summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
                "tvmaze_id": 82,
                "type": "Scripted",
                "updated": 1517168016,
                "url": "http://www.tvmaze.com/shows/82/game-of-thrones",
                "webChannel": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 22,
                    "name": "HBO Go"
                },
                "weight": 99
            }
        }
    ]
}

The above example returns 10 Game of Thrones episodes from season 1.

You can see all the properties of the Episode entity and use any of them in the WHERE clause of HQL query:

{
            "_entity_type": "Episode",
            "_id": "Episode_4961",
            "image": {
                "medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2681.jpg",
                "original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2681.jpg"
            },
            "link": "http://www.tvmaze.com/episodes/4961/game-of-thrones-1x10-fire-and-blood",
            "number": 10,
            "runtime": 60,
            "season": 1,
            "start_datetime": {
                "countdown": -210591933,
                "datetime": "2011-06-20T01:00:00+0000",
                "timestamp": 1308531600
            },
            "summary": "Daenerys must realize her destiny. Jaime finds himself in an unfamiliar predicament.",
            "title": "Fire and Blood",
            "tvmaze_episode_id": 4961,
            "tvshow": {
                "_entity_type": "TVShow",
                "_id": "TVShow_82",
                "externals": {
                    "imdb": "tt0944947",
                    "thetvdb": 121361,
                    "tvrage": 24493
                },
                "genres": [
                    "Drama",
                    "Adventure",
                    "Fantasy"
                ],
                "id": "TVShow_82",
                "image": {
                    "medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
                    "original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
                },
                "language": "English",
                "name": "Game of Thrones",
                "network": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 8,
                    "name": "HBO"
                },
                "officialSite": "http://www.hbo.com/game-of-thrones",
                "premiered": "2011-04-17",
                "rating": {
                    "average": 9.3
                },
                "runtime": 60,
                "schedule": {
                    "days": [
                        "Sunday"
                    ],
                    "time": "21:00"
                },
                "status": "Running",
                "summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
                "tvmaze_id": 82,
                "type": "Scripted",
                "updated": 1517168016,
                "url": "http://www.tvmaze.com/shows/82/game-of-thrones",
                "webChannel": {
                    "country": {
                        "code": "US",
                        "name": "United States",
                        "timezone": "America/New_York"
                    },
                    "id": 22,
                    "name": "HBO Go"
                },
                "weight": 99
            }
        }


Step 2: 
Customize subscription

Hooks provide an elegant mechanism for creating subscriptions using Hooks Query Language. It has a similar notation to SQL and lets you define each subscription with a simple HQL query. 

To create a subscription to “Send me updates 1 hour before a new episode of Game of Thrones is released” you can use this HQL query:

SELECT * FROM EpisodesByTVShow(name = 'Game of Thrones')
WHERE start_datetime.countdown = 3600

Once this HQL query has new results – one hour before GOT episode is released – Hooks will send you Episode object to your webhook:

{
   "matches_count":1,
   "results":[
      {
         "_entity_type":"Episode",
         "_id":"Episode_4952",
         "image":{
            "medium":"http://static.tvmaze.com/uploads/images/medium_landscape/1/2668.jpg",
            "original":"http://static.tvmaze.com/uploads/images/original_untouched/1/2668.jpg"
         },
         "link":"http://www.tvmaze.com/episodes/4952/game-of-thrones-1x01-winter-is-coming",
         "number":1,
         "runtime":60,
         "season":1,
         "start_datetime":{
            "countdown":-215980846,
            "datetime":"2011-04-18T01:00:00+0000",
            "timestamp":1303088400
         },
         "summary":"Lord Eddard Stark, ruler of the North, is summoned to court by his old friend, King Robert Baratheon, to serve as the King's Hand. Eddard reluctantly agrees after learning of a possible threat to the King's life. Eddard's bastard son Jon Snow must make a painful decision about his own future, while in the distant east Viserys Targaryen plots to reclaim his father's throne, usurped by Robert, by selling his sister in marriage.",
         "title":"Winter is Coming",
         "tvmaze_episode_id":4952,
         "tvshow":{
            "_entity_type":"TVShow",
            "_id":"TVShow_82",
            "externals":{
               "imdb":"tt0944947",
               "thetvdb":121361,
               "tvrage":24493
            },
            "genres":[
               "Drama",
               "Adventure",
               "Fantasy"
            ],
            "id":"TVShow_82",
            "image":{
               "medium":"http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
               "original":"http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
            },
            "language":"English",
            "name":"Game of Thrones",
            "network":{
               "country":{
                  "code":"US",
                  "name":"United States",
                  "timezone":"America/New_York"
               },
               "id":8,
               "name":"HBO"
            },
            "officialSite":"http://www.hbo.com/game-of-thrones",
            "premiered":"2011-04-17",
            "rating":{
               "average":9.3
            },
            "runtime":60,
            "schedule":{
               "days":[
                  "Sunday"
               ],
               "time":"21:00"
            },
            "status":"Running",
            "summary":"<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
            "tvmaze_id":82,
            "type":"Scripted",
            "updated":1517168016,
            "url":"http://www.tvmaze.com/shows/82/game-of-thrones",
            "webChannel":{
               "country":{
                  "code":"US",
                  "name":"United States",
                  "timezone":"America/New_York"
               },
               "id":22,
               "name":"HBO Go"
            },
            "weight":99
         }
      }
   ]
}


Step 3: 
Create subscription

To create a subscription you just need to send an HQL query and a title of your choice to subscriptions endpoint:

curl -H "Content-type: application/json" -d '{
	"query": "SELECT * FROM EpisodesByTVShow(name = \'Game of Thrones\') WHERE start_datetime.countdown = 3600"
}' 'http://api.hooksdata.io/v1/subscriptions'

Hooks will then create a subscription on our servers and call your webhook once new data is available for your query.

Examples

Using HQL you can customize what data you want to select from a datasource and also filter the output using a WHERE clause. The following examples show how you can use HQL to choose just the data you need:

Get updates 1 hour before for all new season 2 episodes of Game of Thrones:

SELECT * FROM EpisodesByTVShow(name = 'Game of Thrones') 
WHERE season = 2 
AND start_datetime.countdown = 3600

Get updates 1 hour before for all new Game of Thrones episodes:

SELECT * FROM EpisodesByTVShow(name = 'Game of Thrones') 
WHERE start_datetime.countdown = 3600