app-store-scraper


Nameapp-store-scraper JSON
Version 0.3.5 PyPI version JSON
download
home_pagehttps://github.com/cowboy-bebug/app-store-scraper
SummarySingle API ☝ App Store Review Scraper 🧹
upload_time2020-11-12 08:23:02
maintainer
docs_urlNone
authorEric Lim
requires_python>=3.6
licenseMIT
keywords app store ios ios apps podcasts review scraping scraper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![build](https://img.shields.io/github/workflow/status/cowboy-bebug/app-store-scraper/Build)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/cowboy-bebug/app-store-scraper/pulls)
[![PyPI](https://img.shields.io/pypi/v/app-store-scraper)](https://pypi.org/project/app-store-scraper/)
![downloads](https://img.shields.io/pypi/dm/app-store-scraper)
![license](https://img.shields.io/pypi/l/app-store-scraper)
![code style](https://img.shields.io/badge/code%20style-black-black)

```
   ___                _____ _                   _____
  / _ \              /  ___| |                 /  ___|
 / /_\ \_ __  _ __   \ `--.| |_ ___  _ __ ___  \ `--.  ___ _ __ __ _ _ __   ___ _ __
 |  _  | '_ \| '_ \   `--. \ __/ _ \| '__/ _ \  `--. \/ __| '__/ _` | '_ \ / _ \ '__|
 | | | | |_) | |_) | /\__/ / || (_) | | |  __/ /\__/ / (__| | | (_| | |_) |  __/ |
 \_| |_/ .__/| .__/  \____/ \__\___/|_|  \___| \____/ \___|_|  \__,_| .__/ \___|_|
       | |   | |                                                    | |
       |_|   |_|                                                    |_|
```

# Quickstart

Install:
```console
pip3 install app-store-scraper
```

Scrape reviews for an app:
```python
from app_store_scraper import AppStore
from pprint import pprint

minecraft = AppStore(country="nz", app_name="minecraft")
minecraft.review(how_many=20)

pprint(minecraft.reviews)
pprint(minecraft.reviews_count)
```

Scrape reviews for a podcast:
```python
from app_store_scraper import Podcast
from pprint import pprint

sysk = Podcast(country="nz", app_name="stuff you should know")
sysk.review(how_many=20)

pprint(sysk.reviews)
pprint(sysk.reviews_count)
```

# Extra Details

Let's continue from the code example used in [Quickstart](#quickstart).


## 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
>>> minecraft
AppStore(country='nz', app_name='minecraft', app_id=479516143)
```
```pycon
>>> print(app)
     Country | nz
        Name | minecraft
          ID | 479516143
         URL | https://apps.apple.com/nz/app/minecraft/id479516143
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
>>> minecraft.review(how_many=33)
>>> minecraft.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
>>> minecraft.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/cowboy-bebug/app-store-scraper",
    "name": "app-store-scraper",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "app store,ios,ios apps,podcasts,review,scraping,scraper",
    "author": "Eric Lim",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/ca/be/c72a0a7b26c384f9b7126a1dea7987aeefd19673fe8476d93fdd8ec83755/app-store-scraper-0.3.5.tar.gz",
    "platform": "",
    "description": "![build](https://img.shields.io/github/workflow/status/cowboy-bebug/app-store-scraper/Build)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/cowboy-bebug/app-store-scraper/pulls)\n[![PyPI](https://img.shields.io/pypi/v/app-store-scraper)](https://pypi.org/project/app-store-scraper/)\n![downloads](https://img.shields.io/pypi/dm/app-store-scraper)\n![license](https://img.shields.io/pypi/l/app-store-scraper)\n![code style](https://img.shields.io/badge/code%20style-black-black)\n\n```\n   ___                _____ _                   _____\n  / _ \\              /  ___| |                 /  ___|\n / /_\\ \\_ __  _ __   \\ `--.| |_ ___  _ __ ___  \\ `--.  ___ _ __ __ _ _ __   ___ _ __\n |  _  | '_ \\| '_ \\   `--. \\ __/ _ \\| '__/ _ \\  `--. \\/ __| '__/ _` | '_ \\ / _ \\ '__|\n | | | | |_) | |_) | /\\__/ / || (_) | | |  __/ /\\__/ / (__| | | (_| | |_) |  __/ |\n \\_| |_/ .__/| .__/  \\____/ \\__\\___/|_|  \\___| \\____/ \\___|_|  \\__,_| .__/ \\___|_|\n       | |   | |                                                    | |\n       |_|   |_|                                                    |_|\n```\n\n# Quickstart\n\nInstall:\n```console\npip3 install app-store-scraper\n```\n\nScrape reviews for an app:\n```python\nfrom app_store_scraper import AppStore\nfrom pprint import pprint\n\nminecraft = AppStore(country=\"nz\", app_name=\"minecraft\")\nminecraft.review(how_many=20)\n\npprint(minecraft.reviews)\npprint(minecraft.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=\"nz\", app_name=\"stuff you should know\")\nsysk.review(how_many=20)\n\npprint(sysk.reviews)\npprint(sysk.reviews_count)\n```\n\n# Extra Details\n\nLet's continue from the code example used in [Quickstart](#quickstart).\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>>> minecraft\nAppStore(country='nz', app_name='minecraft', app_id=479516143)\n```\n```pycon\n>>> print(app)\n     Country | nz\n        Name | minecraft\n          ID | 479516143\n         URL | https://apps.apple.com/nz/app/minecraft/id479516143\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>>> minecraft.review(how_many=33)\n>>> minecraft.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>>> minecraft.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\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Single API \u261d App Store Review Scraper \ud83e\uddf9",
    "version": "0.3.5",
    "project_urls": {
        "Homepage": "https://github.com/cowboy-bebug/app-store-scraper",
        "Source": "https://github.com/cowboy-bebug/app-store-scraper"
    },
    "split_keywords": [
        "app store",
        "ios",
        "ios apps",
        "podcasts",
        "review",
        "scraping",
        "scraper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ba2e35eb1628b550d5e936f0a9171c1e3ea978288849693d3c6daab9e74cbab9",
                "md5": "6b7f5f484a41d3171908d4dd92216125",
                "sha256": "36d926909672d9645ae21c5bf3e26c50509b16992723b13b34f09565e9dc3822"
            },
            "downloads": -1,
            "filename": "app_store_scraper-0.3.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6b7f5f484a41d3171908d4dd92216125",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 8275,
            "upload_time": "2020-11-12T08:23:01",
            "upload_time_iso_8601": "2020-11-12T08:23:01.328969Z",
            "url": "https://files.pythonhosted.org/packages/ba/2e/35eb1628b550d5e936f0a9171c1e3ea978288849693d3c6daab9e74cbab9/app_store_scraper-0.3.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cabec72a0a7b26c384f9b7126a1dea7987aeefd19673fe8476d93fdd8ec83755",
                "md5": "1057370ac2da0986fc35d0774c30e646",
                "sha256": "1ad400af5581cdd0b443ba30cc9a985f26f86981a8745fe7e460e09d4cd8832a"
            },
            "downloads": -1,
            "filename": "app-store-scraper-0.3.5.tar.gz",
            "has_sig": false,
            "md5_digest": "1057370ac2da0986fc35d0774c30e646",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 7149,
            "upload_time": "2020-11-12T08:23:02",
            "upload_time_iso_8601": "2020-11-12T08:23:02.549791Z",
            "url": "https://files.pythonhosted.org/packages/ca/be/c72a0a7b26c384f9b7126a1dea7987aeefd19673fe8476d93fdd8ec83755/app-store-scraper-0.3.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-11-12 08:23:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cowboy-bebug",
    "github_project": "app-store-scraper",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "app-store-scraper"
}
        
Elapsed time: 0.24421s