Add the package through your package manager of choice:
npm install nintendo-switch-eshop
# yarn add nintendo-switch-eshop
Require your desired functions:
const { getGamesAmerica, getGamesEurope, getGamesJapan } = require('nintendo-switch-eshop');
// ES6 Style: import { getGamesAmerica, getGamesEurope, getGamesJapan } from 'nintendo-switch-eshop';
// getGamesAmerica is also default exported: import getGamesAmerica from 'nintendo-switch-eshop';
For calling functions with the correct parameters and syntax please refer to the documentation below:
Copyright © 2017
lmmfranco
- AlgoliaResponse
- AlgoliaResults
- Category
- EShop
- GameEU
- GameJP
- GameUS
- PriceData
- PriceError
- PriceResponse
- RequestOptions
- TitleData
- EU_DEFAULT_LOCALE
- EU_GAME_CHECK_CODE
- EU_GAME_CODE_REGEX
- EU_GAME_LIST_LIMIT
- EU_GET_GAMES_URL
- JP_GAME_CHECK_CODE
- JP_GAME_CODE_REGEX
- JP_GET_GAMES_COMING
- JP_GET_GAMES_CURRENT
- JP_NSUID_REGEX
- PRICE_GET_URL
- PRICE_LIST_LIMIT
- US_ALGOLIA_ID
- US_ALGOLIA_KEY
- US_GAME_CHECK_CODE
- US_GAME_CODE_REGEX
- US_GAME_LIST_LIMIT
- US_GET_GAMES_URL
- US_PRICE_RANGES
- getActiveShops
- getGamesAmerica
- getGamesEurope
- getGamesJapan
- getPrices
- getShopsAmerica
- getShopsAsia
- getShopsByCountryCodes
- getShopsEurope
- parseGameCode
- parseNSUID
Ƭ EURequestOptions: object & RequestOptions
Defined in interfaces.ts:183
Ƭ USRequestOptions: object & RequestOptions
Defined in interfaces.ts:175
• EU_DEFAULT_LOCALE: "en" = "en"
Defined in constants.ts:53
Default locale when getting EU games - defaults to en
• EU_GAME_CHECK_CODE: "70010000000184" = "70010000000184"
Defined in constants.ts:47
Sample game code for EU store
• EU_GAME_CODE_REGEX: RegExp = /HAC\w(\w{4})/
Defined in constants.ts:50
Regex for EU game codes
• EU_GAME_LIST_LIMIT: 9999 = 9999
Defined in constants.ts:56
Default limit used when getting EU games - defaults to 9999
• EU_GET_GAMES_URL: "http://search.nintendo-europe.com/{locale}/select" = "http://search.nintendo-europe.com/{locale}/select"
Defined in constants.ts:44
URL for getting EU Games
• JP_GAME_CHECK_CODE: "70010000000039" = "70010000000039"
Defined in constants.ts:65
Sample game code for JP store
• JP_GAME_CODE_REGEX: RegExp = //HAC(\w{4})/
Defined in constants.ts:68
Regex for JP game codes
• JP_GET_GAMES_COMING: "https://www.nintendo.co.jp/data/software/xml-system/switch-coming.xml" = "https://www.nintendo.co.jp/data/software/xml-system/switch-coming.xml"
Defined in constants.ts:62
URL for getting upcoming JP Games
• JP_GET_GAMES_CURRENT: "https://www.nintendo.co.jp/data/software/xml-system/switch-onsale.xml" = "https://www.nintendo.co.jp/data/software/xml-system/switch-onsale.xml"
Defined in constants.ts:59
URL for getting currently released JP Games
• JP_NSUID_REGEX: RegExp = /\d{14}/
Defined in constants.ts:71
Regex for JP NSUID
• PRICE_GET_URL: "https://api.ec.nintendo.com/v1/price" = "https://api.ec.nintendo.com/v1/price"
Defined in constants.ts:74
URL for getting game prices
• PRICE_LIST_LIMIT: 50 = 50
Defined in constants.ts:80
Default limit used when getting price data - defaults to 50
• US_ALGOLIA_ID: "U3B6GR4UA3" = "U3B6GR4UA3"
Defined in constants.ts:7
Algolia ID for getting US games
• US_ALGOLIA_KEY: "9a20c93440cf63cf1a7008d75f7438bf" = "9a20c93440cf63cf1a7008d75f7438bf"
Defined in constants.ts:10
Algolia Key for getting US games
• US_GAME_CHECK_CODE: "70010000000185" = "70010000000185"
Defined in constants.ts:16
Sample game code for US store
• US_GAME_CODE_REGEX: RegExp = /HAC\w(\w{4})/
Defined in constants.ts:19
Regex for US game codes
• US_GAME_LIST_LIMIT: 200 = 200
Defined in constants.ts:22
Default limit for getting US games - Defaults to 200
• US_GET_GAMES_URL: string = https://${US_ALGOLIA_ID}-dsn.algolia.net/1/indexes/*/queries
Defined in constants.ts:13
URL for getting US Games
• US_PRICE_RANGES: string[] = [ 'Free to start', '$0 - $4.99', '$5 - $9.99', '$10 - $19.99', '$20 - $39.99', '$40+' ]
Defined in constants.ts:25
Price ranges for US games
▸ getActiveShops(): Promise‹EShop[]›
Defined in nintendo-switch-eshop.ts:465
Gets all active eShops.
Returns: Promise‹EShop[]›
A list of shop objects with country code, name and default currency.
▸ getGamesAmerica(options
: USRequestOptions, offset
: number, games
: GameUS[]): Promise‹GameUS[]›
Defined in nintendo-switch-eshop.ts:91
Fetches all games on american eshops
Parameters:
Name | Type | Default | Description |
---|---|---|---|
options |
USRequestOptions | {} | (Optional) Options for the request |
offset |
number | 0 | (Optional) Offset to start searching at |
games |
GameUS[] | [] | (Optional) Array of games to filter by |
Returns: Promise‹GameUS[]›
Promise containing all the games
▸ getGamesEurope(options
: EURequestOptions): Promise‹GameEU[]›
Defined in nintendo-switch-eshop.ts:295
Fetches all games on the European, Australian or New Zealand eShops
Parameters:
Name | Type | Default | Description |
---|---|---|---|
options |
EURequestOptions | { limit: EU_GAME_LIST_LIMIT, locale: EU_DEFAULT_LOCALE } | Request options to pass to the eShop request {@link EURequestOptions |
Returns: Promise‹GameEU[]›
Promise containing all requested EU/PAL games
▸ getGamesJapan(): Promise‹GameJP[]›
Defined in nintendo-switch-eshop.ts:266
Fetches all games on japanese eShops
Returns: Promise‹GameJP[]›
Promise containing all the games
▸ getPrices(country
: string, gameIds
: string[] | string, offset
: number, prices
: TitleData[]): Promise‹PriceResponse›
Defined in nintendo-switch-eshop.ts:325
Gets pricing information for the requested games. Paginates every 50 games.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
country |
string | - | A two digit country code. (ISO 3166-1 alpha-2 country code) |
gameIds |
string[] | string | - | One or more NSUID of the corresponding games. |
offset |
number | 0 | (Optional) The offset to start at |
prices |
TitleData[] | [] | (Optional) An array of TitleData |
Returns: Promise‹PriceResponse›
A promise containing the pricing information.
▸ getShopsAmerica(): Promise‹EShop[]›
Defined in nintendo-switch-eshop.ts:408
Gets all active eShops on American countries.
Returns: Promise‹EShop[]›
A list of shop objects with country code, name and default currency.
▸ getShopsAsia(): Promise‹EShop[]›
Defined in nintendo-switch-eshop.ts:446
Gets all active eShops on Asian countries
Returns: Promise‹EShop[]›
A list of shop objects with country code, name and default currency.
▸ getShopsByCountryCodes(countryCodes
: string[], gameCode
: string, region
: Region): Promise‹EShop[]›
Defined in nintendo-switch-eshop.ts:365
Gets all active eShops given a list of countries.
Parameters:
Name | Type | Description |
---|---|---|
countryCodes |
string[] | A list of 2 digit country codes for every country eShop to lookup. (ISO 3166-1 alpha-2 country codes) |
gameCode |
string | A 14 digits game NSUID from the desired region. |
region |
Region | A region id that will be appended in the final shop object for filtering purposes. |
Returns: Promise‹EShop[]›
A list of shop objects with country code, name and default currency.
▸ getShopsEurope(): Promise‹EShop[]›
Defined in nintendo-switch-eshop.ts:426
Gets all active eShops on European countries.
Returns: Promise‹EShop[]›
A list of shop objects with country code, name and default currency.
▸ parseGameCode(game
: GameUS | GameEU | GameJP, region
: Region): string | null
Defined in nintendo-switch-eshop.ts:484
Parses the game code to extract the cross-region portion.
Parameters:
Name | Type | Description |
---|---|---|
game |
GameUS | GameEU | GameJP | The game object returned from one of the other methods. |
region |
Region | Region code |
Returns: string | null
The 4-digit resulting game code
▸ parseNSUID(game
: GameUS | GameEU | GameJP, region
: Region): string | null
Defined in nintendo-switch-eshop.ts:510
Extracts NSUID information from the game object.
Parameters:
Name | Type | Description |
---|---|---|
game |
GameUS | GameEU | GameJP | The game object returned from one of the other methods. |
region |
Region | Region code |
Returns: string | null
The 14-digits NSUID
Defined in constants.ts:35
Options used for getting EU gmaes
• fq: string = "type:GAME AND system_type:nintendoswitch* AND product_code_txt:*"
Defined in constants.ts:36
• q: string = "*"
Defined in constants.ts:37
• sort: string = "sorting_title asc"
Defined in constants.ts:38
• start: string = "0"
Defined in constants.ts:39
• wt: string = "json"
Defined in constants.ts:40
Defined in constants.ts:77
Options for getting Price data
• lang: string = "en"
Defined in constants.ts:77
Defined in constants.ts:4
Options used for getting US gmaes
• direction: string = "asc"
Defined in constants.ts:4
• sort: string = "title"
Defined in constants.ts:4
• system: string = "platform:Nintendo Switch"
Defined in constants.ts:4
Class representing an error in the nintendo-switch-eshop library
-
Error
- EshopError
+ new EshopError(message
: string): EshopError
Defined in constants.ts:83
Create an EshopError
Parameters:
Name | Type | Description |
---|---|---|
message |
string | The message the error should show |
Returns: EshopError
• message: string
Inherited from void
Defined in E:/dev/nintendo-switch-eshop/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:974
• name: string
Inherited from void
Defined in E:/dev/nintendo-switch-eshop/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:973
• stack? : undefined | string
Inherited from void
Overrides void
Defined in E:/dev/nintendo-switch-eshop/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:975
▪ Error: ErrorConstructor
Defined in E:/dev/nintendo-switch-eshop/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:984
Predefined options for the unit system
• AMERICAS: = 1
Defined in interfaces.ts:192
• ASIA: = 3
Defined in interfaces.ts:194
• EUROPE: = 2
Defined in interfaces.ts:193
- AlgoliaResponse
• results: AlgoliaResults[]
Defined in interfaces.ts:111
- AlgoliaResults
- exhaustiveFacetsCount
- exhaustiveNbHits
- facetFilters
- facets
- hits
- hitsPerPage
- index
- nbHits
- nbPages
- page
- params
- processingTimeMS
- query
• exhaustiveFacetsCount: boolean
Defined in interfaces.ts:103
• exhaustiveNbHits: boolean
Defined in interfaces.ts:104
• facetFilters: string[][]
Defined in interfaces.ts:102
Filters for the search query
• facets: object
Defined in interfaces.ts:96
-
[ key: string]: object
-
[ key: string]: number
• hits: GameUS[]
Defined in interfaces.ts:88
The games found
• hitsPerPage: number
Defined in interfaces.ts:94
Number of hits per page
• index: string
Defined in interfaces.ts:107
• nbHits: number
Defined in interfaces.ts:90
Total number of hits with current query
• nbPages: number
Defined in interfaces.ts:92
• page: number
Defined in interfaces.ts:91
• params: string
Defined in interfaces.ts:106
• processingTimeMS: number
Defined in interfaces.ts:95
• query: string
Defined in interfaces.ts:105
- Category
• category: string[]
Defined in interfaces.ts:5
Categories array
- EShop
• code: string
Defined in interfaces.ts:133
• country: string
Defined in interfaces.ts:134
• currency: string
Defined in interfaces.ts:135
• region: Region
Defined in interfaces.ts:136
- GameEU
- add_on_content_b
- age_rating_sorting_i
- age_rating_type
- age_rating_value
- change_date
- club_nintendo
- compatible_controller
- copyright_s
- date_from
- developer
- excerpt
- fs_id
- game_categories_txt
- game_category
- game_series_t
- gift_finder_carousel_image_url_s
- gift_finder_description_s
- gift_finder_detail_page_image_url_s
- gift_finder_detail_page_store_link_s
- gift_finder_wishlist_image_url_s
- image_url
- image_url_h2x1_s
- image_url_sq_s
- image_url_tm_s
- language_availability
- near_field_comm_b
- nsuid_txt
- originally_for_t
- physical_version_b
- play_mode_handheld_mode_b
- play_mode_tabletop_mode_b
- play_mode_tv_mode_b
- playable_on_txt
- players_from
- players_to
- pretty_agerating_s
- pretty_date_s
- priority
- product_code_txt
- publisher
- sorting_title
- system_names_txt
- system_type
- title
- title_extras_txt
- type
- url
• add_on_content_b: boolean
Defined in interfaces.ts:33
• age_rating_sorting_i: number
Defined in interfaces.ts:43
• age_rating_type: string
Defined in interfaces.ts:9
• age_rating_value: string
Defined in interfaces.ts:10
• change_date: Date
Defined in interfaces.ts:40
• club_nintendo: boolean
Defined in interfaces.ts:34
• compatible_controller: string[]
Defined in interfaces.ts:46
• copyright_s: string
Defined in interfaces.ts:11
• date_from: Date
Defined in interfaces.ts:41
• developer: string
Defined in interfaces.ts:12
• excerpt: string
Defined in interfaces.ts:13
• fs_id: string
Defined in interfaces.ts:14
• game_categories_txt: string[]
Defined in interfaces.ts:47
• game_category: string[]
Defined in interfaces.ts:48
• game_series_t: string
Defined in interfaces.ts:15
• gift_finder_carousel_image_url_s: string
Defined in interfaces.ts:16
• gift_finder_description_s: string
Defined in interfaces.ts:17
• gift_finder_detail_page_image_url_s: string
Defined in interfaces.ts:18
• gift_finder_detail_page_store_link_s: string
Defined in interfaces.ts:19
• gift_finder_wishlist_image_url_s: string
Defined in interfaces.ts:20
• image_url: string
Defined in interfaces.ts:21
• image_url_h2x1_s: string
Defined in interfaces.ts:22
• image_url_sq_s: string
Defined in interfaces.ts:23
• image_url_tm_s: string
Defined in interfaces.ts:24
• language_availability: string[]
Defined in interfaces.ts:49
• near_field_comm_b: boolean
Defined in interfaces.ts:35
• nsuid_txt: string[]
Defined in interfaces.ts:51
Array containing the 14-digit game unique identifier
• originally_for_t: string
Defined in interfaces.ts:25
• physical_version_b: boolean
Defined in interfaces.ts:36
• play_mode_handheld_mode_b: boolean
Defined in interfaces.ts:37
• play_mode_tabletop_mode_b: boolean
Defined in interfaces.ts:38
• play_mode_tv_mode_b: boolean
Defined in interfaces.ts:39
• playable_on_txt: string[]
Defined in interfaces.ts:52
• players_from: number
Defined in interfaces.ts:44
• players_to: number
Defined in interfaces.ts:45
• pretty_agerating_s: string
Defined in interfaces.ts:26
• pretty_date_s: string
Defined in interfaces.ts:27
• priority: Date
Defined in interfaces.ts:42
• product_code_txt: string[]
Defined in interfaces.ts:54
Array containing the product code
• publisher: string
Defined in interfaces.ts:28
• sorting_title: string
Defined in interfaces.ts:29
• system_names_txt: string[]
Defined in interfaces.ts:55
• system_type: string[]
Defined in interfaces.ts:56
• title: string
Defined in interfaces.ts:30
• title_extras_txt: string[]
Defined in interfaces.ts:57
• type: string
Defined in interfaces.ts:31
• url: string
Defined in interfaces.ts:32
- GameJP
- Hard
- LinkTarget
- LinkURL
- MakerName
- Memo
- SalesDate
- SalesDateStr
- ScreenshotImgURL
- ScreenshotImgURLComing
- SoftType
- TitleName
- TitleNameRuby
• Hard: string[]
Defined in interfaces.ts:128
• LinkTarget: string[]
Defined in interfaces.ts:117
• LinkURL: string[]
Defined in interfaces.ts:116
A single item array containing the game url
• MakerName: string[]
Defined in interfaces.ts:127
• Memo: string[]
Defined in interfaces.ts:129
• SalesDate: string[]
Defined in interfaces.ts:125
• SalesDateStr: string[]
Defined in interfaces.ts:126
• ScreenshotImgURL: string[]
Defined in interfaces.ts:119
A single item array containing the game thumbnail url
• ScreenshotImgURLComing: string[]
Defined in interfaces.ts:120
• SoftType: string[]
Defined in interfaces.ts:124
• TitleName: string[]
Defined in interfaces.ts:122
A single item array containing the game title
• TitleNameRuby: string[]
Defined in interfaces.ts:123
- GameUS
- buyitnow
- buyonline
- ca_price
- categories
- digitaldownload
- eshop_price
- free_to_start
- front_box_art
- game_code
- id
- nsuid
- number_of_players
- release_date
- slug
- system
- title
- video_link
• buyitnow: boolean
Defined in interfaces.ts:83
• buyonline: boolean
Defined in interfaces.ts:63
• ca_price: number
Defined in interfaces.ts:72
Canada eShop price (in canadian dollars)
• categories: Category
Defined in interfaces.ts:80
• digitaldownload: boolean
Defined in interfaces.ts:78
• eshop_price: number
Defined in interfaces.ts:66
USA eShop price (in dollars)
• free_to_start: boolean
Defined in interfaces.ts:77
• front_box_art: string
Defined in interfaces.ts:64
• game_code: string
Defined in interfaces.ts:62
Product code. Can be parsed for a region wide code.
• id: string
Defined in interfaces.ts:73
• nsuid: string
Defined in interfaces.ts:68
14-digit game unique identifier
• number_of_players: string
Defined in interfaces.ts:70
• release_date: string
Defined in interfaces.ts:79
• slug: string
Defined in interfaces.ts:82
Game URL name
• system: string
Defined in interfaces.ts:76
Gaming platform
• title: string
Defined in interfaces.ts:74
• video_link: string
Defined in interfaces.ts:69
- PriceData
• amount: string
Defined in interfaces.ts:159
• currency: string
Defined in interfaces.ts:160
• end_datetime? : undefined | string
Defined in interfaces.ts:163
• raw_value: string
Defined in interfaces.ts:161
• start_datetime? : undefined | string
Defined in interfaces.ts:162
- PriceError
• code: string
Defined in interfaces.ts:154
• message: string
Defined in interfaces.ts:155
- PriceResponse
• country: Country
Defined in interfaces.ts:142
• error: PriceError
Defined in interfaces.ts:140
• personalized: boolean
Defined in interfaces.ts:141
• prices: TitleData[]
Defined in interfaces.ts:143
- RequestOptions
• limit? : undefined | number
Defined in interfaces.ts:172
Game count limit (Can only be lower than default page size).
remarks
On the US eshop, the max limit is 1000. Leave empty to get all the games.
- TitleData
• discount_price? : PriceData
Defined in interfaces.ts:150
• regular_price: PriceData
Defined in interfaces.ts:149
• sales_status: string
Defined in interfaces.ts:148
• title_id: number
Defined in interfaces.ts:147