Skip to main content

Apple App Store Scraper written in Python

Project description

appstorescraperpy

Apple App Store Scraper written in python

Apple App Store Scraper

This is based on cowboy-bebug's app-store-scraper (now deprecated) as this is the only project I've seen that is able to retrieve all the App Store reviews. The project is now deprecated and Apple has changed some of the ways to retrieve the data compared to cowboy-bebug's method.

I initially used this on an Azure Function and I did not implement custom classes and let the caller parse the JSON data themselves. This iteration I included classes to handle the data.

To install

python3 -m pip install appstorescraperpy

Usage

Basic usage

To get the app details, ratings, and reviews with this library, you must use the app ID. This can be seen in the URL of the app page.

For example, Facebook's URL in the App Store is:

https://apps.apple.com/us/app/facebook/id284882215

The app ID is

284882215

Sample code

import appstorescraper

# Let's use Facebook's app ID '284882215'
# by default get_app will use country='us'
# you can change the country. just follow ISO 3166 format for the 
# country codes 
app = appstorescraper.get_app(app_id='284882215',country='us')


# you can get the raw data from the app store by doing
print(app.data)

For ratings data

# To get the average ratings
print(app.ratings.average)

# To get each star count you can either
one_star = app.ratings.list[0]
two_star = app.ratings.list[1]
three_star = app.ratings.list[2]
four_star = app.ratings.list[3]
five_star = app.ratings.list[4]

# or you can do
app.ratings.one_star
app.ratings.two_star
app.ratings.three_star
app.ratings.four_star
app.ratings.five_star

# to get the raw data from the App Store
print(app.ratings.data)

Sample ratings data

{
    "ariaLabelForRatings": "4.9 stars",
    "ratingCount": 318959,
    "ratingCountList": [
        3925,
        928,
        2700,
        10776,
        300630
    ],
    "value": 4.9
}

For reviews

Reviews are sorted by the most recent review.

Just a note: the App Store puts out a maximum of 20 reviews per call. This library takes care of that limitation. You can still try to get all reviews with this library, but I had cases where I got blocked by the App Store for calling the API too much

There are two ways to get reviews:

app.reviews

# By using app.reviews

# This is an iterator so you can use next() 
print(next(app.reviews))

# or use a for loop
for review in app.reviews:
    print(review)

# you can also get the nth review
# note that this will still get all the reviews before it (1-9 will still be loaded and stored)
print(app.reviews[10])

app.get_reviews()

# By using app.get_reviews()
# This provides more control

# arguments

# count: how many reviews to retrieve, sorted by the most recent review
# offset: which review index to start, useful when you want to get older reviews so you don't have to load other reviews 

# usage
reviews = app.get_reviews(count=100,offset=0)

The next ones did not get tested thoroughly so use with caution

get_countries_with_reviews

This gives you a list of countries which has at least one retrievable review. This is an expensive all as it goes through all countries and get one review for checking

It returns a dictionary list with data

{
    "alpha_2": "{country_code}",
    "name": "{country_name}"
}

Sample usage

from appstorescraper.core import AppleScraper

for country in AppleScraper.get_countries_with_reviews(app_id,sleep=1):
    print(country)

check_review_availability

This checks if a given country code has a retrievable review. Note that is still possible for a country to have a rating but no review

Sample usage

from appstorescraper.core import AppleScraper

app_id = '284882215'
print(AppleScraper.check_review_availability(app_id, 'ph'))

Sample result

{
    "has_reviews": true,
    "status_code": 200,
    "message": ""
}

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

appstorescraperpy-0.1.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

appstorescraperpy-0.1.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file appstorescraperpy-0.1.1.tar.gz.

File metadata

  • Download URL: appstorescraperpy-0.1.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for appstorescraperpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 60773f33f5bb8fc4f6f6295ed598794fb0e902f39eacd57b6b09cd2cdc914d04
MD5 96020161223b9d5e95b2a3b5a7aeb1b1
BLAKE2b-256 1bfca39daff3d126354bd624b08b2726632f5a6e0358d629bbe66dde4f07c96c

See more details on using hashes here.

Provenance

The following attestation bundles were made for appstorescraperpy-0.1.1.tar.gz:

Publisher: publish.yml on SpeakingStapler/appstorescraperpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file appstorescraperpy-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for appstorescraperpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 077d7858d586f62b4de4c7405f176bbbd17924c71e156e8526e1ed9e6f0fbc3c
MD5 2c9394fee2ff2fdcfab5da7da72562e0
BLAKE2b-256 1aee5f2d873e314bad7b990c46f878ca788b691c27de30a81602eaa8c17e2926

See more details on using hashes here.

Provenance

The following attestation bundles were made for appstorescraperpy-0.1.1-py3-none-any.whl:

Publisher: publish.yml on SpeakingStapler/appstorescraperpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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