___ _____ _ _____
/ _ \ / ___| | / ___|
/ /_\ \_ __ _ __ \ `--.| |_ ___ _ __ ___ \ `--. ___ _ __ __ _ _ __ ___ _ __
| _ | '_ \| '_ \ `--. \ __/ _ \| '__/ _ \ `--. \/ __| '__/ _` | '_ \ / _ \ '__|
| | | | |_) | |_) | /\__/ / || (_) | | | __/ /\__/ / (__| | | (_| | |_) | __/ |
\_| |_/ .__/| .__/ \____/ \__\___/|_| \___| \____/ \___|_| \__,_| .__/ \___|_|
| | | | | |
|_| |_| |_|
Quickstart
Install:
pip3 install apple-store-scraper
Scrape reviews for an app:
from apple_store_scraper import AppStore
from pprint import pprint
minecraft = AppStore(country="nz", app_name="minecraft")
minecraft.review(how_many=20)
pprint(minecraft.reviews)
pprint(minecraft.reviews_count)
Scrape reviews for a podcast:
from apple_store_scraper import Podcast
from pprint import pprint
sysk = Podcast(country="nz", app_name="stuff you should know")
sysk.review(how_many=20)
pprint(sysk.reviews)
pprint(sysk.reviews_count)
Extra Details
Let's continue from the code example used in Quickstart.
Instantiation
There are two required and one positional parameters:
country(required)- two-letter country code of ISO 3166-1 alpha-2 standard
app_name(required)- name of an iOS application to fetch reviews for
- also used by
search_id()method to search forapp_idinternally
app_id(positional)- can be passed directly
- or ignored to be obtained by
search_idmethod internally
Once instantiated, the object can be examined:
>>> minecraft
AppStore(country='nz', app_name='minecraft', app_id=479516143)
>>> print(app)
Country | nz
Name | minecraft
ID | 479516143
URL | https://apps.apple.com/nz/app/minecraft/id479516143
Review count | 0
Other optional parameters are:
log_format- passed directly to
logging.basicConfig(format=log_format) - default is
"%(asctime)s [%(levelname)s] %(name)s - %(message)s"
- passed directly to
log_level- passed directly to
logging.basicConfig(level=log_level) - default is
"INFO"
- passed directly to
log_interval- log is produced every 5 seconds (by default) as a "heartbeat" (useful for a long scraping session)
- default is
5
Fetching Review
The maximum number of reviews fetched per request is 20. To minimise the number of calls, the limit of 20 is hardcoded. This means the review() method will always grab more than the how_many argument supplied with an increment of 20.
>>> minecraft.review(how_many=33)
>>> minecraft.reviews_count
40
If how_many is not provided, review() will terminate after all reviews are fetched.
NOTE the review count seen on the landing page differs from the actual number of reviews fetched. This is simply because only some users who rated the app also leave reviews.
Optional Parameters
after- a
datetimeobject to filter older reviews
- a
sleep- an
intto specify seconds to sleep between each call
- an
Review Data
The fetched review data are loaded in memory and live inside reviews attribute as a list of dict.
>>> minecraft.reviews
[{'userName': 'someone', 'rating': 5, 'date': datetime.datetime(...
Each review dictionary has the following schema:
{
"date": datetime.datetime,
"isEdited": bool,
"rating": int,
"review": str,
"title": str,
"userName": str
}
Release files for apple-store-scraper 0.3.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| apple-store-scraper-0.3.6.tar.gz | 7.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| apple_store_scraper-0.3.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.4 kB
Release files / apple-store-scraper-0.3.6.tar.gz
| Download URL | apple-store-scraper-0.3.6.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29cd271aadc9f69c342ea6c6d1102b71a851aafc0f3abc8cd3bb7b798f4954c1
|
|
BLAKE2b-256 checksum How to use checksums |
46992fbcee7b3d9731f9a611fbd27658c08117af668205667cc92f802b854663
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|
Release files / apple_store_scraper-0.3.6-py3-none-any.whl
| Download URL | apple_store_scraper-0.3.6-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41f95e379ab9afdaf9961857ba7851b503ed857b06fbb8dc6aef4f275aa5a032
|
|
BLAKE2b-256 checksum How to use checksums |
4124613d716c62bfef2fcb34180b37fd77b7046fb61abcd8836b429c6d0b46c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|