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