主题
设置 Google Play 应用搜索任务
POST /v3/app_data/google/app_searches/task_post
本接口使用 POST 方法,路径为:
/v3/app_data/google/app_searches/task_post
根据指定的 keyword,提交 Google Play 应用搜索任务,并返回与、语言和地区的应用排名数据。任务提交成功后,可通过返回的任务 ID 查询结果,也可以回调地址,在任务完成后接收通知或结果。
每返回最多 30 条结果计费一次。例如,设置 "depth": 31 时,系统将按 60 条结果计费。
请求地址
text
POST https://api.seermartech.cn/v3/app_data/google/app_searches/task_post计费说明
任务费用由任务数量、返回结果数量和任务优级决定:
- 每个任务最多 30 条结果为一个计费单位。
- 建议将
depth设置为 30 的倍数。 - 设置
priority: 2会产生额外费用。 - 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。 - 参考价约 ¥0.0320 / 次,费用以任务参数和响应头为准。
所有请求使用 UTF-8 编码的 JSON 格式。平台限流以认证说明中的 30/60/120 次/分钟规则为准。若单次请求 100 个任务,出部分将返回错误码 40006。
任务完成后,可以通过任务唯一标识 id 获取结果。也可以在提交任务时 postback_url 或 pingback_url:
postback_url:任务完成后,本平台向指定地址发送任务结果的 POST 请求,使用 gzip 压缩。pingback_url:任务完成后,本平台向指定地址发送 GET 请求通知。- 如果回调服务器在 10 秒未响应,连接将因时中止,任务会转移到“已完成任务”列表。
请求参数
请求体是 JSON 数组,每个数组代表一个任务。
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
keyword | string | 是 | Google Play 搜索。最多 700 个字符。请求中的 %## 会被解码,字符 + 会被解码为空格。如需使用 %,请编码为 %25;如需使用 +,请编码为 %2B。 |
location_name | string | 条件填 | 搜索地区的完整名称。未指定 location_code 时填。使用该参数后无需再传 location_code。 |
location_code | integer | 条件填 | 搜索地区代码。未指定 location_name 时填。使用该参数后无需再传 location_name。可通过 /v3/app_data/google/locations 获取可用地区。示例:9061121。 |
language_name | string | 否 | 搜索语言的完整名称。使用该参数后无需再传 language_code。可通过 /v3/app_data/google/languages 获取可用语言。示例:English。 |
language_code | string | 否 | 搜索语言代码。使用该参数后无需再传 language_name。可通过 /v3/app_data/google/languages 获取可用语言代码。示例:en。 |
priority | integer | 否 | 任务优级。1:普通优级,默认值;2:高优级,处理速度更快,但会产生额外费用。 |
depth | integer | 否 | 解析深度,即需要返回的 Google Play 搜索结果数量。默认值为 30,最大值为 200。建议设置为 30 的倍数。 |
tag | string | 否 | 用户自定义任务标识,最多 255 个字符。可用于任务和结果,提交的值会出现在响应的 data 对象中。 |
postback_url | string | 否 | 接收任务结果的 URL。任务完成后,本平台将向该地址发送 POST 请求。可使用 $id 和 $tag 占位符,本平台发送请求前会替换为值。 |
postback_data | string | 条件填 | postback_url 的返回数据类型。指定 postback_url 时填。可选值:advanced、html。 |
pingback_url | string | 否 | 任务完成通知 URL。任务完成后,本平台将向该地址发送 GET 请求。可使用 $id 和 $tag 占位符。 |
地区与语言示例
地区名称示例:
text
West Los Angeles,California,United States地区代码示例:
text
9061121语言名称示例:
text
English语言代码示例:
text
en可用地区和语言分别通过以下接口获取:
/v3/app_data/google/locations/v3/app_data/google/languages
回调 URL 占位符
postback_url 和 pingback_url 支持以下占位符:
$id:任务 ID$tag:经过 URL 编码的任务标签
示例:
text
https://your-server.com/postbackscript?id=$id&tag=$tagURL 中的特殊字符会进行 URL 编码,例如 # 会编码为 %23。
请求示例
curl
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/app_data/google/app_searches/task_post" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"keyword": "vpn",
"location_code": 2840,
"language_code": "en",
"depth": 30
},
{
"keyword": "vpn",
"location_code": 2840,
"language_code": "en",
"depth": 30,
"priority": 2,
"tag": "some_string_123",
"pingback_url": "https://your-server.com/pingscript?id=$id&tag=$tag"
},
{
"keyword": "vpn",
"location_code": 2840,
"language_code": "en",
"postback_data": "html",
"postback_url": "https://your-server.com/postbackscript"
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/app_data/google/app_searches/task_post"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
payload = [
{
"keyword": "vpn",
"location_code": 2840,
"language_code": "en",
"depth": 30,
},
{
"keyword": "vpn",
"location_code": 2840,
"language_code": "en",
"depth": 30,
"priority": 2,
"tag": "some_string_123",
"pingback_url": "https://your-server.com/pingscript?id=$id&tag=$tag",
},
{
"keyword": "vpn",
"location_code": 2840,
"language_code": "en",
"postback_data": "html",
"postback_url": "https://your-server.com/postbackscript",
},
]
response = requests.post(url, headers=headers, json=payload, timeout=30)
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
f"请求失败,错误码:{result.get('status_code')},"
f"错误信息:{result.get('status_message')}"
)TypeScript
typescript
import axios from "axios";
const payload = [
{
keyword: "vpn",
location_code: 2840,
language_code: "en",
depth: 30,
},
{
keyword: "vpn",
location_code: 2840,
language_code: "en",
depth: 30,
priority: 2,
tag: "some_string_123",
pingback_url:
"https://your-server.com/pingscript?id=$id&tag=$tag",
},
{
keyword: "vpn",
location_code: 2840,
language_code: "en",
postback_data: "html",
postback_url: "https://your-server.com/postbackscript",
},
];
axios
.post(
"https://api.seermartech.cn/v3/app_data/google/app_searches/task_post",
payload,
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
)
.then((response) => {
// 处理任务提交结果
console.log(response.data);
})
.catch((error) => {
console.error("请求失败:", error.response?.data || error.message);
});PHP
php
<?php
$url = 'https://api.seermartech.cn/v3/app_data/google/app_searches/task_post';
$payload = [
[
'keyword' => 'vpn',
'location_code' => 2840,
'language_code' => 'en',
'depth' => 30,
],
[
'keyword' => 'vpn',
'location_code' => 2840,
'language_code' => 'en',
'depth' => 30,
'priority' => 2,
'tag' => 'some_string_123',
'pingback_url' => 'https://your-server.com/pingscript?id=$id&tag=$tag',
],
[
'keyword' => 'vpn',
'location_code' => 2840,
'language_code' => 'en',
'postback_data' => 'html',
'postback_url' => 'https://your-server.com/postbackscript',
],
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer smt_live_YOUR_KEY',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE),
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);响应参数
接口返回 JSON 数据 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 通用状态码。完整错误码列表请参考 /v3/appendix/errors。 |
status_message | string | 通用状态信息。 |
time | string | 请求执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务总数。 |
tasks_error | integer | tasks 数组中返回错误的任务数量。 |
tasks | array | 任务信息数组。 |
tasks 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。 |
status_code | integer | 任务状态码,取值范围通常为 10000 至 60000。 |
status_message | string | 任务状态信息。 |
time | string | 任务执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
result_count | integer | result 数组中的数量。提交任务接口通常为 0。 |
path | array | 请求路径信息。 |
data | object | 提交任务时使用的参数。 |
result | array / null | 任务结果数组。任务提交接口中通常为 null,需要通过任务 ID 获取最终结果。 |
响应示例
json
{
"version": "0.1.20220422",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0883 sec.",
"cost": 0.0086,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "01234567-89ab-cdef-0123-456789abcdef",
"status_code": 20100,
"status_message": "Task Created.",
"time": "0.0120 sec.",
"cost": 0.0086,
"result_count": 0,
"path": [
"v3",
"app_data",
"google",
"app_searches",
"task_post"
],
"data": {
"api": "app_data",
"function": "app_searches",
"se": "google",
"keyword": "vpn",
"location_code": 2840,
"language_code": "en",
"depth": 30,
"se_type": "organic",
"device": "desktop",
"os": "windows"
},
"result": null
}
]
}错误处理
- 顶层
status_code用于表示本次请求的整体处理状态。 tasks_error用于表示任务数组中失败任务的数量。- 每个任务还会通过自身的
status_code和status_message返回任务级别的处理结果。 - 建议客户端同时处理 HTTP 错误、顶层状态码和任务级状态码。
- 完整错误码列表请参考
/v3/appendix/errors。 - 单次提交 100 个任务时,出限制的任务将返回错误码
40006。
实用场景
- 监控核心的应用排名:定期提交 Google Play 搜索任务,跟踪自有应用在不同地区和语言下的排名变化,评估 ASO 优化效果。
- 对比竞品应用的搜索表现:针对同一采集多个地区的应用结果,识别竞品优势和市场覆盖范围。
- 分析多语言市场机会:按不同
language_code和location_code批量查询结果,为海外市场本地化和投放决策提供依据。 - 评估覆盖率:批量提交品牌词、品类词和功能词,统计应用在目标集合中的出现频次,优化商店布局。
- 构建异步排名监测系统:通过
postback_url或pingback_url接收任务完成通知,减少轮询开销并及时更新 SEO/ASO 数据看板。