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.2.tar.gz (11.5 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.2-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for appstorescraperpy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 13e80d7a0dff7969859a5a18c2c7b01a081b35a7a80b5ed2cd0fb5ab592fbd97
MD5 127157a2fca45f6de9c2280e99a6af72
BLAKE2b-256 69ad444eba702ef2284ebec780c0b26c05ea8bbd494f40b932ac3efca1ec243c

See more details on using hashes here.

Provenance

The following attestation bundles were made for appstorescraperpy-0.1.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for appstorescraperpy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 98a8d25721ab0620a5c496a89a6835b771273b2629c0d06a8d9549e5cf3b5dc5
MD5 c70cbf9ad0ff9b0b519ecc4b761bfd3d
BLAKE2b-256 76dfdcb71aaf9ef4dae31ad5446b06d0af9de8f6da46328dab0f2510129deece

See more details on using hashes here.

Provenance

The following attestation bundles were made for appstorescraperpy-0.1.2-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