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.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: app-store-reviews-reader-1.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.13

File hashes

Hashes for app-store-reviews-reader-1.2.tar.gz
Algorithm Hash digest
SHA256 8c6542ce0a6eae62fafd00c0ba6af5950eae64723e82cee5ce67f07f945a8755
MD5 4d7345aa131d48b8234c82228ada19e8
BLAKE2b-256 53bfaff19b206ae807d0350bad7f87dab6710b313338ac7927a5ae8c3f254951

See more details on using hashes here.

File details

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

File metadata

  • Download URL: app_store_reviews_reader-1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.13

File hashes

Hashes for app_store_reviews_reader-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6a4c74455520f69aa274442de7698715a653e6d74cdebbfefb4b0f35f2651287
MD5 549e2a5b8d75cfcf2fc451d6673ff671
BLAKE2b-256 1d93a49a00750bc6fbf872afa826617e3ff561977a0db0b9b9eb7a3643606653

See more details on using hashes here.

Supported by

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