主题
设置 Apple 应用信息任务
POST /v3/app_data/apple/app_info/task_post
本接口使用 POST 方法,路径为:
/v3/app_data/apple/app_info/task_post
用于提交 Apple App Store 应用信息查询任务。接口会根据请求中的 app_id 获取指定应用的信息。
app_id 是 App Store 应用链接中 id 后面的数字。例如:
https://apps.apple.com/us/app/id835599320
对应的 app_id 为 835599320。
计费与请求限制
提交任务会产生费用。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求使用 UTF-8 编码的 JSON 格式,且请求体为 JSON 数组:
平台限流以认证说明中的 30/60/120 次/分钟规则为准;
- 每次请求最多 100 个任务; -过 100 个任务的部分将返回错误码
40006; - 任务提交成功后,可通过任务
id查询结果; - 也可以通过
postback_url或pingback_url接收任务完成通知。
如果使用回调地址,接收服务器需要在 10 秒响应,否则连接会因时中断,任务将 Tasks Ready 列表。
请求参数
每个任务对象支持以下字段:
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
app_id | string | 是 | App Store 移动应用 ID。可从应用 URL 中获取。例如,https://apps.apple.com/us/app/id835599320 中的 ID 为 835599320。 |
location_name | string | 条件填 | 搜索引擎位置的完整名称。未指定 location_code 时填。使用该字段时无需同时指定 location_code。可通过 /v3/app_data/apple/locations 获取可用位置。示例:West Los Angeles,California,United States |
location_code | integer | 条件填 | 搜索引擎位置代码。未指定 location_name 时填。使用该字段时无需同时指定 location_name。可通过 /v3/app_data/apple/locations 获取可用位置代码。示例:9061121 |
language_name | string | 条件填 | 搜索引擎语言的完整名称。未指定 language_code 时填。使用该字段时无需同时指定 language_code。可通过 /v3/app_data/apple/languages 获取可用语言。示例:English |
language_code | string | 条件填 | 搜索引擎语言代码。未指定 language_name 时填。使用该字段时无需同时指定 language_name。可通过 /v3/app_data/apple/languages 获取可用语言代码。示例:en |
priority | integer | 否 | 任务优级。1:普通优级,默认值;2:高优级。高优级任务可能产生额外费用,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。 |
tag | string | 否 | 用户自定义任务标识,最长 255 个字符。可用于任务与查询结果。提交的值会出现在响应的 data 对象中。 |
postback_url | string | 否 | 任务完成后接收结果的 URL。本平台会向该地址发送结果的 Gzip 压缩 POST 请求。支持使用 $id 和 $tag 占位符。 |
postback_data | string | 使用 postback_url 时填 | 回传数据类型。目前支持:advanced。 |
pingback_url | string | 否 | 任务完成后的通知 URL。本平台会向该地址发送 GET 请求。支持使用 $id 和 $tag 占位符。 |
回调地址示例
postback_url:
text
https://your-server.com/postbackscript?id=$id
https://your-server.com/postbackscript?id=$id&tag=$tagpingback_url:
text
https://your-server.com/pingscript?id=$id
https://your-server.com/pingscript?id=$id&tag=$tag发送请求时:
$id会被替换为任务 ID;$tag会被替换为经过 URL 编码的任务标签;- 回调地址中的特殊字符会进行 URL 编码,例如
#会编码为%23。
请求示例
cURL
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/app_data/apple/app_info/task_post" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"app_id": "835599320",
"location_code": 2840,
"language_code": "en"
},
{
"app_id": "835599320",
"location_code": 2840,
"language_code": "en",
"priority": 2,
"tag": "some_string_123",
"pingback_url": "https://your-server.com/pingscript?id=$id&tag=$tag"
},
{
"app_id": "835599320",
"location_code": 2840,
"language_code": "en",
"postback_data": "advanced",
"postback_url": "https://your-server.com/postbackscript"
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/app_data/apple/app_info/task_post"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
post_data = [
{
"app_id": "835599320",
"location_code": 2840,
"language_code": "en",
},
{
"app_id": "835599320",
"location_code": 2840,
"language_code": "en",
"priority": 2,
"tag": "some_string_123",
"pingback_url": "https://your-server.com/pingscript?id=$id&tag=$tag",
},
{
"app_id": "835599320",
"location_code": 2840,
"language_code": "en",
"postback_data": "advanced",
"postback_url": "https://your-server.com/postbackscript",
},
]
response = requests.post(url, headers=headers, json=post_data)
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
"请求失败,错误码:{},错误信息:{}".format(
result.get("status_code"),
result.get("status_message"),
)
)TypeScript
typescript
import axios from "axios";
const postData = [
{
app_id: "835599320",
location_code: 2840,
language_code: "en",
},
{
app_id: "835599320",
location_code: 2840,
language_code: "en",
priority: 2,
tag: "some_string_123",
pingback_url: "https://your-server.com/pingscript?id=$id&tag=$tag",
},
{
app_id: "835599320",
location_code: 2840,
language_code: "en",
postback_data: "advanced",
postback_url: "https://your-server.com/postbackscript",
},
];
axios
.post(
"https://api.seermartech.cn/v3/app_data/apple/app_info/task_post",
postData,
{
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);
});响应说明
接口返回 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 | 请求 URL 路径。 |
data | object | 本次请求中提交的任务参数。 |
result | array/null | 查询结果数组。任务提交成功后,该字段为 null,需通过任务 ID 获取后续结果。 |
响应示例
json
{
"version": "0.1.20220422",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0713 sec.",
"cost": 0.0006,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "00000000-0000-0000-0000-000000000000",
"status_code": 20100,
"status_message": "Task Created.",
"time": "0.0123 sec.",
"cost": 0.0006,
"result_count": 0,
"path": [
"v3",
"app_data",
"apple",
"app_info",
"task_post"
],
"data": {
"api": "app_data",
"function": "app_info",
"se": "apple",
"app_id": "835599320",
"location_code": 2840,
"language_code": "en",
"se_type": "app_info",
"device": "desktop",
"os": "windows"
},
"result": null
}
]
}状态码
20000:请求成功;40006:单次请求提交的任务数量 100 个;- 状态码:请参考
/v3/appendix/errors,并根据status_message进行错误处理。
实用场景
- 采集竞品 App Store 应用信息:批量提交竞品应用 ID,统一获取应用基础信息,为竞品监测和市场分析提供数据。
- 构建应用市场监控任务:结合
location_code和language_code,按不同国家或语言提交任务,跟踪应用在不同市场的展示。 - 批量维护应用数据资产:使用
tag标记品牌、产品线或项目,便于将任务结果回写到对应业务数据表。 - 搭建异步数据处理流程:
postback_url接收任务结果,减少轮询开销,加快应用信息库和分析流程。 - 提升重点任务处理时效:对需要快速获取结果的重点应用设置
priority=2,支持及时完成竞品或舆分析。