Skip to main content

Scrapping tools for Nintendo games and prices on NA, EU and JP.

Project description

nintendeals

"nintendeals was a bot, he loved learning and deals on nintendo's eshop." LetsFunHans 💬️

Version Build Status Quality Gate Status CodeCoverage


Named after the my old reddit bot, nintendeals is now a library with all the scrappers and integrations of nintendo services that I used.

Terminology

Before getting into any details first we need too get into the same page with a few terms:

Region

Here we game three regions NA, EU and JP each one corresponding to Nintendo of America (NoA), Nintendo of Europe (NoE) and Nintendo of Japan (NoJ). Each of these regions have set of countries they are "in charge of":

NoA:

  • Canada
  • Mexico
  • United Stated

NoE:

  • Every country in the European Union
  • Australia
  • New Zealand
  • South Africa

NoJ:

  • Japan

nsuid

An nsuid is a 14 digit long string which Nintendo uses to identify games on each region. Taking Breath of the Wild as an example, we have these 3 nsuids for it (one per region):

  • "70010000000025" (NA)
  • "70010000000023" (EU)
  • "70010000000026" (JP)

Product Code

The product code is another type of ID that Nintendo uses, it usually is a 8/9 character long string. Taking Splatoon 2 as an example, we have these 3 product codes for it (one per region):

  • "HACPAAB6B" (NA)
  • "HACPAAB6C" (EU)
  • "HACAAB6A" (JP)

The difference with the nsuid is that (as you can see bolded) the product code has a constant between all regions, and this is what I decided to call unique_id and it is what we can you to join a game across all regions.

You can also see this code in the front of your Nintendo Switch cartridge.

Services

This library provides three types of services: Info, Listing and Pricing. Each region has a different version of Info and Listing, but Pricing is the same for all as it only requires a country and an nsuid.

Listing

Even thought there are different version for each region, they all work in the same way. Given a supported platform (for this library) they will retrieve a list games in the selected region (in the form of an iterator).

from nintendeals import noa

for game in noa.list_games("Nintendo Switch"):
    print(game.title, "/", game.nsuid)
>> ARMS / 70010000000392
>> Astro Duel Deluxe / 70010000000301
>> Axiom Verge / 70010000000821
>> Azure Striker GUNVOLT: STRIKER PACK / 70010000000645
>> Beach Buggy Racing / 70010000000721
from nintendeals import noe

for game in noe.list_games("Nintendo Switch"):
    print(game.title, "/", game.nsuid)
>> I and Me / 70010000000314
>> In Between / 70010000009184
>> Ghost 1.0 / 70010000001386
>> Resident Evil 0 / 70010000012848
>> 64.0 / 70010000020867

Info

Once you have the nsuid of the game that you want, you can call the game_info service. And again, each region has their own version but they all work the same, but keep in mind that you need to use the correct nsuid for each region. Coming back to the nsuid of Breath of the Wild as an example:

from nintendeals import noa

game = noa.game_info("70010000000025")
print(game.title)
print(game.unique_id)
print(game.release_date)
print(game.players)
print(game.dlc)
The Legend of Zelda™: Breath of the Wild
AAAA
2017-03-03 00:00:00
1
True
from nintendeals import noe

game = noe.game_info("70010000000023")
print(game.title)
print(game.unique_id)
print(game.release_date)
print(game.players)
print(game.dlc)
>> The Legend of Zelda: Breath of the Wild
>> AAAA
>> 2017-03-03 00:00:00
>> 1
>> True

Keep in mind that each call to these services will trigger a call to a nintendo eshop website.

Pricing

Given a country code (using the alpha-2 iso standard) and a game or list of games this service will fetch the current pricing of that/those games for that country. Since this service uses nsuids to fetch the price, make sure that the games that you provide have the regional nsuid that matches the country that you want. For example, only the nsuid for the American region will be able to fetch you the prices of Canada, Mexico and United Stated but not for Japan or Spain.

from nintendeals import noe
from nintendeals.api import prices

game = noe.game_info("70010000007705")
print(game.title)
print()

price = prices.get_price("CZ", game)  # Czech Republic
print(price.currency)
print(price.value)
print(price.sale_discount, "%")
print(price.sale_value)
print(price.sale_start)
print(price.sale_end)

# Alternatively you can do this for the same effect:
price = game.price("CZ") 
Dead Cells

CZK
625.0
80 %
500.0
2020-04-19 22:00:00
2020-05-03 21:59:59

To reduce the amount of call to the prices api, you can also use the get_prices service that works in a similar way but it expects a list of games instead of only one:

from nintendeals import noa
from nintendeals.api import prices

botw = noa.game_info("70010000000025")
print(botw.title)
celeste = noa.game_info("70010000006442")
print(celeste.title)

prices = prices.get_prices("US", [botw, celeste])

for nsuid, price in prices:
    print(nsuid)
    print(price.value)
    print(price.sale_value)
    print()
The Legend of Zelda™: Breath of the Wild
Celeste

70010000000025
59.99
None

70010000006442
19.99
4.99

To Do list

  • Improve exception management for unexisting games or prices
  • Improve logging usage to indicate api calls or eshop websites requests
  • Keep working on documentation
  • Improve performance
  • Lazy attributes on Game class to reduce scrapping.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nintendeals-1.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

nintendeals-1.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file nintendeals-1.0.tar.gz.

File metadata

  • Download URL: nintendeals-1.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0

File hashes

Hashes for nintendeals-1.0.tar.gz
Algorithm Hash digest
SHA256 6627f93a71e0375c1186523028cba5d14759a4c3a7a67a0bf59b139e3925b8cc
MD5 ee634f1e2d754dcaf3c1c5a8faeea309
BLAKE2b-256 ce103d1c4b812e7f298fca110c25590a05d84e216e3af116dd8b8a22475b3171

See more details on using hashes here.

File details

Details for the file nintendeals-1.0-py3-none-any.whl.

File metadata

  • Download URL: nintendeals-1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0

File hashes

Hashes for nintendeals-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8cf0d87bdf3c0e32ad984b78a66151df3ae5e92ef55716b19822109f3db3182
MD5 c67f95f1b90157ef693891d5d7143fa1
BLAKE2b-256 635c165bbc5956036baabbfe24c81117148d60a7afdb3d8a2270ebef87111e5d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page