Promo
Access promotional content data from the Comic Vine API. Official API docs: /promo | /promos
const promo = client.promo;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 promo |
options.fieldList | string[] | No | Only return the specified fields |
Returns: Promise<PromoDetails>
const promo = await client.promo.retrieve(12345);
// With field selectionconst promo = await client.promo.retrieve(12345, { fieldList: ['id', 'name', 'deck'],});interface PromoDetails { /** URL pointing to the promo detail resource. */ apiDetailUrl: string; /** Date the promo was added to Comic Vine. */ dateAdded: Date; /** Brief summary of the promo. */ deck: string; guid: string; /** Unique ID of the promo. */ id: number; /** Main image of the promo. */ image: Image; /** The link that promo points to. */ link: string; /** Name of the promo. */ name: string; /** The type of resource the promo is pointing towards. */ resourceType: string; /** Author of the promo. */ user: string;}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<PromoListItem>
const promos = await client.promo.list();
// With auto paginationfor await (const promo of client.promo.list()) { console.log(promo.name);}interface PromoListItem { /** URL pointing to the promo detail resource. */ apiDetailUrl: string; /** Date the promo was added to Comic Vine. */ dateAdded: Date; /** Brief summary of the promo. */ deck: string; guid: string; /** Unique ID of the promo. */ id: number; /** Main image of the promo. */ image: Image; /** The link that promo points to. */ link: string; /** Name of the promo. */ name: string; /** The type of resource the promo is pointing towards. */ resourceType: string; /** Author of the promo. */ user: string;}