[Python] Using Python and the Google Play API, need to: download information about the top 10...

Discussão em 'Python' iniciado por Stack, Julho 6, 2025.

  1. Stack

    Stack Membro Participativo

    The task suggests using the Google Play API, but Google, if I understand correctly, does not provide the ability to download information (the task asks for a rating, number of downloads) about third-party offers. I tried to use SerpAPI, for example, but it did not give any adequate results. Can someone suggest other options for completing the task?

    from serpapi import GoogleSearch
    import os
    import json
    from dotenv import load_dotenv

    load_dotenv()

    params = {
    "api_key": os.getenv("API_KEY"),
    "engine": "google_play", # Changed from "google_play_product"
    "store": "apps",
    "gl": "ua",
    "hl": "en",
    "category": "SOCIAL", # Changed from "apps_category"
    "charts": "top_free",
    "num": 10
    }

    search = GoogleSearch(params)
    result = search.get_dict()

    # Pretty print the results
    print(json.dumps(result, indent=2))

    # If you want to extract just the app list:
    if 'organic_results' in result:
    print("\nTop Free Social Apps:")
    for i, app in enumerate(result['organic_results'], 1):
    print(f"{i}. {app.get('title', 'N/A')} - {app.get('rating', 'N/A')} stars")
    print(f" Developer: {app.get('developer', 'N/A')}")
    print(f" Link: {app.get('link', 'N/A')}")
    print()

    Continue reading...

Compartilhe esta Página