Back to top

CTOON API

Responses in this documentation are examples that have been shortened. Feel free to GET the ressources yourselves to try it out.

Rate-limits

Currently, we’re not rate-limiting requests, but note that it might be introduced if we notice some clients hammering our servers. Please be responsible and try to wait 2 minutes in between requests.

Schedule

API version 2.0.0

Data related to schedules.

Available dates

Get all days we have
GET/schedule/v2/days

This endpoint retrieves an array wich contains all the dates we have in our database.

Example URI

GET https://api.ctoon.network/schedule/v2/days
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
    "2018-07-07",
    "2018-07-06",
    "2018-07-05",
    "2018-07-04",
    "2018-07-03",
    "2018-07-02",
    "2018-07-01",
    "2018-06-30",
    "2018-06-29",
    "2018-06-28",
    "2018-06-27",
    "2018-06-26",
    ...
]

Get a day

Get the data for a specific day
GET/schedule/v2/day/{day}

This endpoint retrieves the data for a specific day only, if available.

Details of a day element

  • date contains the selecte day in the YYYY-MM-DD format

  • lastupdate is a timestamp of the last time we checked

  • schedule which contains the different sources. If no data is available from one, its value is null

    • cn, zap, tvguide, as contains an array with the schedule
      • time with the EST time in 12 hours format (ie. 6:00 am)
      • date again
      • show is the name of the… show! Could be “MOVIE” or “SPECIAL” too
      • title the name of the episode/movie
      • colors based on the schedule archive project with foreground and background values
      • timestamp in seconds from UNIX Epoch, when this element starts
      • timestamp_end for when it ends
      • minutes for the duration of the element
      • slots [deprectated] how many 15-minutes “slots” it used
  • stats which contains the different sources. If no data is available from one, its value is null

    • cn, zap, tvguide, as contains an array with the stats of how many times a show aired
      • title for the name of the show
      • color for it’s main color (background)
      • minutes for its total duration
      • slots [deprectard] how many 15-minutes “slots” it used
      • percentage for a precalculated percentage of share for that day

Example URI

GET https://api.ctoon.network/schedule/v2/day/2018-06-01
URI Parameters
HideShow
day
string (required) Example: 2018-06-01

The date in YYYY-MM-DD format.

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    "schedule": {
        "cn": [
            {
                "time": "6:00 am",
                "date": "2018-06-01",
                "show": "Steven Universe",
                "title": "Garnet's Universe",
                "colors": {
                    "foreground": "#ffdc4f",
                    "background": "#f04937"
                },
                "timestamp": 1527847200,
                "timestamp_end": 1527848100,
                "minutes": 15,
                "slots": 1
            },
            {
                "time": "6:15 am",
                "date": "2018-06-01",
                "show": "Justice League Action",
                "title": "Keeping Up with the Kryptonians",
                "colors": {
                    "foreground": "#f8ed51",
                    "background": "#3a52a3"
                },
                "timestamp": 1527848100,
                "timestamp_end": 1527849000,
                "minutes": 15,
                "slots": 1
            },
            {
                "time": "6:30 am",
                "date": "2018-06-01",
                "show": "Teen Titans",
                "title": "Deception",
                "colors": {
                    "foreground": "#ffff00",
                    "background": "#000000"
                },
                "timestamp": 1527849000,
                "timestamp_end": 1527850800,
                "minutes": 30,
                "slots": 2
            },
            {
                "time": "7:00 am",
                "date": "2018-06-01",
                "show": "Ben 10",
                "title": "Mayhem in Mascot",
                "colors": {
                    "foreground": "#000000",
                    "background": "#95c93d"
                },
                "timestamp": 1527850800,
                "timestamp_end": 1527851700,
                "minutes": 15,
                "slots": 1
            },
            ...
        ],
        "zap": [
            ...
        ],
        "tvguide": [
            ...
        ],
        "as": null
    },
    "stats": {
        "cn": [
            {
                "title": "Teen Titans Go!",
                "color": "#ffff00",
                "minutes": 300,
                "slots": 20,
                "percentage": 35.7
            },
            {
                "title": "MOVIE",
                "color": "#bfbfbf",
                "minutes": 210,
                "slots": 14,
                "percentage": 25
            },
            {
                "title": "Amazing World of Gumball",
                "color": "#48c1e4",
                "minutes": 195,
                "slots": 13,
                "percentage": 23.2
            },
            ...
        ],
        "zap": [
            ...
        ],
        "tvguide": [
            ...
        ],
        "as": null
    },
    "date": "2018-06-01",
    "lastupdate": 1529658338
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "error": {
    "code": 404,
    "message": "There isn't any data available about that day."
  }
}

Get a range of days

Get the data for a range
GET/schedule/v2/range/{start}/{end}

This endpoint retrieves the data for a range of days, if available.

You could select from 2018-06-01 to 2028-01-01, the system will try to return you everything it can, even tho we don’t have data until the end date. But if there isn’t anything at all, a 404 is returned.

Example URI

GET https://api.ctoon.network/schedule/v2/range/2018-06-01/2018-06-08
URI Parameters
HideShow
start
string (required) Example: 2018-06-01

The start of the range, in YYYY-MM-DD format.

end
string (required) Example: 2018-06-08

The end of the range, in YYYY-MM-DD format.

Response  200
HideShow

For the content of each day in the array, refer to /schedule/v2/day/{day}.

Headers
Content-Type: application/json
Body
{
    "2018-06-01": {
        "schedule": {
            ...
        },
        "stats": {
            ...
        },
        "date": "2018-06-01",
        "lastupdate": 1529658338
    },
    "2018-06-02": {
        "schedule": {
            ...
        },
        "stats": {
            ...
        },
        "date": "2018-06-02",
        "lastupdate": 1529658338
    },
    "2018-06-03": {
        "schedule": {
            ...
        },
        "stats": {
            ...
        },
        "date": "2018-06-03",
        "lastupdate": 1529658338
    },
    "2018-06-04": {
        "schedule": {
            ...
        },
        "stats": {
            ...
        },
        "date": "2018-06-04",
        "lastupdate": 1529658338
    },
    "2018-06-05": {
        "schedule": {
            ...
        },
        "stats": {
            ...
        },
        "date": "2018-06-05",
        "lastupdate": 1529658338
    },
    "2018-06-06": {
        "schedule": {
            ...
        },
        "stats": {
            ...
        },
        "date": "2018-06-06",
        "lastupdate": 1529658338
    },
    "2018-06-07": {
        "schedule": {
            ...
        },
        "stats": {
            ...
        },
        "date": "2018-06-07",
        "lastupdate": 1529658338
    },
    "2018-06-08": {
        "schedule": {
            ...
        },
        "stats": {
            ...
        },
        "date": "2018-06-08",
        "lastupdate": 1529658338
    }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "error": {
    "code": 404,
    "message": "There isn't any data available in that range."
  }
}

Get the most recent entries

Get schedule data for today and onwards
GET/schedule/v2/current

This is a shorthand to load a range from today to the maxium of data we have for the future. Example: using this endpoint on June 20th will have the same results as /schedule/v2/range/2018-06-20/2099-12-31.

Example URI

GET https://api.ctoon.network/schedule/v2/current
Response  200
HideShow

Please refer to /schedule/v2/range/{start}/{end} and /schedule/v2/day/{day}.

Body
{...}

Generated by aglio on 24 Jun 2018