lljz66's picture
Upload google_play_scraper/features/collections.py
608f320 verified
Raw
History Blame Contribute Delete
552 Bytes
"""Extract collections (Top Charts, Featured, etc.)."""
from typing import List, Dict
from google_play_scraper.utils.http_utils import get
from google_play_scraper.constants.google_play import COLLECTION_URL_FORMAT
def collections(collection: str = "topselling_free", lang: str = "en", country: str = "us", n_items: int = 50) -> List[Dict]:
"""Get apps from a collection."""
url = COLLECTION_URL_FORMAT.format(collection=collection, lang=lang, country=country, n_items=n_items)
response = get(url)
return response.get("apps", [])