Power
Access super power and ability data from the Comic Vine API. Official API docs: /power | /powers
const power = client.power;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 power |
options.fieldList | string[] | No | Only return the specified fields |
Returns: Promise<PowerDetails>
const power = await client.power.retrieve(12345);
// With field selectionconst power = await client.power.retrieve(12345, { fieldList: ['id', 'name'],});interface PowerDetails { /** List of aliases the power is known by. A \n (newline) seperates each alias. */ aliases: null | string; /** URL pointing to the power detail resource. */ apiDetailUrl: string; /** Characters related to the power. */ characters: Array<SiteResource>; /** Date the power was added to Comic Vine. */ dateAdded: Date; /** Date the power was last updated on Comic Vine. */ dateLastUpdated: Date; /** Description of the power. */ description: null | string; /** Unique ID of the power. */ id: number; /** Name of the power. */ name: string; /** URL pointing to the power on Giant Bomb. */ siteDetailUrl: 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<PowerListItem>
const powers = await client.power.list();
// With auto paginationfor await (const power of client.power.list()) { console.log(power.name);}interface PowerListItem { /** List of aliases the power is known by. A \n (newline) seperates each alias. */ aliases: null | string; /** URL pointing to the power detail resource. */ apiDetailUrl: string; /** Date the power was added to Comic Vine. */ dateAdded: Date; /** Date the power was last updated on Comic Vine. */ dateLastUpdated: Date; /** Description of the power. */ description: null | string; /** Unique ID of the power. */ id: number; /** Name of the power. */ name: string; /** URL pointing to the power on Giant Bomb. */ siteDetailUrl: string;}