Origin
Access character origin type data from the Comic Vine API (Human, Alien, Robot, etc.). Official API docs: /origin | /origins
const origin = client.origin;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 origin |
options.fieldList | string[] | No | Only return the specified fields |
Returns: Promise<OriginDetails>
const origin = await client.origin.retrieve(1);
// With field selectionconst origin = await client.origin.retrieve(1, { fieldList: ['id', 'name'],});interface OriginDetails { /** URL pointing to the origin detail resource. */ apiDetailUrl: string; characters: Array<ApiResource>; characterSet: null; /** Unique ID of the origin. */ id: number; /** Name of the origin. */ name: string; profiles: Array<unknown>; /** URL pointing to the origin 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<OriginListItem>
const origins = await client.origin.list();
// With auto paginationfor await (const origin of client.origin.list()) { console.log(origin.name);}interface OriginListItem { /** URL pointing to the origin detail resource. */ apiDetailUrl: string; /** Unique ID of the origin. */ id: number; /** Name of the origin. */ name: string; /** URL pointing to the origin on Giant Bomb. */ siteDetailUrl: string;}