首页 > 大数据 > 可视化 > 淘宝/天猫淘口令真实URL API接口详解
https://api-gw.onebound.cn/taobao/item_password/
https://api.taokouling.com/tkl/Tbktbtaokouling
| 参数名称 | 是否必填 | 类型 | 示例值 | 说明 |
|---|---|---|---|---|
key |
是 | String |
your_api_key |
API调用密钥 |
secret |
是 | String |
your_api_secret |
API调用密钥 |
word |
是 | String |
URL编码后的淘口令 |
淘口令文本或商品URL |
title |
否 | String |
yes 或
no |
是否返回商品标题和图片 |
api_name |
是 | String |
item_password |
API接口名称 |
cache |
否 | String |
yes 或
no |
是否使用缓存数据 |
import requestsimport urllib.parse# 定义API的URL和参数api_url = "https://api-gw.onebound.cn/taobao/item_password/"api_key = "your_api_key"api_secret = "your_api_secret"word = urllib.parse.quote("淘口令文本") # 淘口令需要进行URL编码title = "yes" # 是否获取标题和图片# 构造请求参数params = {
"key": api_key,
"secret": api_secret,
"word": word,
"title": title}# 发送HTTP GET请求response = requests.get(api_url, params=params)# 解析响应if response.status_code == 200:
result = response.json()
print("商品的真实URL:", result["item"]["url"])
print("商品标题:", result["item"].get("title", "N/A"))
print("商品图片URL:", result["item"].get("pic_url", "N/A"))else:
print("请求失败,错误信息:", response.json().get("error", "未知错误"))| 字段名称 | 类型 | 说明 |
|---|---|---|
item |
Object | 商品信息 |
url |
String | 商品的真实URL |
word |
String | 淘口令内容 |
title |
String | 商品标题(如果请求时指定获取) |
pic_url |
String | 商品图片URL(如果请求时指定获取) |
error |
String | 错误信息(如果请求失败) |
error_code |
String | 错误代码 |
reason |
String | 错误原因 |
api_info |
String | API调用相关信息(如调用次数、缓存情况) |
request_id |
String | 请求ID |
{
"item": {
"num_iid": "13734572962",
"url": "https://item.taobao.com/item.htm?id=13734572962",
"word": "淘口令内容",
"title": "商品标题",
"pic_url": "http://gw.alicdn.com/bao/uploaded/i4/3446654472/O1CN01YPvSDF1iuE2O7",
"price": "160.00"
},
"error": "",
"reason": "",
"error_code": "0000",
"cache": 0,
"api_info": "today:6386 max:15000",
"execution_time": 1.164,
"server_time": "Beijing/2020-06-15 18:57:40",
"call_args": {
"num_iid": "13734572962"
},
"api_type": "taobao",
"request_id": "15ee75422ea6a4"}来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70041666/viewspace-3078061/ ,如需转载,请注明出处,否则将追究法律责任。