### Install Nintendo Switch eShop Wrapper Source: https://favna.github.io/nintendo-switch-eshop Install the library using your preferred package manager. ```bash npm install nintendo-switch-eshop ``` ```bash yarn add nintendo-switch-eshop ``` ```bash pnpm add nintendo-switch-eshop ``` ```bash bun add nintendo-switch-eshop ``` -------------------------------- ### Example Player Count Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/queriedgameus This example shows a string literal for the number of players. ```typescript 'Single Player' ``` -------------------------------- ### Example Platform Code Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/queriedgameus This example shows a string literal representing a platform code. ```typescript 'NINTENDO_SWITCH' ``` -------------------------------- ### Install nintendo-switch-eshop with npm Source: https://favna.github.io/nintendo-switch-eshop/api/readme Install the package using npm. This is the first step to using the API wrapper. ```bash npm install nintendo-switch-eshop ``` -------------------------------- ### Example Play Modes Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/queriedgameus This example demonstrates an array of strings representing different play modes for a game. ```typescript ['TV mode', 'Tabletop mode', 'Handheld mode'] ``` -------------------------------- ### Example type Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/queriedgameus Specifies the type of search result, commonly 'game' for game entries. ```typescript 'game' ``` -------------------------------- ### Example topLevelCategory Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/queriedgameus Represents the top-level category of a game, such as 'Games'. ```typescript 'Games' ``` -------------------------------- ### Example topLevelCategoryCode Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/queriedgameus Represents the top-level category code for a game, typically in uppercase, like 'GAMES'. ```typescript 'GAMES' ``` -------------------------------- ### getQueriedGamesBrazil Source: https://favna.github.io/nintendo-switch-eshop/api/functions/getqueriedgamesbrazil Fetches a subset of games from the Brazilian e-shop based on a given query. It allows for custom options to refine the search results. ```APIDOC ## getQueriedGamesBrazil ### Description Fetches a subset of games from the Brazilian e-shop as based on a given query. ### Method Signature `getQueriedGamesBrazil(query: string, options?: QueriedGamesAmericaOptions): Promise` ### Parameters #### query - **query** (string) - Required - The query to search for. #### options - **options** (QueriedGamesAmericaOptions) - Optional - Additional options for the getQueriedGamesBrazil call. Defaults to `{ hitsPerPage: 200, page: 0 }`. ### Returns - **Promise** - Promise containing the first `hitsPerPage` games that match your query. ``` -------------------------------- ### getGamesBrazil() Source: https://favna.github.io/nintendo-switch-eshop/api/functions/getgamesbrazil Fetches all games currently available on the Brazilian e-shop. This function returns a Promise that resolves to an array of GameUS objects. ```APIDOC ## getGamesBrazil() ### Description Fetches all games on the Brazilian e-shop. Currently, this function only returns all games present in the e-shop. ### Method `getGamesBrazil()` ### Returns `Promise` - A Promise that resolves to an array of `GameUS` objects, representing all games available on the Brazilian e-shop. ``` -------------------------------- ### EshopError Constructor Source: https://favna.github.io/nintendo-switch-eshop/api/classes/eshoperror Creates a new instance of the EshopError class. This error is used to signify issues encountered within the nintendo-switch-eshop library. ```APIDOC ## new EshopError(message: string): EshopError ### Description Create an EshopError. ### Parameters #### message - **message** (string) - Required - The message the error should show ### Returns - `EshopError` ### Overrides - `Error.constructor` ``` -------------------------------- ### GameEU Interface Properties Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/gameeu This section details the properties available in the GameEU interface, including their types and a brief description where applicable. ```APIDOC ## GameEU Interface Properties ### play_mode_handheld_mode_b - **Type**: `boolean` - **Description**: Indicates if the game supports handheld mode. ### play_mode_tabletop_mode_b - **Type**: `boolean` - **Description**: Indicates if the game supports tabletop mode. ### play_mode_tv_mode_b - **Type**: `boolean` - **Description**: Indicates if the game supports TV mode. ### playable_on_txt - **Type**: `string[]` - **Description**: A list of platforms the game is playable on. ### players_from - **Type**: `number` - **Description**: The minimum number of players supported. ### players_to - **Type**: `number` - **Description**: The maximum number of players supported. ### popularity - **Type**: `number` - **Description**: A measure of the game's popularity. ### pretty_agerating_s - **Type**: `string` - **Description**: The human-readable age rating of the game. ### pretty_date_s - **Type**: `string` - **Description**: The formatted release date of the game. ### pretty_game_categories_txt - **Type**: `string[]` - **Description**: A list of formatted game categories. ### price_discount_percentage_f - **Type**: `number` - **Description**: The discount percentage for the game's price. ### price_has_discount_b - **Type**: `boolean` - **Description**: Indicates if the game is currently on discount. ### price_lowest_f - **Type**: `number` - **Description**: The lowest price the game has been offered at. ### price_regular_f - **Type**: `number` - **Description**: The regular price of the game. ### price_sorting_f - **Type**: `number` - **Description**: A numerical value used for sorting by price. ### priority - **Type**: `Date` - **Description**: A date indicating the priority of the game listing. ### product_catalog_description_s - **Type**: `string` - **Description**: The product description for catalog purposes. ### product_code_ss - **Type**: `string[]` - **Description**: A list of product codes (string set). ### product_code_txt - **Type**: `string[]` - **Description**: A list of product codes (text). ### publisher - **Type**: `string` - **Description**: The publisher of the game. ### sorting_title - **Type**: `string` - **Description**: The title used for sorting purposes. ### switch_game_voucher_b - **Type**: `boolean` - **Description**: Indicates if a Switch game voucher is applicable. ### system_names_txt - **Type**: `string[]` - **Description**: A list of system names associated with the game. ### system_type - **Type**: `string[]` - **Description**: A list of system types the game is compatible with. ### title - **Type**: `string` - **Description**: The title of the game. ### title_extras_txt - **Type**: `string[]` - **Description**: Additional text related to the game's title. ### type - **Type**: `string` - **Description**: The type of product listing. ### url - **Type**: `string` - **Description**: The URL path of the game on the eShop website (does not include domain). ### wishlist_email_banner460w_image_url_s - **Type**: `string` - **Description**: URL for a 460px wide banner image for wishlists. ### wishlist_email_banner640w_image_url_s - **Type**: `string` - **Description**: URL for a 640px wide banner image for wishlists. ### wishlist_email_square_image_url_s - **Type**: `string` - **Description**: URL for a square image for wishlists. ``` -------------------------------- ### Import ES Modules Source: https://favna.github.io/nintendo-switch-eshop/api/readme Import specific functions for use in your project when using ES Modules. ```javascript import { getGamesAmerica, getGamesEurope, getGamesJapan, getQueriedGamesAmerica } from 'nintendo-switch-eshop'; ``` -------------------------------- ### HighlightResult Interface Properties Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/highlightresult This snippet details the properties available within the HighlightResult interface. ```APIDOC ## HighlightResult ### Properties - **nsuid** (`Nsuid`): Represents the Nintendo Switch Online ID. - **publishers** (`Nsuid[]`): An array of NSUids representing the publishers. - **title** (`Nsuid`): Represents the title of the item. ``` -------------------------------- ### Import CommonJS Modules Source: https://favna.github.io/nintendo-switch-eshop/api/readme Import specific functions for use in your project when using CommonJS. ```javascript const { getGamesAmerica, getGamesEurope, getGamesJapan, getQueriedGamesAmerica } = require('nintendo-switch-eshop'); ``` -------------------------------- ### Define QUERIED_US_ALGOLIA_KEY_NEW Source: https://favna.github.io/nintendo-switch-eshop/api/variables/queried_us_algolia_key_new This constant holds the Algolia API key for querying US games. It is defined in utils/constants.ts. ```typescript const QUERIED_US_ALGOLIA_KEY_NEW : "a29c6927638bfd8cee23993e51e721c9" = 'a29c6927638bfd8cee23993e51e721c9' ``` -------------------------------- ### getQueriedGamesAmerica Source: https://favna.github.io/nintendo-switch-eshop/api/functions/getqueriedgamesamerica Fetches a subset of games from the American e-shops as based on a given query. It returns a Promise containing the first `hitsPerPage` games that match your query. ```APIDOC ## getQueriedGamesAmerica ### Description Fetches a subset of games from the American e-shops based on a given query. ### Method `getQueriedGamesAmerica` ### Parameters #### query - **query** (string) - Required - The query to search for. #### options - **options** (QueriedGamesAmericaOptions) - Optional - Additional options for the getQueriedGamesAmerica call. Defaults to `{ hitsPerPage: 200, page: 0 }`. ### Returns `Promise`<`QueriedGameUS`[]> Promise containing the first `hitsPerPage` games that match your query. ``` -------------------------------- ### GameJP Interface Properties Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/gamejp This snippet details the properties available within the GameJP interface. ```APIDOC ## GameJP Interface ### Properties - **ComingThumb** (string): Represents the thumbnail for upcoming games. - **D** (number): Likely a numerical identifier or flag. - **Hard** (string): Possibly related to hardware or game difficulty. - **InitialCode** (string): The unique game code for the game. - **LinkTarget** (string): The target of a hyperlink, if one exists. - **LinkURL** (string): The URL for the game. - **MakerKana** (string): The maker's name in Kana script. - **MakerName** (string): The name of the game maker. - **Memo** (string): Additional notes or remarks about the game. - **PlatformID** (string): Identifier for the game's platform. - **Price** (string): The price of the game. - **SalesDate** (string): The date when the game was or will be on sale. - **ScreenshotImgFlg** (number): Indicates the type of screenshot available. - **ScreenshotImgURL** (string): The URL for the game's screenshot. - **SoftType** (string): The type of software or game. - **ThumbVariation** (string): Specifies variations of the game's thumbnail. - **TitleName** (string): The official title of the game. - **TitleNameRuby** (string): The game's title name in Asian characters. ``` -------------------------------- ### QueriedGameResult Interface Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/queriedgameresult This interface defines the structure of the response when querying the Nintendo Switch eShop for games. It includes information about the search parameters, the number of results, and the game data itself. ```APIDOC ## Interface: QueriedGameResult ### Description Represents the result of a game query, containing pagination information and a list of games. ### Properties - **exhaustiveNbHits** (`boolean`): Indicates whether the total number of hits is exhaustive. - **hits** (`QueriedGameUS[]`): An array of game objects matching the query. - **hitsPerPage** (`number`): The number of games displayed per page. - **nbHits** (`number`): The total number of games found. - **nbPages** (`number`): The total number of pages available for the results. - **page** (`number`): The current page number of the results. - **params** (`string`): The parameters used for the query. - **processingTimeMS** (`number`): The time in milliseconds it took for the API to process the request. - **query** (`string`): The search query string that was used. ``` -------------------------------- ### Define QUERIED_BR_ALGOLIA_KEY Source: https://favna.github.io/nintendo-switch-eshop/api/variables/queried_br_algolia_key This constant holds the Algolia API key used to query for BR games. It is defined in utils/constants.ts. ```typescript const QUERIED_BR_ALGOLIA_KEY : "c4da8be7fd29f0f5bfa42920b0a99dc7" = 'c4da8be7fd29f0f5bfa42920b0a99dc7' ``` -------------------------------- ### QueriedGamesAmericaOptions Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/queriedgamesamericaoptions Options for customizing game queries, such as setting the number of results per page and the specific page number. ```APIDOC ## Interface: QueriedGamesAmericaOptions ### Description Additional options for the [[getQueriedGamesAmerica]] method. ### Properties #### hitsPerPage? (number) * **Description**: The amount of hits to be received per page. * **Optional**: true * **Constraints**: minimum: 0, maximum: 200 * **Default**: 200 #### page? (number) * **Description**: The page number to get. * **Optional**: true * **Constraints**: minimum: 0 * **Default**: 0 ``` -------------------------------- ### QueriedGameUS Interface Fields Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/queriedgameus This section details the fields available within the QueriedGameUS interface, representing various attributes of a game. ```APIDOC ## QueriedGameUS Interface ### Description Represents a game object returned from a query, containing detailed information about the game. ### Fields - **softwarePublisher** (string) - The publisher of this game. - **title** (string) - The title of this game. - **topLevelCategory** (string) - The top level category of this game. #### Example ``` 'Games' ``` - **topLevelCategoryCode** (string) - The top level category code of this game. #### Example ``` 'GAMES' ``` - **topLevelFilters** (string[]) - The top level filters for this game. - **type** (string) - The type of search result. #### Example ``` 'game' ``` - **updatedAt** (string) - An ISO timestamp of when this game was last updated. - **url** (string) - A unique URL to the information about this game. Prefix it with nintendo.com to have a valid URL. - **urlKey** (string) - The key segment of the QueriedGameUS.url, often the last segment of the URL. - **visibleInSearch** (boolean) - Whether this game is visible when searching for it on nintendo.com. ``` -------------------------------- ### parseNSUID Source: https://favna.github.io/nintendo-switch-eshop/api/functions/parsensuid Extracts NSUID information from the game object. ```APIDOC ## parseNSUID ### Description Extracts NSUID information from the game object. ### Signature `parseNSUID(game, region): null | string` ### Parameters #### game - **game** (`GameEU` | `GameUS` | `GameJP`) - The game object returned from one of the other methods. #### region - **region** (`Region`) - Required - Region code ### Returns - `null` | `string` - The 14-digits NSUID ``` -------------------------------- ### getGamesAmerica() Source: https://favna.github.io/nintendo-switch-eshop/api/functions/getgamesamerica Fetches all games available on the American e-shop. Currently, this function only returns all games in the e-shop. ```APIDOC ## getGamesAmerica() ### Description Fetches all games on american e-shops. Currently ONLY returns all games in the e-shop. ### Method `getGamesAmerica` ### Returns `Promise` - A promise that resolves to an array of GameUS objects, representing all games in the e-shop. ``` -------------------------------- ### Nsuid Interface Properties Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/nsuid This snippet details the properties of the Nsuid interface as defined in the system's utilities. ```APIDOC ## Interface: Nsuid ### Description Represents a unique identifier for Nintendo Switch eShop entries, potentially including highlighting and matching information. ### Properties - **fullyHighlighted?** (`boolean`): An optional boolean indicating if the item is fully highlighted. - **matchLevel** (`string`): The level of match for the identifier. - **matchedWords** (`string[]`): An array of strings representing matched words. - **value** (`string`): The actual unique identifier string. ``` -------------------------------- ### Define QUERIED_US_ALGOLIA_KEY_OLD Constant Source: https://favna.github.io/nintendo-switch-eshop/api/variables/queried_us_algolia_key_old This constant defines the Algolia API key used for querying US games. It is declared as a constant with a string value. ```typescript const QUERIED_US_ALGOLIA_KEY_OLD : "6efbfb0f8f80defc44895018caf77504" = '6efbfb0f8f80defc44895018caf77504' ``` -------------------------------- ### QueriedGameUS Properties Source: https://favna.github.io/nintendo-switch-eshop/api/interfaces/queriedgameus The QueriedGameUS interface defines the structure of game data returned by the Nintendo eShop API for the US region. It includes details such as availability, pricing, descriptions, developer information, ESRB ratings, and platform specifics. ```APIDOC ## QueriedGameUS Interface ### Description This interface represents the data structure for a game queried from the US Nintendo eShop. ### Properties * **_distinctSeqID** (`number`): Additional information returned by the API, not directly used. * **_highlightResult** (`HighlightResult`): Additional information returned by the API, not directly used. * **availability** (`string[]`): Indicates the availability status of the game. * **boxart?** (`string`): The box art image URL for the game. Optional, often undefined for unreleased games. * **classindDescriptors?** (`unknown`): Optional property, type unknown. * **classindRating?** (`unknown`): Optional property, type unknown. * **collectionPriceRange** (`string`): The price range for the game collection. * **contentRatingCode** (`string`): The content rating code for the game (e.g., ESRB rating code). * **corePlatforms** (`string[]`): A list of core platforms the game is available on. * **createdAt** (`Date`): The date and time when the game information was created. * **demoNsuid** (`null` | `string`): The NSUID for the game's demo, if available. * **depth?** (`number`): Optional depth property. * **description** (`string`): A detailed description of the game. * **developers** (`string[]`): A list of companies that developed the game. * **esrbDescriptors** (`string[]`): A list of ESRB descriptors associated with the game's rating. * **esrbRating** (`string`): The ESRB rating for the game (e.g., 'E', 'T', 'M'). * **exclusive** (`boolean`): Indicates if the game is exclusive to a platform. * **featured** (`boolean`): Whether the game is featured on the Nintendo.com homepage. * **featuredProduct** (`boolean`): Whether the game is highlighted as a featured product. * **franchises** (`string`): The name of the franchise the game belongs to. * **freeToStart** (`boolean`): Indicates if the game is free to start. * **generalFilters** (`string[]`): A list of general filters applicable to the game for searching. * **genres** (`string[]`): A list of genres the game belongs to. * **hasDlc** (`boolean`): Indicates whether the game has downloadable content. * **headerImage?** (`string`): A large header image URL for the game. Optional. * **horizontalHeaderImage?** (`string`): A horizontal header image URL for the game. Optional. * **howToShop** (`string[]`): A list of methods through which the game can be purchased or acquired. * **lastModified** (`number`): A Unix timestamp (in milliseconds) indicating the last modification time of the game information. * **lowestPrice** (`number`): The lowest price the game has ever been sold for. ``` -------------------------------- ### Define US Algolia Key Source: https://favna.github.io/nintendo-switch-eshop/api/variables/us_algolia_key This constant holds the Algolia API key required for searching US region games on the Nintendo eShop. It is defined in utils/constants.ts. ```typescript const US_ALGOLIA_KEY : "c4da8be7fd29f0f5bfa42920b0a99dc7" = 'c4da8be7fd29f0f5bfa42920b0a99dc7' ``` -------------------------------- ### parseGameCode Source: https://favna.github.io/nintendo-switch-eshop/api/functions/parsegamecode Parses the game code to extract the cross-region portion. ```APIDOC ## parseGameCode ### Description Parses the game code to extract the cross-region portion. ### Parameters #### game - **game** (GameEU | GameUS | GameJP) - Required - The game object returned from one of the other methods. #### region - **region** (Region) - Required - Region code ### Returns - **null** | **string** - The 4-digit resulting game code ``` -------------------------------- ### Define BR_ALGOLIA_ID Constant Source: https://favna.github.io/nintendo-switch-eshop/api/variables/br_algolia_id This constant holds the Algolia ID used for fetching BR games. It's a string literal defined in the project's constants file. ```typescript const BR_ALGOLIA_ID : "U3B6GR4UA3" = 'U3B6GR4UA3' ``` -------------------------------- ### Region Enumeration Members Source: https://favna.github.io/nintendo-switch-eshop/api/enumerations/region The Region enumeration consists of the following members: AMERICAS, EUROPE, and ASIA, each with a specific integer value. ```APIDOC ## Enumeration: Region ### Description Predefined options for the unit system. ### Members #### AMERICAS - **Value**: `1` - **Defined in**: utils/constants.ts:109 #### EUROPE - **Value**: `2` - **Defined in**: utils/constants.ts:110 #### ASIA - **Value**: `3` - **Defined in**: utils/constants.ts:111 ``` -------------------------------- ### Define US Algolia ID Source: https://favna.github.io/nintendo-switch-eshop/api/variables/us_algolia_id This constant holds the Algolia ID specifically for retrieving United States game data. It is defined in utils/constants.ts. ```typescript const US_ALGOLIA_ID : "U3B6GR4UA3" = 'U3B6GR4UA3' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.