app-store-scraper
app-store-scraper copied to clipboard
No results and default country code
- Operating System: Windows, WSL, AWS Lambda
- Node version: 12.x/14.x (AWS Lambda), 14.15.3 (Windows)
- app-play-scraper version: v0.16.3
Description:
This code returns 0 results when run in an AWS lambda function:
store.app({ id: 1424248915 })
This code returns correctly with 1 result when run in an AWS lambda function:
store.app({ id: 1424248915, country: 'US' })
Running both of the above scenarios in Windows works correctly and I can't reproduce the issue locally.
I have been able to locate the code which is causing my issue and here is the fix which works correctly on AWS lambda: https://github.com/cvanem/app-store-scraper/commit/81d6b31c41265618494ba000deecf503548566b2
The Apple Lookup API docs confirm that the country code should be uppercase, but I am hesitant to submit a PR as I don't understand the underlying cause of the issue.
It should also be noted that I regularly use this same code for many other app id's and do not have any issues using the current default country code while using AWS lambda.
The Apple lookup API also returns an "invalid country code" error if you specify an invalid country code, which I have not encountered in either of the above scenarios.
Perhaps someone else may have some insight as to what is going on?
For now, a working solution is to simply pass the uppercase country code as a parameter, but I believe the default country code should be changed to uppercase when querying via the lookup api as well.