Git Product home page Git Product logo

nintendo-switch-eshop's Introduction

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');
// TypeScript / Babel: import { getGamesAmerica, getGamesEurope, getGamesJapan } from 'nintendo-switch-eshop';

For calling functions with the correct parameters and syntax please refer to the documentation below:


Classes

EshopError

Functions

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

Fetches all games on american eshops

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

getGamesJapan()Promise<Array<GameJP>>

Fetches all games on japanese eShops

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

Fetches all games on european eShops

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

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

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

Gets all active eShops given a list of countries.

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.

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.

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.

getActiveShops()Promise<Array<EShop>>

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

parseGameCode(game, region)string | null

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

parseNSUID(game, region)string | null

Extracts NSUID information from the game object.

Typedefs

Category : Category
GameEU : GameEU
GameUS : GameUS
GameJP : GameJP
EShop : EShop
PriceResponse : PriceResponse
TitleData : TitleData
PriceError : PriceError
PriceData : PriceData
RequestOptions : RequestOptions
USRequestOptions : USRequestOptions
EURequestOptions : EURequestOptions

EshopError

Kind: global class

new EshopError(message)

Create an EshopError

Param Type Description
message string

The message the error should show

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

Category : Category

Kind: global typedef
Properties

Name Type
category Array<string>

GameEU : GameEU

Kind: global typedef
Properties

Name Type Description
age_rating_type string
age_rating_value string
copyright_s string
developer string
excerpt string
fs_id string
game_series_t string
gift_finder_carousel_image_url_s string
gift_finder_description_s string
gift_finder_detail_page_image_url_s string
gift_finder_detail_page_store_link_s string
gift_finder_wishlist_image_url_s string
image_url string
image_url_h2x1_s string
image_url_sq_s string
image_url_tm_s string
originally_for_t string
pretty_agerating_s string
pretty_date_s string
publisher string
sorting_title string
title string
type string
url string
add_on_content_b boolean
club_nintendo boolean
near_field_comm_b boolean
physical_version_b boolean
play_mode_handheld_mode_b boolean
play_mode_tabletop_mode_b boolean
play_mode_tv_mode_b boolean
change_date Date
date_from Date
priority Date
age_rating_sorting_i number
players_from number
players_to number
compatible_controller Array<string>
game_categories_txt Array<string>
game_category Array<string>
language_availability Array<string>
nsuid_txt Array<string>

Array containing the 14-digit game unique identifier

playable_on_txt Array<string>
product_code_txt Array<string>

Array containing the product code

system_names_txt Array<string>
system_type Array<string>
title_extras_txt Array<string>

GameUS : GameUS

Kind: global typedef
Properties

Name Type Description
game_code string

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

buyonline boolean
front_box_art string
eshop_price number

USA eShop price (in dollars)

nsuid string

14-digit game unique identifier

video_link string
number_of_players string
ca_price number

Canada eShop price (in canadian dollars)

id string
title string
system string

Gaming platform

free_to_start boolean
digitaldownload boolean
release_date string
categories Category
slug string

Game URL name

buyitnow boolean

GameJP : GameJP

Kind: global typedef
Properties

Name Type Description
LinkURL Array<string>

A single item array containing the game url

LinkTarget Array<string>
ScreenshotImgURL Array<string>

A single item array containing the game thumbnail url

ScreenshotImgURLComing Array<string>
TitleName Array<string>

A single item array containing the game title

TitleNameRuby Array<string>
SoftType Array<string>
SalesDate Array<string>
SalesDateStr Array<string>
MakerName Array<string>
Hard Array<string>
Memo Array<string>

EShop : EShop

Kind: global typedef
Properties

Name Type
code string
country string
currency string
region Region

PriceResponse : PriceResponse

Kind: global typedef
Properties

Name Type
error PriceError
personalized boolean
country string
prices Array<TitleData>

TitleData : TitleData

Kind: global typedef
Properties

Name Type
title_id number
sales_status string
regular_price PriceData
[discount_price] PriceData

PriceError : PriceError

Kind: global typedef
Properties

Name Type
code string
message string

PriceData : PriceData

Kind: global typedef
Properties

Name Type
amount string
currency string
raw_value string
[start_datetime] string
[end_datetime] string

RequestOptions : RequestOptions

Kind: global typedef
Properties

Name Type Description
limit number

Game count limit (Can only be lower than default page size)

USRequestOptions : USRequestOptions

Kind: global typedef
Extends: RequestOptions
Properties

Name Type Description
shop 'retail' | 'ncom' | 'all'

Either 'retail' / 'ncom' / 'all'. Defaults to 'ncom'.

EURequestOptions : EURequestOptions

Kind: global typedef
Extends: RequestOptions
Properties

Name Type Description
locale string

Game information locale. (EU Only)


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

Copyright © 2017 lmmfranco [email protected]

nintendo-switch-eshop's People

Contributors

favna avatar lmmfranco avatar revolter avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.