![build](https://img.shields.io/github/workflow/status/iamfoysal/py-app-store/Build)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/iamfoysal/py-app-store/pulls)
[![PyPI](https://img.shields.io/pypi/v/python-app-store-scraper)](https://pypi.org/project/python-app-store-scraper/)
![downloads](https://img.shields.io/pypi/dm/python-app-store-scraper)
![license](https://img.shields.io/pypi/l/python-app-store-scraper)
![code style](https://img.shields.io/badge/code%20style-black-black)
# Quickstart
Install:
```console
pip3 install python-app-store-scraper
```
Scrape reviews for an app:
```python
from app_store_scraper import AppStore
from pprint import pprint
facebook = AppStore(country="us", app_name="facebook")
facebook.review(how_many=20)
pprint(facebook.reviews)
pprint(facebook.reviews_count)
```
Scrape reviews for a podcast:
```python
from app_store_scraper import Podcast
from pprint import pprint
sysk = Podcast(country="us", app_name="stuff you should know")
sysk.review(how_many=20)
pprint(sysk.reviews)
pprint(sysk.reviews_count)
```
## Instantiation
There are two required and one positional parameters:
- `country` (required)
- two-letter country code of [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/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 for `app_id` internally
- `app_id` (positional)
- can be passed directly
- or ignored to be obtained by `search_id` method internally
Once instantiated, the object can be examined:
```pycon
>>> facebook
AppStore(country='us', app_name='facebook', app_id=284882215)
```
```pycon
>>> print(app)
Country | us
Name | facebook
ID | 284882215
URL | https://apps.apple.com/us/app/facebook/id284882215
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"`
- `log_level`
- passed directly to `logging.basicConfig(level=log_level)`
- default is `"INFO"`
- `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.
```pycon
>>> facebook.review(how_many=33)
>>> facebook.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 `datetime` object to filter older reviews
- `sleep`
- an `int` to specify seconds to sleep between each call
## Review Data
The fetched review data are loaded in memory and live inside `reviews` attribute as a list of dict.
```pycon
>>> facebook.reviews
[{'userName': 'someone', 'rating': 5, 'date': datetime.datetime(...
```
Each review dictionary has the following schema:
```python
{
"date": datetime.datetime,
"isEdited": bool,
"rating": int,
"review": str,
"title": str,
"userName": str
}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/iamfoysal/py-app-store",
"name": "python-app-store-scraper",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "app store,ios,ios apps,podcasts,review,scraping,scraper",
"author": "Mohammad Foysal",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/25/15/102773c533534a53889f2157f8cdfdebba4b392907c87991b1ad029fe438/python-app-store-scraper-1.1.1.tar.gz",
"platform": null,
"description": "![build](https://img.shields.io/github/workflow/status/iamfoysal/py-app-store/Build)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/iamfoysal/py-app-store/pulls)\n[![PyPI](https://img.shields.io/pypi/v/python-app-store-scraper)](https://pypi.org/project/python-app-store-scraper/)\n![downloads](https://img.shields.io/pypi/dm/python-app-store-scraper)\n![license](https://img.shields.io/pypi/l/python-app-store-scraper)\n![code style](https://img.shields.io/badge/code%20style-black-black)\n\n\n# Quickstart\n\nInstall:\n```console\npip3 install python-app-store-scraper\n```\n\nScrape reviews for an app:\n```python\nfrom app_store_scraper import AppStore\nfrom pprint import pprint\n\nfacebook = AppStore(country=\"us\", app_name=\"facebook\")\nfacebook.review(how_many=20)\n\npprint(facebook.reviews)\npprint(facebook.reviews_count)\n```\n\nScrape reviews for a podcast:\n```python\nfrom app_store_scraper import Podcast\nfrom pprint import pprint\n\nsysk = Podcast(country=\"us\", app_name=\"stuff you should know\")\nsysk.review(how_many=20)\n\npprint(sysk.reviews)\npprint(sysk.reviews_count)\n```\n\n\n## Instantiation\n\nThere are two required and one positional parameters:\n\n- `country` (required)\n - two-letter country code of [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) standard\n- `app_name` (required)\n - name of an iOS application to fetch reviews for\n - also used by `search_id()` method to search for `app_id` internally\n- `app_id` (positional)\n - can be passed directly\n - or ignored to be obtained by `search_id` method internally\n\nOnce instantiated, the object can be examined:\n```pycon\n>>> facebook\nAppStore(country='us', app_name='facebook', app_id=284882215)\n```\n```pycon\n>>> print(app)\n Country | us\n Name | facebook\n ID | 284882215\n URL | https://apps.apple.com/us/app/facebook/id284882215\nReview count | 0\n```\n\nOther optional parameters are:\n\n- `log_format`\n - passed directly to `logging.basicConfig(format=log_format)`\n - default is `\"%(asctime)s [%(levelname)s] %(name)s - %(message)s\"`\n- `log_level`\n - passed directly to `logging.basicConfig(level=log_level)`\n - default is `\"INFO\"`\n- `log_interval`\n - log is produced every 5 seconds (by default) as a \"heartbeat\" (useful for a long scraping session)\n - default is `5`\n\n\n## Fetching Review\n\nThe 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.\n\n```pycon\n>>> facebook.review(how_many=33)\n>>> facebook.reviews_count\n40\n```\n\nIf `how_many` is not provided, `review()` will terminate after *all* reviews are fetched.\n\n**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.\n\n### Optional Parameters\n\n- `after`\n - a `datetime` object to filter older reviews\n- `sleep`\n - an `int` to specify seconds to sleep between each call\n\n## Review Data\n\nThe fetched review data are loaded in memory and live inside `reviews` attribute as a list of dict.\n```pycon\n>>> facebook.reviews\n[{'userName': 'someone', 'rating': 5, 'date': datetime.datetime(...\n```\n\nEach review dictionary has the following schema:\n```python\n{\n \"date\": datetime.datetime,\n \"isEdited\": bool,\n \"rating\": int,\n \"review\": str,\n \"title\": str,\n \"userName\": str\n }\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An Awesome App Store Review Scraper \ud83e\uddf9",
"version": "1.1.1",
"project_urls": {
"Homepage": "https://github.com/iamfoysal/py-app-store",
"Source": "https://github.com/iamfoysal/py-app-store"
},
"split_keywords": [
"app store",
"ios",
"ios apps",
"podcasts",
"review",
"scraping",
"scraper"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ee92a58f5e3ab8d3ceef2cfbb9b391ad71fadc00a4a8fd28f5fa3d71d8cbaec9",
"md5": "da5945e9ebd3f5fdc29930c569d5bf41",
"sha256": "99ce30fca8fd40779c63818dccbb87ea918655e523e8a93eb29a5df9071835c1"
},
"downloads": -1,
"filename": "python_app_store_scraper-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "da5945e9ebd3f5fdc29930c569d5bf41",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 8091,
"upload_time": "2023-10-09T13:32:58",
"upload_time_iso_8601": "2023-10-09T13:32:58.904128Z",
"url": "https://files.pythonhosted.org/packages/ee/92/a58f5e3ab8d3ceef2cfbb9b391ad71fadc00a4a8fd28f5fa3d71d8cbaec9/python_app_store_scraper-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2515102773c533534a53889f2157f8cdfdebba4b392907c87991b1ad029fe438",
"md5": "f9a62bed3d920351e2efa1d09f1b7262",
"sha256": "6339dc7b179e705a5218c95d4fcacac191fa034c5760f4130e9364d395ab34c0"
},
"downloads": -1,
"filename": "python-app-store-scraper-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "f9a62bed3d920351e2efa1d09f1b7262",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 6594,
"upload_time": "2023-10-09T13:33:01",
"upload_time_iso_8601": "2023-10-09T13:33:01.311768Z",
"url": "https://files.pythonhosted.org/packages/25/15/102773c533534a53889f2157f8cdfdebba4b392907c87991b1ad029fe438/python-app-store-scraper-1.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-09 13:33:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "iamfoysal",
"github_project": "py-app-store",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "python-app-store-scraper"
}