Thing
Access notable object data from the Comic Vine API. Official API docs: /object | /objects
const thing = client.thing;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 thing |
options.fieldList | string[] | No | Only return the specified fields |
Returns: Promise<ThingDetails>
const thing = await client.thing.retrieve(12345);
// With field selectionconst thing = await client.thing.retrieve(12345, { fieldList: ['id', 'name', 'deck', 'startYear'],});interface ThingDetails { /** List of aliases the thing is known by. A \n (newline) seperates each alias. */ aliases: null | string; /** URL pointing to the thing detail resource. */ apiDetailUrl: string; /** Number of issues this thing appears in. */ countOfIssueAppearances: number; /** Date the thing was added to Comic Vine. */ dateAdded: Date; /** Date the thing was last updated on Comic Vine. */ dateLastUpdated: Date; /** Brief summary of the thing. */ deck: string; /** Description of the thing. */ description: null | string; /** Issue where the thing made its first appearance. */ firstAppearedInIssue: IssueApiResource | null; /** Unique ID of the thing. */ id: number; /** Main image of the thing. */ image: Image; issueCredits: Array<SiteResource>; /** Movies the thing was in. */ movies: Array<SiteResource>; /** Name of the thing. */ name: string; /** URL pointing to the thing on Giant Bomb. */ siteDetailUrl: string; /** The first year this thing appeared in comics. */ startYear: null | string; storyArcCredits: Array<SiteResource>; volumeCredits: 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<ThingListItem>
const things = await client.thing.list();
// With auto paginationfor await (const thing of client.thing.list()) { console.log(thing.name);}interface ThingListItem { /** List of aliases the thing is known by. A \n (newline) seperates each alias. */ aliases: null | string; /** URL pointing to the thing detail resource. */ apiDetailUrl: string; /** Number of issues this thing appears in. */ countOfIssueAppearances: number; /** Date the thing was added to Comic Vine. */ dateAdded: Date; /** Date the thing was last updated on Comic Vine. */ dateLastUpdated: Date; /** Brief summary of the thing. */ deck: null | string; /** Description of the thing. */ description: null | string; /** Issue where the thing made its first appearance. */ firstAppearedInIssue: IssueApiResource | null; /** Unique ID of the thing. */ id: number; /** Main image of the thing. */ image: Image; /** Name of the thing. */ name: string; /** URL pointing to the thing on Giant Bomb. */ siteDetailUrl: string; /** The first year this thing appeared in comics. */ startYear: null | string;}