Skip to content

favna/nintendo-switch-eshop

Repository files navigation

logo

nintendo-switch-eshop

A Node.JS lib written to extract Nintendo Switch's eShop game and pricing information

DepfuLicenseNode VersionBuild Status

NPM bundle size (minified)NPM bundle size (minified + gzip)NPM VersionNPM Weekly DownloadsNPM Total Downloads


Installation

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

API

nintendo-switch-eshop

Globals

nintendo-switch-eshop

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

EURequestOptions

Ƭ EURequestOptions: object & RequestOptions

Defined in interfaces.ts:183


USRequestOptions

Ƭ USRequestOptions: object & RequestOptions

Defined in interfaces.ts:175

Variables

Const EU_DEFAULT_LOCALE

EU_DEFAULT_LOCALE: "en" = "en"

Defined in constants.ts:53

Default locale when getting EU games - defaults to en


Const EU_GAME_CHECK_CODE

EU_GAME_CHECK_CODE: "70010000000184" = "70010000000184"

Defined in constants.ts:47

Sample game code for EU store


Const EU_GAME_CODE_REGEX

EU_GAME_CODE_REGEX: RegExp = /HAC\w(\w{4})/

Defined in constants.ts:50

Regex for EU game codes


Const EU_GAME_LIST_LIMIT

EU_GAME_LIST_LIMIT: 9999 = 9999

Defined in constants.ts:56

Default limit used when getting EU games - defaults to 9999


Const EU_GET_GAMES_URL

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


Const JP_GAME_CHECK_CODE

JP_GAME_CHECK_CODE: "70010000000039" = "70010000000039"

Defined in constants.ts:65

Sample game code for JP store


Const JP_GAME_CODE_REGEX

JP_GAME_CODE_REGEX: RegExp = //HAC(\w{4})/

Defined in constants.ts:68

Regex for JP game codes


Const JP_GET_GAMES_COMING

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


Const JP_GET_GAMES_CURRENT

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


Const JP_NSUID_REGEX

JP_NSUID_REGEX: RegExp = /\d{14}/

Defined in constants.ts:71

Regex for JP NSUID


Const PRICE_GET_URL

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


Const PRICE_LIST_LIMIT

PRICE_LIST_LIMIT: 50 = 50

Defined in constants.ts:80

Default limit used when getting price data - defaults to 50


Const US_ALGOLIA_ID

US_ALGOLIA_ID: "U3B6GR4UA3" = "U3B6GR4UA3"

Defined in constants.ts:7

Algolia ID for getting US games


Const US_ALGOLIA_KEY

US_ALGOLIA_KEY: "9a20c93440cf63cf1a7008d75f7438bf" = "9a20c93440cf63cf1a7008d75f7438bf"

Defined in constants.ts:10

Algolia Key for getting US games


Const US_GAME_CHECK_CODE

US_GAME_CHECK_CODE: "70010000000185" = "70010000000185"

Defined in constants.ts:16

Sample game code for US store


Const US_GAME_CODE_REGEX

US_GAME_CODE_REGEX: RegExp = /HAC\w(\w{4})/

Defined in constants.ts:19

Regex for US game codes


Const US_GAME_LIST_LIMIT

US_GAME_LIST_LIMIT: 200 = 200

Defined in constants.ts:22

Default limit for getting US games - Defaults to 200


Const US_GET_GAMES_URL

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


Const US_PRICE_RANGES

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

Functions

Const getActiveShops

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.


Const getGamesAmerica

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


Const getGamesEurope

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


Const getGamesJapan

getGamesJapan(): Promise‹GameJP[]›

Defined in nintendo-switch-eshop.ts:266

Fetches all games on japanese eShops

Returns: Promise‹GameJP[]›

Promise containing all the games


Const getPrices

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.


Const getShopsAmerica

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.


Const getShopsAsia

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.


Const getShopsByCountryCodes

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.


Const getShopsEurope

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.


Const parseGameCode

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


Const parseNSUID

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

Object literals

Const EU_GET_GAMES_OPTIONS

EU_GET_GAMES_OPTIONS: object

Defined in constants.ts:35

Options used for getting EU gmaes

fq

fq: string = "type:GAME AND system_type:nintendoswitch* AND product_code_txt:*"

Defined in constants.ts:36

q

q: string = "*"

Defined in constants.ts:37

sort

sort: string = "sorting_title asc"

Defined in constants.ts:38

start

start: string = "0"

Defined in constants.ts:39

wt

wt: string = "json"

Defined in constants.ts:40


Const PRICE_GET_OPTIONS

PRICE_GET_OPTIONS: object

Defined in constants.ts:77

Options for getting Price data

lang

lang: string = "en"

Defined in constants.ts:77


Const US_GET_GAMES_OPTIONS

US_GET_GAMES_OPTIONS: object

Defined in constants.ts:4

Options used for getting US gmaes

direction

direction: string = "asc"

Defined in constants.ts:4

sort

sort: string = "title"

Defined in constants.ts:4

system

system: string = "platform:Nintendo Switch"

Defined in constants.ts:4

Classes

nintendo-switch-eshop

GlobalsEshopError

Class: EshopError

Class representing an error in the nintendo-switch-eshop library

Hierarchy

  • Error

    • EshopError

Index

Constructors

Properties

Constructors

constructor

+ 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

Properties

message

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

name: string

Inherited from void

Defined in E:/dev/nintendo-switch-eshop/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:973


Optional stack

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


Static Error

Error: ErrorConstructor

Defined in E:/dev/nintendo-switch-eshop/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:984

Enums

nintendo-switch-eshop

GlobalsRegion

Enumeration: Region

Predefined options for the unit system

Index

Enumeration members

Enumeration members

AMERICAS

AMERICAS: = 1

Defined in interfaces.ts:192


ASIA

ASIA: = 3

Defined in interfaces.ts:194


EUROPE

EUROPE: = 2

Defined in interfaces.ts:193

Interfaces

nintendo-switch-eshop

GlobalsAlgoliaResponse

Interface: AlgoliaResponse

Hierarchy

  • AlgoliaResponse

Index

Properties

Properties

results

results: AlgoliaResults[]

Defined in interfaces.ts:111

nintendo-switch-eshop

GlobalsAlgoliaResults

Interface: AlgoliaResults

Hierarchy

  • AlgoliaResults

Index

Properties

Properties

exhaustiveFacetsCount

exhaustiveFacetsCount: boolean

Defined in interfaces.ts:103


exhaustiveNbHits

exhaustiveNbHits: boolean

Defined in interfaces.ts:104


facetFilters

facetFilters: string[][]

Defined in interfaces.ts:102

Filters for the search query


facets

facets: object

Defined in interfaces.ts:96

Type declaration:

  • [ key: string]: object

  • [ key: string]: number


hits

hits: GameUS[]

Defined in interfaces.ts:88

The games found


hitsPerPage

hitsPerPage: number

Defined in interfaces.ts:94

Number of hits per page


index

index: string

Defined in interfaces.ts:107


nbHits

nbHits: number

Defined in interfaces.ts:90

Total number of hits with current query


nbPages

nbPages: number

Defined in interfaces.ts:92


page

page: number

Defined in interfaces.ts:91


params

params: string

Defined in interfaces.ts:106


processingTimeMS

processingTimeMS: number

Defined in interfaces.ts:95


query

query: string

Defined in interfaces.ts:105

nintendo-switch-eshop

GlobalsCategory

Interface: Category

Hierarchy

  • Category

Index

Properties

Properties

category

category: string[]

Defined in interfaces.ts:5

Categories array

nintendo-switch-eshop

GlobalsEShop

Interface: EShop

Hierarchy

  • EShop

Index

Properties

Properties

code

code: string

Defined in interfaces.ts:133


country

country: string

Defined in interfaces.ts:134


currency

currency: string

Defined in interfaces.ts:135


region

region: Region

Defined in interfaces.ts:136

nintendo-switch-eshop

GlobalsGameEU

Interface: GameEU

Hierarchy

  • GameEU

Index

Properties

Properties

add_on_content_b

add_on_content_b: boolean

Defined in interfaces.ts:33


age_rating_sorting_i

age_rating_sorting_i: number

Defined in interfaces.ts:43


age_rating_type

age_rating_type: string

Defined in interfaces.ts:9


age_rating_value

age_rating_value: string

Defined in interfaces.ts:10


change_date

change_date: Date

Defined in interfaces.ts:40


club_nintendo

club_nintendo: boolean

Defined in interfaces.ts:34


compatible_controller

compatible_controller: string[]

Defined in interfaces.ts:46


copyright_s

copyright_s: string

Defined in interfaces.ts:11


date_from

date_from: Date

Defined in interfaces.ts:41


developer

developer: string

Defined in interfaces.ts:12


excerpt

excerpt: string

Defined in interfaces.ts:13


fs_id

fs_id: string

Defined in interfaces.ts:14


game_categories_txt

game_categories_txt: string[]

Defined in interfaces.ts:47


game_category

game_category: string[]

Defined in interfaces.ts:48


game_series_t

game_series_t: string

Defined in interfaces.ts:15


gift_finder_carousel_image_url_s

gift_finder_carousel_image_url_s: string

Defined in interfaces.ts:16


gift_finder_description_s

gift_finder_description_s: string

Defined in interfaces.ts:17


gift_finder_detail_page_image_url_s

gift_finder_detail_page_image_url_s: string

Defined in interfaces.ts:18


gift_finder_detail_page_store_link_s

gift_finder_detail_page_store_link_s: string

Defined in interfaces.ts:19


gift_finder_wishlist_image_url_s

gift_finder_wishlist_image_url_s: string

Defined in interfaces.ts:20


image_url

image_url: string

Defined in interfaces.ts:21


image_url_h2x1_s

image_url_h2x1_s: string

Defined in interfaces.ts:22


image_url_sq_s

image_url_sq_s: string

Defined in interfaces.ts:23


image_url_tm_s

image_url_tm_s: string

Defined in interfaces.ts:24


language_availability

language_availability: string[]

Defined in interfaces.ts:49


near_field_comm_b

near_field_comm_b: boolean

Defined in interfaces.ts:35


nsuid_txt

nsuid_txt: string[]

Defined in interfaces.ts:51

Array containing the 14-digit game unique identifier


originally_for_t

originally_for_t: string

Defined in interfaces.ts:25


physical_version_b

physical_version_b: boolean

Defined in interfaces.ts:36


play_mode_handheld_mode_b

play_mode_handheld_mode_b: boolean

Defined in interfaces.ts:37


play_mode_tabletop_mode_b

play_mode_tabletop_mode_b: boolean

Defined in interfaces.ts:38


play_mode_tv_mode_b

play_mode_tv_mode_b: boolean

Defined in interfaces.ts:39


playable_on_txt

playable_on_txt: string[]

Defined in interfaces.ts:52


players_from

players_from: number

Defined in interfaces.ts:44


players_to

players_to: number

Defined in interfaces.ts:45


pretty_agerating_s

pretty_agerating_s: string

Defined in interfaces.ts:26


pretty_date_s

pretty_date_s: string

Defined in interfaces.ts:27


priority

priority: Date

Defined in interfaces.ts:42


product_code_txt

product_code_txt: string[]

Defined in interfaces.ts:54

Array containing the product code


publisher

publisher: string

Defined in interfaces.ts:28


sorting_title

sorting_title: string

Defined in interfaces.ts:29


system_names_txt

system_names_txt: string[]

Defined in interfaces.ts:55


system_type

system_type: string[]

Defined in interfaces.ts:56


title

title: string

Defined in interfaces.ts:30


title_extras_txt

title_extras_txt: string[]

Defined in interfaces.ts:57


type

type: string

Defined in interfaces.ts:31


url

url: string

Defined in interfaces.ts:32

nintendo-switch-eshop

GlobalsGameJP

Interface: GameJP

Hierarchy

  • GameJP

Index

Properties

Properties

Hard

Hard: string[]

Defined in interfaces.ts:128


LinkTarget

LinkTarget: string[]

Defined in interfaces.ts:117


LinkURL

LinkURL: string[]

Defined in interfaces.ts:116

A single item array containing the game url


MakerName

MakerName: string[]

Defined in interfaces.ts:127


Memo

Memo: string[]

Defined in interfaces.ts:129


SalesDate

SalesDate: string[]

Defined in interfaces.ts:125


SalesDateStr

SalesDateStr: string[]

Defined in interfaces.ts:126


ScreenshotImgURL

ScreenshotImgURL: string[]

Defined in interfaces.ts:119

A single item array containing the game thumbnail url


ScreenshotImgURLComing

ScreenshotImgURLComing: string[]

Defined in interfaces.ts:120


SoftType

SoftType: string[]

Defined in interfaces.ts:124


TitleName

TitleName: string[]

Defined in interfaces.ts:122

A single item array containing the game title


TitleNameRuby

TitleNameRuby: string[]

Defined in interfaces.ts:123

nintendo-switch-eshop

GlobalsGameUS

Interface: GameUS

Hierarchy

  • GameUS

Index

Properties

Properties

buyitnow

buyitnow: boolean

Defined in interfaces.ts:83


buyonline

buyonline: boolean

Defined in interfaces.ts:63


ca_price

ca_price: number

Defined in interfaces.ts:72

Canada eShop price (in canadian dollars)


categories

categories: Category

Defined in interfaces.ts:80


digitaldownload

digitaldownload: boolean

Defined in interfaces.ts:78


eshop_price

eshop_price: number

Defined in interfaces.ts:66

USA eShop price (in dollars)


free_to_start

free_to_start: boolean

Defined in interfaces.ts:77


front_box_art

front_box_art: string

Defined in interfaces.ts:64


game_code

game_code: string

Defined in interfaces.ts:62

Product code. Can be parsed for a region wide code.


id

id: string

Defined in interfaces.ts:73


nsuid

nsuid: string

Defined in interfaces.ts:68

14-digit game unique identifier


number_of_players

number_of_players: string

Defined in interfaces.ts:70


release_date

release_date: string

Defined in interfaces.ts:79


slug

slug: string

Defined in interfaces.ts:82

Game URL name


system

system: string

Defined in interfaces.ts:76

Gaming platform


title

title: string

Defined in interfaces.ts:74


video_link

video_link: string

Defined in interfaces.ts:69

nintendo-switch-eshop

GlobalsPriceData

Interface: PriceData

Hierarchy

  • PriceData

Index

Properties

Properties

amount

amount: string

Defined in interfaces.ts:159


currency

currency: string

Defined in interfaces.ts:160


Optional end_datetime

end_datetime? : undefined | string

Defined in interfaces.ts:163


raw_value

raw_value: string

Defined in interfaces.ts:161


Optional start_datetime

start_datetime? : undefined | string

Defined in interfaces.ts:162

nintendo-switch-eshop

GlobalsPriceError

Interface: PriceError

Hierarchy

  • PriceError

Index

Properties

Properties

code

code: string

Defined in interfaces.ts:154


message

message: string

Defined in interfaces.ts:155

nintendo-switch-eshop

GlobalsPriceResponse

Interface: PriceResponse

Hierarchy

  • PriceResponse

Index

Properties

Properties

country

country: Country

Defined in interfaces.ts:142


error

error: PriceError

Defined in interfaces.ts:140


personalized

personalized: boolean

Defined in interfaces.ts:141


prices

prices: TitleData[]

Defined in interfaces.ts:143

nintendo-switch-eshop

GlobalsRequestOptions

Interface: RequestOptions

Hierarchy

  • RequestOptions

Index

Properties

Properties

Optional limit

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.

nintendo-switch-eshop

GlobalsTitleData

Interface: TitleData

Hierarchy

  • TitleData

Index

Properties

Properties

Optional discount_price

discount_price? : PriceData

Defined in interfaces.ts:150


regular_price

regular_price: PriceData

Defined in interfaces.ts:149


sales_status

sales_status: string

Defined in interfaces.ts:148


title_id

title_id: number

Defined in interfaces.ts:147