Используя Python и Google Play API, необходимо: загрузить информацию о 10 лучших приложениях из категории социальных сетPython

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Используя Python и Google Play API, необходимо: загрузить информацию о 10 лучших приложениях из категории социальных сет

Сообщение Anonymous »

Задача предполагает использование API Google Play, но Google, если я правильно понимаю, не дает возможности загружать информацию (задача просит рейтинг, количество загрузок) о предложениях сторонних. Я пытался использовать, например, Serpapi, но он не дал никаких адекватных результатов. Может ли кто -нибудь предложить другие варианты выполнения задачи? < /P>

Код: Выделить всё

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()
Result:

{ "search_metadata": {
"id": "686a5711f357f6800a2e0e43",
"status": "Success",
"json_endpoint": "https://serpapi.com/searches/764e66789e ... e0e43.json",
"created_at": "2025-07-06 10:59:29 UTC",
"processed_at": "2025-07-06 10:59:29 UTC",
"google_play_url": "https://play.google.com/store/apps?hl=en&gl=ua",
"raw_html_file": "https://serpapi.com/searches/764e66789e ... e0e43.html",
"total_time_taken": 0.37 }, "search_parameters": {
"engine": "google_play",
"hl": "en",
"gl": "ua",
"store": "apps" }, "chart_options": [
{
"text": "Top free",
"value": "topselling_free"
},
{
"text": "Top grossing",
"value": "topgrossing"
},
{
"text": "Top paid",
"value": "topselling_paid"
} ], "items_highlight": [
[
{
"title": "TikTok",
"subtitle": "Follow Dimitri Vegas on TikTok",
"link": "https://play.google.com/store/apps/deta ... .musically",
"product_id": "com.zhiliaoapp.musically",
"serpapi_link": "https://serpapi.com/search.json?engine= ... store=apps",
"thumbnail": "https://play-lh.googleusercontent.com/L ... eXs=s64-rw"
},
{
"title": "Music Player - Audio Player",
"subtitle": "Music style challenge: share your favorite music",
"link": "https://play.google.com/store/apps/deta ... usicplayer",
"product_id": "media.player.video.musicplayer",
"serpapi_link": "https://serpapi.com/search.json?engine= ... store=apps",
"thumbnail": "https://play-lh.googleusercontent.com/8 ... JUc=s64-rw"
},
{
"title": "AI Chat\u30fbAsk Chatbot Assistant",
"subtitle": "Make Every Photo Shine \u2013 Instantly Enhance with Ai Magic!",
"link": "https://play.google.com/store/apps/deta ... tant.robot",
"product_id": "com.mlink.ai.chat.assistant.robot",
"serpapi_link": "https://serpapi.com/search.json?engine= ... store=apps",
"thumbnail": "https://play-lh.googleusercontent.com/E ... UnM=s64-rw"
},
{
"title": "Music Player",
"subtitle": "Real Time Lyrics, Seamless Sing Along",
"link": "https://play.google.com/store/apps/deta ... usicplayer",
"product_id": "media.audioplayer.musicplayer",
"serpapi_link": "https://serpapi.com/search.json?engine= ... store=apps",
"thumbnail": "https://play-lh.googleusercontent.com/1 ... IvM=s64-rw"
},
{
"title": "AI Video Enhancer - Utool",
"subtitle": "New Kawaii Cartoon Style Effect You\u2019ll Love",
"link": "https://play.google.com/store/apps/deta ... r.aieffect",
"product_id": "videoeditor.videomaker.aieffect",
"serpapi_link": "https://serpapi.com/search.json?engine= ... store=apps",
"thumbnail": "https://play-lh.googleusercontent.com/8 ... ty0=s64-rw"
},
{
"title": "PREQUEL AI Filter Photo Editor",
"subtitle": "Unique Vintage Vibe with "Denim"",
"link": "https://play.google.com/store/apps/deta ... requel.app",
"product_id": "com.prequel.app",
"serpapi_link": "https://serpapi.com/search.json?engine= ... store=apps",
"thumbnail": "https://play-lh.googleusercontent.com/8 ... jg4=s64-rw"
},
{
"title": "Gallery - Photo Gallery, Vault",
"subtitle": "Photo Gallery Vault: Smart and powerful gallery to help you easily manage.",
"link": "https://play.google.com/store/apps/deta ... ry.android",
"product_id": "com.ai.gallery.android",
"serpapi_link": "https://serpapi.com/search.json?engine= ... store=apps",
"thumbnail": "https://play-lh.googleusercontent.com/D ... n3A=s64-rw"
},
{
"title": "Yousician: Learn Guitar & Bass",
"subtitle": "Discover Artist Songbooks",
"link": "https://play.google.com/store/apps/deta ... .yousician",
"product_id": "com.yousician.yousician",
"serpapi_link": "https://serpapi.com/search.json?engine= ... store=apps",
"thumbnail": "https://play-lh.googleusercontent.com/r ... j0w=s64-rw"
},
{
"title": "AI Chatbot - Nova",
"subtitle": "Nova\u2019s Smarter Web Search Tool for Summer Vacation Inspiration",
"link": "https://play.google.com/store/apps/deta ... eup.chatai",
"product_id": "com.scaleup.chatai",
"serpapi_link": "https://serpapi.com/search.json?engine= ... store=apps",
"thumbnail": "https://play-lh.googleusercontent.com/x ... Ri8=s64-rw"
},
{
"title": "AI Photo Editor - AI Morph",
"subtitle": "Flip the Anime Switch",
"link": "https://play.google.com/store/apps/deta ... ter.snapai",
"product_id": "photoeditor.aiart.animefilter.snapai",
"serpapi_link": "https://serpapi.com/search.json?engine= ... store=apps",
"thumbnail": "https://play-lh.googleusercontent.com/m ... m-w=s64-rw"
}
] ], "organic_results": [
{
"title": "Popular apps",
"serpapi_section_pagination": {
"next": "https://serpapi.com/search.json?engine= ... store=apps",
"section_page_token": "YmASFwoCCAEQOxoLQVBQTElDQVRJT04qAggBSkAKPggYEKGFuP8GEJ6u3LIJEMaOupMDEPfxqZsNEIKViccJEPL9_-APELq-8ZQKEJLI_J0CEMDPybsJENC3pJcPUBT4AQA"
},
"items": [
{
"title": "Temu: Shop Like a Billionaire",
"link": "https://play.google.com/store/apps/deta ... ation.temu",
"product_id": "com.einnovation.temu",
"serpapi_link": "https://serpapi.com/search.json?engine= ... store=apps",
"rating": 4.3,
"author": "Temu",
"category": "Shopping",
"downloads": "500,000,000+",
"thumbnail": "https://play-lh.googleusercontent.com/N ... EI=s256-rw",
"description": "Shop on Temu for exclusive offers.\n\nNo matter what you're looking for, Temu has you covered, including
fashion, home decor, handmade crafts, beauty & cosmetics, clothing,
shoes, and more.\n\nDownload Temu today and enjoy incredible deals
daily.\n\nWIDE SELECTION\nDiscover thousands of new products and
shops.\n\nCONVENIENCE\nFast and secure checkout.\nFree shipping &
returns within 90 days.\n*Other conditions may apply\n\nVisit temu.com
or follow us on:\nInstagram: https://www.instagram.com/temu/\nTikTok:
https://www.tiktok.com/@temu\nFacebook:
https://www.facebook.com/shoptemu\nYoutube:
https://www.youtube.com/@temu"
},
{
"title": "Discord - Talk, Play, Hang Out",
"link": "https://play.google.com/store/apps/deta ... om.discord",
"product_id": "com.discord",
"serpapi_link": "https://serpapi.com/search.json?engine= ... store=apps",
"rating": 4.1,
"author": "Discord Inc.",
"category": "Communication",
"downloads": "500,000,000+",
"video": "https://play.google.com/video/lava/web/ ... embed=play",
"thumbnail": "https://play-lh.googleusercontent.com/0 ... SQ=s256-rw",
"description": "Discord is designed for gaming and great for just chilling with friends or building a community. Customize your own
space and gather your friends to talk while playing your favorite
games, or just hang out.\n\nGROUP CHAT THAT\u2019S ALL FUN &
GAMES\n\u2219 Discord is great for playing games and chilling with
friends, or even building a worldwide community. Customize your own
space to talk, play, and hang out in.\n\nMAKE YOUR GROUP CHATS MORE
FUN\n\u2219 Create custom emoji, stickers, soundboard effects, and
more to add your personality to voice, video, or text chat. Set your
avatar, a custom status, and write your own profile to show up in chat
your way.\n\nSTREAM LIKE YOU\u2019RE IN THE SAME ROOM\n\u2219
High-quality and low-latency streaming makes it feel like you're
hanging out on the couch with friends while playing a game, watching
shows, looking at photos, or idk doing homework or something.\n\nHOP
IN WHEN YOU\u2019RE FREE, NO NEED TO CALL\n\u2219 Easily hop in and
out of voice or text chats without having to call or invite anyone, so
you can chat with your friends before, during, and after your game
session.\n\nSEE WHO\u2019S AROUND TO CHILL\n\u2219 See who\u2019s
around, playing games, or just hanging out. For supported games, you
can see what modes or characters your friends are playing and directly
join up.\n\nALWAYS HAVE SOMETHING TO DO TOGETHER\n\u2219 Watch videos,
play built-in games, listen to music, or just scroll together and spam
memes. Seamlessly text, call, video chat, and play games, all in one
group chat.\n\nWHEREVER YOU GAME, HANG OUT HERE\n\u2219 On your PC,
phone, or console, you can still hang out on Discord. Easily switch
between devices and use tools to manage multiple group chats with
friends."
},


Подробнее здесь: https://stackoverflow.com/questions/796 ... out-the-to
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»