Skip to main content

To fetch app store reviews from publicly available RSS feeds

Project description

License PyPI - Python Version Conda Downloads Release Downloads Last commit

App store reviews reader

To fetch app store reviews from publicly available RSS feeds.

App store provide RSS feed as follows -

https://itunes.apple.com/{country}/rss/customerreviews/id={app_id}/xml

It provides feed in xml and json format but xml feed have more information like review_id and vote_count etc. Hence xml feed is used along with feedparser to parse feed.

Installation

Install via PyPi:

pip install app-store-reviews-reader

Install from master branch (if you want to try the latest features):

git clone https://github.com/lalitpagaria/app_store_reviews_reader
cd app_store_reviews_reader
pip install --editable .

How to use

AppStoreReviewsReader require two parameters app_id and country. app_id can be found at the end of the url of app in app store. For example -

https://apps.apple.com/us/app/xcode/id497799835

310633997 is the app_id for xcode and us is country.

Now you can run the following example -

import pprint
from datetime import datetime, timedelta

import pytz as pytz

from app_store.app_store_reviews_reader import AppStoreReviewsReader

# app_id, and country of xcode
reader = AppStoreReviewsReader(
    app_id="497799835",
    country="us"
)

# To fetch reviews entered in past 5 days
since_time = datetime.utcnow().astimezone(pytz.utc) + timedelta(days=-5)

# fetch_reviews will fetch all reviews if not parameters are passed.
# If `after` is passed then it will fetch all reviews after this date
# If `since_id` is passed then it will fetch all reviews after this review_id
reviews = reader.fetch_reviews(
    after=since_time
)

pp = pprint.PrettyPrinter(indent=4)
for review in reviews:
    pp.pprint(review.__dict__)

Review contains following information -

@dataclass
class Review:
    version: str
    rating: int
    id: int
    title: str
    content: str
    date: datetime
    author_link: str
    author_name: str
    country: str
    vote_count: Optional[int] = 0
    vote_sum: Optional[int] = 0

The output is given with UTF-8 charsets, if you are scraping non-english App Store set the environment to use UTF -

export LANG=en_US.UTF-8
export PYTHONIOENCODING=utf-8

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

app-store-reviews-reader-1.3.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

app_store_reviews_reader-1.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file app-store-reviews-reader-1.3.tar.gz.

File metadata

  • Download URL: app-store-reviews-reader-1.3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for app-store-reviews-reader-1.3.tar.gz
Algorithm Hash digest
SHA256 30aa441c1124462e9f5e3fb7a7c40806149e6d8caef9a14aba45cd9580e32a9d
MD5 268388756a39b70ff15e4025c81e2715
BLAKE2b-256 055fc359d05d76ed2cbde567e80c0050eeb97237423d312599b8294635e3aad8

See more details on using hashes here.

File details

Details for the file app_store_reviews_reader-1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for app_store_reviews_reader-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a450c95e83b9bab3063baeca7e12bacc01c129bcdd8044989b2c9bc2d8f19b02
MD5 43a3b593590aa696211698dc36f260e4
BLAKE2b-256 293a9e4ccdb13d82e455f31a05cb32053d9677940410a5354bb6088fc28df595

See more details on using hashes here.

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