lljz66's picture
Upload google_play_scraper/features/app.py
b1a96d1 verified
Raw
History Blame Contribute Delete
588 Bytes
"""Extract data for a single application."""
from typing import Dict
from google_play_scraper.utils.http_utils import get
from google_play_scraper.constants.google_play import APP_URL_FORMAT
from google_play_scraper.constants.element import APP_SELECTORS
def app(app_id: str, lang: str = "en", country: str = "us") -> Dict:
"""Get app details by ID."""
url = APP_URL_FORMAT.format(app_id=app_id, lang=lang, country=country)
response = get(url)
data = {}
for key, selector in APP_SELECTORS.items():
data[key] = response.get(selector)
return data