-
-
Notifications
You must be signed in to change notification settings - Fork 82
[API] Stopped getting new updates since last month from getGamesAmerica #280
Comments
I think I may have found the problem, when comparing the request made by this library to the request that shows up in the network tab under devtools when searching on https://nintendo.com I noticed they use a different indexName as well as a different Algolia Search API key. I'll be updating these things tomorrow and see what I get from your quest afterwards. I can already say though that trying a simple query with the old indexName and key didn't give me "GONNER 2" (a game released 4 days ago: https://www.youtube.com/watch?v=S3f72l_MIG0) while searching with the new key does. |
Well I've doing some further digging and it's not necessarily what I thought in my previous comment. There are (at least) 3 indices, Honestly at this point I just don't know anymore. It's impossibly hard to fetch all games, while it's super easy to fetch one or some games (by adding a I might just have to remove |
I took a look at the Algolia calls today that Nintendo is making on the US eshop to try to understand it better and I came up with a request that I think does a good job of getting 99+% of the games. Apparently 1000 is the default limit for amount of records that Algolia will ever return in a query, which seems like is set on db creation. So that is always gonna be limited. But looking at the way the eshop was using Algolia and indexName made it seem like we can search for games in a single query from both ends. Specifically with these two indexNames, ncom_game_en_us_title_asc and ncom_game_en_us_title_des, we can make two requests to get all games by ascending title and all games by descending title, giving an upper limit of 2000 games possible to retrieve in a single query. If we use the ESRB facetFilters for Everyone (1850 nbHits), E10+ (1125 nbHits), Teen (nbHits 1312), and Mature (468 nbHits), I think we can guarantee retrieving all games in each facetFilter if we make a call for the 1000 games by title in ascending order and the 1000 games by title in descending order (culling the duplicates from overlapping). Plus one extra call for the "Coming Soon" Availability facet for completion (since this probably contains most or all of the games without an ESRB rating). So, The request pretty much boils down to the below parameters (hitsPerPage is just at 1000 for now):
The compiled response:
4619 is pretty close to the 4778 results on the eshop website and from spot checking, some of these games are straight up duplicated in the Algolia call. You can even see duplicated games scrolling down the eshop website. Anyway, I just wanted to share what I was up to today before I go to bed and hopefully someone finds something useful here. Let me know what you think. |
If you're still interested in getting all games this way, could you make a pull request with these changes? |
@bvanzile I have just release v4.0.0 to NPM which includes your fix, as well as a function to get games based on a query as I mentioned in an earlier comment. |
Thanks for the invite to contribute. Happy that I was helpful. |
Hey all,
I've noticed that my getGamesAmerica calls have stopped returning any lastModified values after Sept 14, 2020 (unix timestamp 1600099408951 specifically).
For example, the code below gets all games from getGamesAmerica and pulls out the most recent lastModified value and prints it.
For me, that returns:
I see 24 games with this timestamp for lastModified. Anyone run into an issue like this? I've updated to the latest and, in the process of trying to figure this out, lost some custom changes that was returning ~3800 games, but the issue remains. The 2858 on a fresh install is kind of problematic since the eshop shows 4792 for me, but that's another issue.
Anyone experiencing similar? What does the above code give you guys?
Regards,
Bryan
The text was updated successfully, but these errors were encountered: