SuperAPI AI 工具集

google-trends

数据与分析

查看项目

更新于 10-15 21:40

技能介绍

用途:该技能用于抓取 Google Trends 的实时热门搜索,可按国家、类别和时间范围筛选,适合查询“某国正在流行什么”或某类目(游戏、科技、体育等)的热门话题,也支持多国趋势对比。

主要能力:支持 --geo 指定两位国家代码(默认 US,如 BR、ID、GB、JP、IN、DE、FR、AU、MX 等);--category 指定类别(all、games、technology、sports、entertainment、business、health、science、food、travel、beauty、politics、shopping);--hours 指定时间窗(4、24、48、168,默认 24);--top 指定返回条数(默认 20);--method 选择 rss 或 csv(默认 auto,category 为 all 时用 rss,指定类别时用 csv,csv 依赖 Selenium)。

使用方式:始终通过 run.py 包装脚本执行,它会自动处理虚拟环境。基本用法:python scripts/run.py --geo BR;按类别:python scripts/run.py --geo BR --category games;多国并行可同时运行多个命令后 wait;更长周期与更多结果:python scripts/run.py --geo JP --category entertainment --hours 168 --top 30。脚本输出 JSON,包含 geo、category、hours、method、count 和 trends 数组(rank、trend、volume、started)。

适用场景:快速了解某国或某类目的实时热搜、跨国家趋势比较、为内容或营销选题提供参考。

限制:RSS 方式不支持类别过滤;csv 方式依赖 Selenium 并会无头启动 Chrome,速度较慢;需要 Python 3.8+;浏览器超时或报错时可改用 --method rss(会丢失类别过滤);结果为空时可尝试 --hours 168;国家代码可用 python scripts/run.py --list-countries 查看。