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:


US_GET_GAMES_OPTIONS

Options used for getting US gmaes

Kind: global variable

US_ALGOLIA_ID

Algolia ID for getting US games

Kind: global variable

US_ALGOLIA_KEY

Algolia Key for getting US games

Kind: global variable

US_GET_GAMES_URL

URL for getting US Games

Kind: global variable

US_GAME_CHECK_CODE

Sample game code for US store

Kind: global variable

US_GAME_CODE_REGEX

Regex for US game codes

Kind: global variable

US_GAME_LIST_LIMIT

Default limit for getting US games - Defaults to 200

Kind: global variable

US_PRICE_RANGES

Price ranges for US games

Kind: global variable

EU_GET_GAMES_OPTIONS

Options used for getting EU gmaes

Kind: global variable

EU_GET_GAMES_URL

URL for getting EU Games

Kind: global variable

EU_GAME_CHECK_CODE

Sample game code for EU store

Kind: global variable

EU_GAME_CODE_REGEX

Regex for EU game codes

Kind: global variable

EU_DEFAULT_LOCALE

Default locale when getting EU games - defaults to en

Kind: global variable

EU_GAME_LIST_LIMIT

Default limit used when getting EU games - defaults to 9999

Kind: global variable

JP_GET_GAMES_CURRENT

URL for getting currently released JP Games

Kind: global variable

JP_GET_GAMES_COMING

URL for getting upcoming JP Games

Kind: global variable

JP_GAME_CHECK_CODE

Sample game code for JP store

Kind: global variable

JP_GAME_CODE_REGEX

Regex for JP game codes

Kind: global variable

JP_NSUID_REGEX

Regex for JP NSUID

Kind: global variable

PRICE_GET_URL

URL for getting game prices

Kind: global variable

PRICE_GET_OPTIONS

Options for getting Price data

Kind: global variable

PRICE_LIST_LIMIT

Default limit used when getting price data - defaults to 50

Kind: global variable

EshopError

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

Kind: global variable

Region : enum

Predefined options for the unit system

Kind: global enum
Properties

Name Type
1 Region.AMERICAS
2 Region.EUROPE
3 Region.ASIA

getGamesAmerica([options], [offset], [games]) ⇒ Promise<Array<GameUS>>

Fetches all games on american eshops

Paginates every 200 games, (maximum item count per request)

Kind: global function
Returns: Promise<Array<GameUS>> - Promise containing all the games

Param Type Description
[options] USRequestOptions (Optional) Options for the request
[offset] number (Optional) Offset to start searching at
[games] Array<string> (Optional) Array of games to filter by

getGamesJapan() ⇒ Promise<Array<GameJP>>

Fetches all games on japanese eShops

Kind: global function
Returns: Promise<Array<GameJP>> - Promise containing all the games

getGamesEurope([options]) ⇒ Promise<Array<GameUS>>

Fetches all games on european eShops

Kind: global function
Returns: Promise<Array<GameUS>> - Promise containing all the games

Param Type Description
[options] EURequestOptions (Optional) Options for the request

getPrices(country, gameIds, [offset], [prices]) ⇒ Promise<PriceResponse>

Get pricing information for the requested games. Paginates every 50 games.

Kind: global function
Returns: Promise<PriceResponse> - A promise containing the pricing information.

Param Type Description
country string A two digit country code. (ISO 3166-1 alpha-2 country code)
gameIds Array<string> | string One or more NSUID of the corresponding games.
[offset] number (Optional) The offset to start at
[prices] Array<TitleData> (Optional) An array of TitleData

getShopsByCountryCodes(countryCodes, gameCode, region) ⇒ Promise<Array<EShop>>

Gets all active eShops given a list of countries.

Kind: global function
Returns: Promise<Array<EShop>> - A list of shop objects with country code, name and default currency.

Param Type Description
countryCodes Array<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.

getShopsAmerica() ⇒ Promise<Array<EShop>>

Gets all active eShops on American countries. This method will launch several requests at nintendo web services, so don't abuse it.

Kind: global function
Returns: Promise<Array<EShop>> - A list of shop objects with country code, name and default currency.

getShopsEurope() ⇒ Promise<Array<EShop>>

Gets all active eShops on European countries. This method will launch several requests at nintendo web services, so don't abuse it.

Kind: global function
Returns: Promise<Array<EShop>> - A list of shop objects with country code, name and default currency.

getShopsAsia() ⇒ Promise<Array<EShop>>

Gets all active eShops on Asian countries This method will launch several requests at nintendo web services, so don't abuse it.

Kind: global function
Returns: Promise<Array<EShop>> - A list of shop objects with country code, name and default currency.

getActiveShops() ⇒ Promise<Array<EShop>>

Gets all active eShops. This method will launch several requests at nintendo web services, so don't abuse it.

Kind: global function
Returns: Promise<Array<EShop>> - A list of shop objects with country code, name and default currency.

parseGameCode(game, region) ⇒ string | null

Parses the game code to extract the cross-region protion.

Kind: global function
Returns: string | null - The 4-digit resulting game code

Param Type Description
game GameUS | GameEU | GameJP The game object returned from one of the other methods.
region Region Region code

parseNSUID(game, region) ⇒ string | null

Extracts NSUID information from the game object.

Kind: global function
Returns: string | null - The 14-digits NSUID

Param Type Description
game GameUS | GameEU | GameJP The game object returned from one of the other methods.
region Region Region code

This is the documentation for nintendo-switch-eshop. Documentation is generated by JSDoc and jsdoc-to-markdown.

Copyright © 2017 lmmfranco [email protected]