Episode
Access TV episode data from the Comic Vine API. Official API docs: /episode | /episodes
const episode = client.episode;Methods
Section titled “Methods”retrieve(id, options?)
Section titled “retrieve(id, options?)”Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id | number | Yes | The unique ID of the episode |
options.fieldList | string[] | No | Only return the specified fields |
Returns: Promise<EpisodeDetails>
const episode = await client.episode.retrieve(12345);
// With field selectionconst episode = await client.episode.retrieve(12345, { fieldList: ['id', 'name', 'episodeNumber', 'airDate'],});interface EpisodeDetails { /** The air date of the episode. */ airDate: Date | null; /** List of aliases the episode is known by. A \n (newline) seperates each alias. */ aliases: null | string; /** URL pointing to the episode detail resource. */ apiDetailUrl: string; characterCredits: Array<SiteResource>; characterDiedIn: Array<unknown>; conceptCredits: Array<SiteResource>; /** Date the episode was added to Comic Vine. */ dateAdded: Date; /** Date the episode was last updated on Comic Vine. */ dateLastUpdated: Date; /** Brief summary of the episode. */ deck: null | string; /** Description of the episode. */ description: null | string; /** The number assigned to the episode within a series. */ episodeNumber: string; /** A list of characters in which this episode is the first appearance of the character. */ firstAppearanceCharacters: null | unknown; /** A list of concepts in which this episode is the first appearance of the concept. */ firstAppearanceConcepts: null | unknown; /** A list of locations in which this episode is the first appearance of the location. */ firstAppearanceLocations: null | unknown; /** A list of things in which this episode is the first appearance of the object. */ firstAppearanceObjects: null | unknown; /** A list of storyarcs in which this episode is the first appearance of the story arc. */ firstAppearanceStoryarcs: null | unknown; /** A list of teams in which this episode is the first appearance of the team. */ firstAppearanceTeams: null | unknown; hasStaffReview: null | false | SiteResource; /** Unique ID of the episode. */ id: number; /** Main image of the episode. */ image: Image; locationCredits: Array<SiteResource>; /** Name of the episode. */ name: string; objectCredits: Array<SiteResource>; /** The series the episode belongs to. */ series: SiteResource; /** URL pointing to the episode on Giant Bomb. */ siteDetailUrl: string; storyArcCredits: Array<SiteResource>; teamCredits: Array<SiteResource>;}list(options?)
Section titled “list(options?)”Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options.fieldList | string[] | No | Only return the specified fields |
options.limit | number | No | Number of results to return (default: 100) |
options.offset | number | No | Number of results to skip |
options.sort | SortOption | No | Sort field and direction |
options.filter | object | No | Filter results by field values |
Returns: Promise<PageData> & AsyncIterable<EpisodeListItem>
const episodes = await client.episode.list();
// With auto paginationfor await (const episode of client.episode.list()) { console.log(episode.name);}interface EpisodeListItem { /** The air date of the episode. */ airDate: Date | null; /** List of aliases the episode is known by. A \n (newline) seperates each alias. */ aliases: null | string; /** URL pointing to the episode detail resource. */ apiDetailUrl: string; /** Date the episode was added to Comic Vine. */ dateAdded: Date; /** Date the episode was last updated on Comic Vine. */ dateLastUpdated: Date; /** Brief summary of the episode. */ deck: null | string; /** Description of the episode. */ description: null | string; episodeNumber: string; hasStaffReview: null | false | SiteResource; /** Unique ID of the episode. */ id: number; /** Main image of the episode. */ image: Image; /** Name of the episode. */ name: string; /** The series the episode belongs to. */ series: SiteResource; /** URL pointing to the episode on Giant Bomb. */ siteDetailUrl: string;}