Entity

GET /entity/<lookup-id>

Retrieves a lookup entity. This endpoint is meant only for human consumption and must not be used by any service.

  • Requests SHOW
  • > Client: <client>
  • Response 200 SHOW
  • {
      "id": "0194fdc2fa2ffcc041d3",
      "type": "episode",
      "modified": "2021-02-11T11:11:11Z",
      "data": { ... },
      "external_ids": [ ... ]
    }
    
    

Event

POST /event/<source>

Handles an event from an external source. Possible sources are comet6-program, comet6-package, comet6-schedule, vimond-asset.

There are currently no events for comet6-channel. Raw data for this source is to be updated manually through posting to /raw/comet6-channel/<id>.

There are also no events for comet6-broadcast. Broadcast data is extracted from schedule data (comet6-schedule).

  • Requests SHOW
  • > Authorization: Basic <credentials>
  • Response 200 SHOW

Raw

The /raw/ endpoint is meant for manually fetching and updating data in the formats provided by our data sources. It is not intended for use by other services.

GET /raw/<source>/<id>

Returns the raw data for the given source and ID.

  • Requests SHOW
  • > Authorization: Basic <credentials>
    > Client: <client>
  • Response 200 SHOW
POST /raw/<source>/<id>

Stores the request body as-is as the raw data for the given source and ID.

  • Requests SHOW
  • > Client: <client>
    > X-Api-Key: <key>
  • Response 200 SHOW

Status

GET /__status

Provides service status information.

  • Requests SHOW
  • Response 200 SHOW
  • {
      "date": "2020-06-23T11:14:05.529788Z",
      "framework": {
        "name": "stdlib",
        "version": "go1.14.4"
      },
      "go": {
        "goarch": "amd64",
        "goos": "darwin",
        "num_cpu": 8,
        "num_goroutines": 3,
        "version": "go1.14.4"
      },
      "language": {
        "name": "go",
        "version": "go1.14.4"
      },
      "service": {
        "birthday": "2020-06-23"
      }
    }
    
    

Tasks

Tasks provides a means to monitor and control background work.

GET /tasks

Fetches information about all tasks.

  • Requests SHOW
  • > Client: <client>
    > X-Api-Key: <key>
  • Response 200 SHOW
  • [
      {
        "created": "2020-12-14T15:37:50.86033Z",
        "description": "Send entities",
        "id": "db70c2",
        "modified": "2020-12-14T15:37:50.872928Z",
        "state": "completed"
      },
      {
        "created": "2020-12-14T15:37:46.908205Z",
        "description": "Send entities",
        "id": "d88bb5",
        "modified": "2020-12-14T15:37:46.924263Z",
        "state": "completed"
      }
    ]
    
    
GET /tasks/<id>

Fetches information about the given task.

  • Requests SHOW
  • > Client: <client>
    > X-Api-Key: <key>
  • Response 200 SHOW
  • {
      "created": "2020-12-14T15:37:50.86033Z",
      "description": "Send entities",
      "id": "db70c2",
      "modified": "2020-12-14T15:37:50.872928Z",
      "state": "completed"
    }
    
    
DELETE /tasks/<id>

Aborts the given task.

  • Requests SHOW
  • > Client: <client>
    > X-Api-Key: <key>
  • Response 202 SHOW

Internal

POST /internal/migrate-db/<query-index>

Runs the SQL migration query corresponding to the given index.

  • Requests SHOW
  • > Client: <client>
    > X-Api-Key: <key>
  • Response 200 SHOW
GET /internal/mapping/<source>/<id>

Returns the lookup ID corresponding to the given external ID for the given source. This endpoint is meant only for human consumption and must not be used by any service.

  • Requests SHOW
  • > Authorization: Basic <credentials>
    > Client: <client>
  • Response 200 SHOW
GET /internal/mappings/<source>/<id>

Returns the lookup IDs and entity types corresponding to the given external ID for the given source. This endpoint is meant only for human consumption and must not be used by any service.

  • Requests SHOW
  • > Authorization: Basic <credentials>
    > Client: <client>
  • Response 200 SHOW
  • {vimond-asset 2222333} -> {2473fb4e0cea4ea2df31 video}
    
    
POST /internal/send-entities{?everything,since,source}

Triggers entities to be sent on the SNS and returns a task ID that can be used to abort the send if needed.

If the request body is empty, the request must have exactly one of the three parameters specified.

The request body may contain a newline-delimited list of lookup IDs of the entities to send.

  • Parameters
  • Name Description Required Type Example
    everything

    Set to true to send all entities.

    bool true
    since

    Include only those entities whose underlying raw data has been modified in the specified period of time.

    duration 24h
    source

    Include only those entities which have underlying raw data from the specified source.

    string comet6-program
  • Requests SHOW
  • > Client: <client>
    > X-Api-Key: <key>
  • Requests SHOW
  • > Client: <client>
    > X-Api-Key: <key>
    0194fdc2fa2ffcc041d3
    ff12045b73c86e4ff95f
    
  • Response 202 SHOW
  • {
      "task_id": "abc123",
    }
    
    
GET /internal/stats

Returns internal statistics. This endpoint is meant only for human consumption and must not be used by any service.

  • Requests SHOW
  • > Authorization: Basic <credentials>
    > Client: <client>
  • Response 200 SHOW

Data Format

Entity

All data in Lookup v2 is represented as entities. An entity is a JSON object with a unique ID, a type, modification timestamp, data, and external IDs. The data is defined by the type of the entity, and is always a JSON object. Any field under data may be omitted. Any ID referenced from an entity is a Lookup ID unless otherwise specified.

{
  "id": "0194fdc2fa2ffcc041d3",
  "type": "episode",
  "modified": "2021-02-11T11:11:11Z",
  "data": { ... },
  "external_ids": [ ... ]
}

Possible entity types are episode, season, series, movie, video (video file, i.e. Vimond asset, Comet VOD package), clipvideo, sportvideo, channel, schedule, broadcast.

The external_ids is a list of corresponding IDs from external sources. Possible sources are comet5-program, comet6-program, comet6-package, comet6-channel, comet6-schedule, comet6-broadcast, vimond-asset.

All timestamps are formatted according to RFC 3339.

Field info

Common

  • duration – duration of the video in seconds

  • localizations – data in different languages

    • language – one of da, fi, lt, nb, sv
  • original_title – title of the program in the original language

  • playback – playback (streaming) information

    • protocol – one of cldash, clhls
  • production_countries – list of ISO 3166-1 alpha-2 country codes

  • publishing – publishing information

    • site – one of cmore.se, cmore.no, cmore.dk, cmore.fi, tv4play.se
    • published – indicates whether or not the entity is to be considered published on the given site
    • publish_at – time at which the entity was or is expected to be published
    • expire_at – time at which the entity expired or is expected to expire
    • playable_at – time after which the corresponding video can be played
  • rating (deprecated, use content_rating[].age_rating instead) – parental rating following the TV4 Media rating color system (green, turqouise, blue, orange, red, purple)

    • green (any age)
    • turqouise (7+)
    • blue (11+)
    • orange (15+)
    • red (18+)
    • purple (18+ explicit)
  • content_rating – content rating for different rating systems (cmore)

    • System cmore
      • age_rating – parental rating following the C More color rating system (green, turqouise, blue, orange, red, purple)
        • green (any age)
        • turqouise (7+)
        • blue (11+)
        • orange (15+)
        • red (18+)
        • purple (18+ explicit)
  • resources – list of images and trailers

    • kind – one of backdroptall, character, cover, main, main-annotated, trailer, logo-main, logo-teams, logo-home, logo-away
    • region – one of DK, FI, LT, NO, SE
    • type – one of image, trailer

Movie

  • category – one of entertainment, movie

Season

  • rights
    • content_owner – one of cmore, tv4
    • country – one of DK, FI, NO, SE

Series

  • category – one of entertainment, factual, news, scripted

Video

  • audio

    • language – one of da, fi, nb, sv
    • kind – always dubbed
  • louise_id – id for video in planning/contract system louise

  • parent_id – link from video to a corresponding episode or movie

Broadcast

  • type – one of live, recorded

  • status – one of rerun, first-run

  • planned – exact start and end of the broadcast

  • public – start and end of the broadcast rounded to the nearest 5 minute period, meant for public presentations

  • rights

    • type – one of start-over, catch-up, blackout
    • device_types – one or more of ott, stb

Example data

The example data below contains all possible fields for each entity type.

Episode entity

{
  "id": "0194fdc2fa2ffcc041d3",
  "type": "episode",
  "modified": "2021-02-11T11:11:11Z",
  "data": {
    "content_rating": [
      {
        "system": "cmore",
        "age_rating": "blue"
      }
    ],
    "credits": [
      {
        "character": "Alex",
        "name": "Felix Herngren",
        "type": "actor"
      }
    ],
    "episode_number": 9,
    "localizations": [
      {
        "language": "sv",
        "synopsis": {
          "brief": "Brief synopsis [...]",
          "extended": "Extended synopsis [...]",
          "long": "Long synopsis [...]",
          "medium": "Medium synopsis [...]",
          "short": "Short synopsis [...]"
        },
        "title": "Episode title [...]"
      }
    ],
    "original_title": "Solsidan",
    "rating": "blue",
    "resources": [
      {
        "kind": "main",
        "media_type": "image/jpeg",
        "ratio": "16:9",
        "region": "SE",
        "type": "image",
        "url": "https://img.cmore.incomet.io/524acf16-caec-4fef-9f50-9d27c5f6dde1/crop16x9.jpg"
      }
    ],
    "season_id": "ff12045b73c86e4ff95f"
  },
  "external_ids": [
    {
      "source": "comet6-program",
      "id": "123456"
    }
  ]
}

Season entity

{
  "id": "ff12045b73c86e4ff95f",
  "type": "season",
  "modified": "2021-02-11T11:11:11Z",
  "data": {
    "content_rating": [
      {
        "system": "cmore",
        "age_rating": "blue"
      }
    ],
    "credits": [
      {
        "character": "Alex",
        "name": "Felix Herngren",
        "type": "actor"
      }
    ],
    "genres": [
      "komedi"
    ],
    "localizations": [
      {
        "language": "sv",
        "synopsis": {
          "brief": "Brief synopsis [...]",
          "extended": "Extended synopsis [...]",
          "long": "Long synopsis [...]",
          "medium": "Medium synopsis [...]",
          "short": "Short synopsis [...]"
        },
        "title": "Säsong 3"
      }
    ],
    "number_of_episodes": 10,
    "original_title": "Solsidan",
    "production_year": "2012",
    "rating": "blue",
    "resources": [
      {
        "kind": "cover",
        "media_type": "image/png",
        "ratio": "2:3",
        "region": "NO",
        "type": "image",
        "url": "https://img.cmore.incomet.io/fec967f6-3819-4d03-a971-8077d3b67d3d/crop2x3.png"
      }
    ],
    "rights": [
      {
        "content_owner": "cmore",
        "country": "SE"
      },
      {
        "content_owner": "tv4",
        "country": "SE"
      }
    ],
    "season_number": 3,
    "series_id": "f662a5eee82abdf44a2d"
  },
  "external_ids": [
    {
      "source": "comet6-program",
      "id": "234567"
    }
  ]
}

Series entity

{
  "id": "f662a5eee82abdf44a2d",
  "type": "series",
  "modified": "2021-02-11T11:11:11Z",
  "data": {
    "category": "scripted",
    "content_rating": [
      {
        "system": "cmore",
        "age_rating": "blue"
      }
    ],
    "credits": [
      {
        "character": "Alex",
        "name": "Felix Herngren",
        "type": "actor"
      }
    ],
    "genres": [
      "komedi"
    ],
    "imdb": "tt1593584",
    "localizations": [
      {
        "language": "sv",
        "synopsis": {
          "brief": "Brief synopsis [...]",
          "extended": "Extended synopsis [...]",
          "long": "Long synopsis [...]",
          "medium": "Medium synopsis [...]",
          "short": "Short synopsis [...]"
        },
        "title": "Solsidan"
      }
    ],
    "original_title": "Solsidan",
    "production_countries": [
      "SE"
    ],
    "rating": "blue",
    "resources": [
      {
        "kind": "trailer",
        "media_type": "video/mp4",
        "ratio": "16:9",
        "region": "SE",
        "type": "trailer",
        "url": "https://trailer-cdn.b17g.net/comet/d2790630-5bae-4da3-8b27-a82621305321.mp4"
      }
    ],
    "tags": [
      {
        "name": "TV-Serier",
        "type": "Ad"
      }
    ]
  },
  "external_ids": [
    {
      "source": "comet5-program",
      "id": "34567"
    },
    {
      "source": "comet6-program",
      "id": "345678"
    }
  ]
}

Movie entity

{
  "id": "0b75fb180daf48a79ee0",
  "type": "movie",
  "modified": "2021-02-11T11:11:11Z",
  "data": {
    "category": "movie",
    "content_rating": [
      {
        "system": "cmore",
        "age_rating": "green"
      }
    ],
    "credits": [
      {
        "character": "Alex",
        "name": "Felix Herngren",
        "type": "actor"
      }
    ],
    "genres": [
      "komedi"
    ],
    "imdb": "tt7279180",
    "localizations": [
      {
        "language": "sv",
        "synopsis": {
          "brief": "Brief synopsis [...]",
          "extended": "Extended synopsis [...]",
          "long": "Long synopsis [...]",
          "medium": "Medium synopsis [...]",
          "short": "Short synopsis [...]"
        },
        "title": "Solsidan - Filmen"
      }
    ],
    "original_title": "Solsidan",
    "production_countries": [
      "SE"
    ],
    "production_year": "2017",
    "rating": "green",
    "resources": [
      {
        "kind": "cover",
        "media_type": "image/png",
        "ratio": "2:3",
        "region": "SE",
        "type": "image",
        "url": "https://img.cmore.incomet.io/dab79aa5-db89-47e5-a9c8-2fb7c2537538/crop2x3.png"
      }
    ],
    "tags": [
      {
        "name": "Small town life",
        "type": "Keyword"
      }
    ]
  },
  "external_ids": [
    {
      "source": "comet6-program",
      "id": "456789"
    }
  ]
}

Video entity

{
  "id": "b10d394651850fd4a178",
  "type": "video",
  "modified": "2021-02-11T11:11:11Z",
  "data": {
    "audio": [
      {
        "language": "da",
        "kind": "dubbed"
      },
      {
        "language": "fi",
        "kind": "dubbed"
      },
      {
        "language": "nb",
        "kind": "dubbed"
      },
      {
        "language": "sv",
        "kind": "dubbed"
      }
    ],
    "drm_protected": true,
    "duration": 456,
    "encoder_group_id": "123",
    "live": true,
    "louise_id": "123456789",
    "mezzanine_id": "d9717708-e346-4bfa-8313-c4249edeb3a0",
    "parent_id": "0b75fb180daf48a79ee0",
    "playback": [
      {
        "protocol": "cldash",
        "url": "https://lbs-usp-dash-vod.cmore.se/vod/60e91/t0pgrrkppec(1234567_ISMUSP).ism/t0pgrrkppec(1234567_ISMUSP).mpd"
      },
      {
        "protocol": "clhls",
        "url": "https://lbs-usp-hls-vod.cmore.se/vod/60e91/t0pgrrkppec(1234567_ISMUSP).ism/t0pgrrkppec(1234567_ISMUSP).m3u8"
      }
    ],
    "publishing": [
      {
        "site": "cmore.se",
        "published": false,
        "publish_at": "2020-01-01T10:00:00Z",
        "expire_at": "2021-01-01T10:00:00Z",
        "playable_at": "2020-06-01T10:00:00Z",
        "offline": {
          "download_allowed": true
        },
        "ads_allowed": true
      },
      {
        "site": "tv4play.se",
        "published": true,
        "publish_at": "2021-01-01T10:00:00Z",
        "expire_at": "2023-01-01T10:00:00Z",
        "playable_at": "2022-06-01T10:00:00Z",
        "offline": {
          "download_allowed": false
        },
        "ads_allowed": true
      }
    ],
    "vimond_product_group_ids": [
      {
        "site": "tv4play.se",
        "ids": [
          "123",
          "345",
          "234"
        ]
      },
      {
        "site": "cmore.se",
        "ids": [
          "1234",
          "3456",
          "2345"
        ]
      }
    ]
  },
  "external_ids": [
    {
      "source": "comet6-package",
      "id": "123456"
    },
    {
      "source": "vimond-asset",
      "id": "1234567"
    }
  ]
}

Clipvideo entity

{
  "id": "f83b8e883bbf857aab99",
  "type": "clipvideo",
  "modified": "2021-02-11T11:11:11Z",
  "data": {
    "drm_protected": false,
    "duration": 123,
    "localizations": [
      {
        "language": "sv",
        "synopsis": {
          "brief": "Brief description [...]"
        },
        "title": "Riksdagen röstar om pandemilagen"
      }
    ],
    "playback": [
      {
        "protocol": "cldash",
        "url": "https://lbs-usp-dash-vod.cmore.se/vod/f12a1/xipogoh2gyx(3456789_ISMUSP).ism/xipogoh2gyx(3456789_ISMUSP).mpd"
      },
      {
        "protocol": "clhls",
        "url": "https://lbs-usp-hls-vod.cmore.se/vod/f12a1/xipogoh2gyx(3456789_ISMUSP).ism/xipogoh2gyx(3456789_ISMUSP).m3u8"
      }
    ],
    "publishing": [
      {
        "site": "tv4play.se",
        "published": false,
        "publish_at": "2020-01-01T10:00:00Z",
        "expire_at": "2021-01-01T10:00:00Z",
        "playable_at": "2020-06-01T10:00:00Z",
        "ads_allowed": false
      }
    ],
    "resources": [
      {
        "kind": "main",
        "media_type": "image/jpeg",
        "ratio": "16:9",
        "type": "image",
        "url": "https://asset-images.b17g.net/api/v2/img/5ff80e68e4b0a3969e9a4d09-1610092137552"
      }
    ],
    "tags": [
      {
        "name": "sporthighlights",
        "type": "clip-category"
      }
    ],
    "vimond_product_group_ids": [
      {
        "site": "tv4play.se",
        "ids": [
          "123",
          "345",
          "234"
        ]
      },
      {
        "site": "cmore.se",
        "ids": [
          "1234",
          "3456",
          "2345"
        ]
      }
    ]
  },
  "external_ids": [
    {
      "source": "vimond-asset",
      "id": "3456789"
    }
  ]
}

Sportvideo entity

{
  "id": "892ee285ece151145578",
  "type": "sportvideo",
  "modified": "2021-02-11T11:11:11Z",
  "data": {
    "arena": "Skytteholms IP",
    "commentators": "Patrik Westberg, Jennie Linnéll",
    "drm_protected": true,
    "duration": 789,
    "encoder_group_id": "123",
    "in_studio": "Jennie Linnéll, Patrik Westberg",
    "live": true,
    "localizations": [
      {
        "language": "sv",
        "away_team_name": "Djurgårdens IF",
        "genre": "Fotboll",
        "home_team_name": "AIK",
        "league": "Damallsvenskan",
        "synopsis": {
          "brief": "Brief description [...]"
        },
        "title": "AIK - Djurgårdens IF"
      }
    ],
    "original_title": "AIK - Djurgårdens IF",
    "playback": [
      {
        "protocol": "cldash",
        "url": "https://lbs-usp-dash-vod.cmore.se/vod/f12a1/xipogoh2gyx(2345678_ISMUSP).ism/xipogoh2gyx(2345678_ISMUSP).mpd"
      },
      {
        "protocol": "clhls",
        "url": "https://lbs-usp-hls-vod.cmore.se/vod/f12a1/xipogoh2gyx(2345678_ISMUSP).ism/xipogoh2gyx(2345678_ISMUSP).m3u8"
      }
    ],
    "production_year": "2020",
    "publishing": [
      {
        "site": "cmore.se",
        "published": false,
        "publish_at": "2020-01-01T10:00:00Z",
        "expire_at": "2021-01-01T10:00:00Z",
        "playable_at": "2020-06-01T10:00:00Z",
        "live_event_end": "2021-01-01T10:13:09Z",
        "ads_allowed": false
      }
    ],
    "resources": [
      {
        "kind": "main",
        "media_type": "image/jpeg",
        "ratio": "16:9",
        "type": "image",
        "url": "https://img.cmore.incomet.io/0351b5d0-c70b-41fb-9a1a-3a24f9fccaa4/crop16x9.jpg"
      },
      {
        "kind": "main",
        "media_type": "image/jpeg",
        "ratio": "2:3",
        "type": "image",
        "url": "https://img.cmore.incomet.io/0351b5d0-c70b-41fb-9a1a-3a24f9fccaa4/crop2x3.jpg"
      },
      {
        "kind": "backdroptall",
        "media_type": "image/jpeg",
        "ratio": "2:3",
        "type": "image",
        "url": "https://img.cmore.incomet.io/0351b5d0-c70b-41fb-9a1a-3a24f9fccaa4/crop2x3.jpg"
      },
      {
        "kind": "logo-teams",
        "media_type": "image/png",
        "type": "image",
        "url": "https://img.cmore.incomet.io/71b634ae-ccc4-4d03-ad10-c6c37128d10f/7cac344f-f7d5-4e0d-a870-e51f59d35a7f/teamlogos2x1.png"
      },
      {
        "kind": "logo-home",
        "media_type": "image/png",
        "type": "image",
        "url": "https://img.cmore.incomet.io/71b634ae-ccc4-4d03-ad10-c6c37128d10f/original.png"
      },
      {
        "kind": "logo-away",
        "media_type": "image/png",
        "type": "image",
        "url": "https://img.cmore.incomet.io/7cac344f-f7d5-4e0d-a870-e51f59d35a7f/original.png"
      },
      {
        "kind": "trailer",
        "media_type": "video/mp4",
        "type": "trailer",
        "url": "https://trailer-cdn.b17g.net/comet/09480dec-472f-4fc9-a1bd-c7557a068480.mp4"
      }
    ],
    "start_over": true,
    "vimond_product_group_ids": [
      {
        "site": "tv4play.se",
        "ids": [
          "123",
          "345",
          "234"
        ]
      },
      {
        "site": "cmore.se",
        "ids": [
          "1234",
          "3456",
          "2345"
        ]
      }
    ]
  },
  "external_ids": [
    {
      "source": "vimond-asset",
      "id": "2345678"
    }
  ]
}

Channel entity

{
  "id": "0875d64ee2d3d0d0de6b",
  "type": "channel",
  "modified": "2021-02-11T11:11:11Z",
  "data": {
    "display_name": "TV4"
  },
  "external_ids": [
    {
      "source": "comet6-channel",
      "id": "4567890"
    }
  ]
}

Schedule entity

{
  "id": "f8f9b44ce85ff044c6b1",
  "type": "schedule",
  "modified": "2021-02-11T11:11:11Z",
  "data": {
    "channel_id": "0875d64ee2d3d0d0de6b",
    "day": "2020-11-04",
    "broadcast_ids": [
      "c5b252c7429c32f3a8ae",
      "b79ef856f659c18f0dce"
    ]
  },
  "external_ids": [
    {
      "source": "comet6-schedule",
      "id": "3456789"
    }
  ]
}

Broadcast entity

{
  "id": "c5b252c7429c32f3a8ae",
  "type": "broadcast",
  "modified": "2021-02-11T11:11:11Z",
  "data": {
    "continuation_from": "dae51d5d4754fcf5ad6e",
    "metadata_id": "0194fdc2fa2ffcc041d3",
    "metadata": {
      "season_number": 3,
      "episode_number": 9,
      "title": "Solsidan",
      "synopsis": {
        "brief": "Brief synopsis [...]",
        "extended": "Extended synopsis [...]",
        "long": "Long synopsis [...]",
        "medium": "Medium synopsis [...]",
        "short": "Short synopsis [...]"
      },
      "resources": [
        {
          "kind": "main",
          "media_type": "image/jpeg",
          "ratio": "16:9",
          "region": "SE",
          "type": "image",
          "url": "https://img.cmore.incomet.io/524acf16-caec-4fef-9f50-9d27c5f6dde1/crop16x9.jpg"
        }
      ]
    },
    "type": "recorded",
    "status": "rerun",
    "planned": {
      "start": "2020-01-01T19:00:00+01:00",
      "end": "2020-01-01T19:28:00+01:00"
    },
    "public": {
      "start": "2020-01-01T19:00:00+01:00",
      "end": "2020-01-01T19:30:00+01:00"
    },
    "rights": [
      {
        "type": "start-over",
        "from": "2020-01-01T19:00:00+01:00",
        "until": "2020-01-01T21:00:00+01:00",
        "device_types": [
          "ott",
          "stb"
        ],
        "fast_forward": false,
        "pause": true,
        "rewind": true
      }
    ]
  },
  "external_ids": [
    {
      "source": "comet6-broadcast",
      "id": "456789"
    }
  ]
}