获取速卖通aliexpress分类详情 API接口

发布时间 2023-04-27 16:04:22作者: API测试开发Cris

 aliexpress分类详情API接口是速卖通提供的一种产品数据接口,可以帮助速卖通卖家快速地将产品分类、属性、价格等信息,通过 aliexpress API接口来快速生成产品描述、图片、视频等产品信息,让卖家可以更方便地管理自己的产品,快速获取这些数据。

一、获取方法

1.开发者注册一个账号

2.然后为每个速卖通应用注册一个应用程序键(App Key) 。

3.下载速卖通API的SDK并掌握基本的API基础知识和调用

4.利用SDK接口和对象,传入AppKey或者必要的时候获取并传入SessionKey来进行程序开发。

5.利用速卖通平台的文档中心和API测试工具,对接口进行测试。从而了解返回信息,方便程序获取。

二、参数说明

  • 通用参数说明

    • version:API版本
    • key:调用key,测试key:test_api_key
    • api_name:API类型[item_search,item_get]
    • cache:[yes,no]默认yes,将调用缓存的数据,速度比较快
    • result_type:[json,xml,serialize,var_export]返回数据格式,默认为json
    • lang:[cn,en,ru] 翻译语言,默认cn简体中文

三、使用范围

支持产品:服装类(女装,男装,运动户外,童装)、电子类(手机/电脑/平板电脑,充电宝,耳机)、家居用品(家纺,小家电)、家电类(空调,洗衣机)等等。

四、响应参数

名称类型必须示例值描述

id

Int 0 200000875 商品分类ID

name

String 0 Novelty & Special Use 分类名

pid

String 0 0 父分类ID

root_id

String 0 0 根分类ID

item

Mix 0 {"id": 200001270,"name": "Costumes & Accessories","pid": "200000875","root_id": 0,sub[]} 子分类id:子分类名称

五、请求示例

 

编辑

<?php
//定义缓存目录和引入文件
define("DIR_RUNTIME","runtime/");
define("DIR_ERROR","runtime/");
define("SECACHE_SIZE","0");
//SDK下载地址 https://
include ("ObApiClient.php");

$obapi = new otao\ObApiClient();
$obapi->api_url = "http://v-x-;18870288846/";
$obapi->api_urls = array//备用API服务器
$obapi->api_urls_on = true;//当网络错误时,是否启用备用API服务器
$obapi->api_key = "<您自己的apiKey>";
$obapi->api_secret = "<您自己的apiSecret>";
$obapi->api_version ="";
$obapi->secache_path ="runtime/";
$obapi->secache_time ="86400";
$obapi->cache = true;

$api_data = $obapi->exec(
                array(
	                "api_type" =>"aliexpress",
	                "api_name" =>"cat_get",
	                "api_params"=>array (
  'cid' => '0',
)
                )
            );
 var_dump($api_data);
?>

六、错误码解释

状态代码(error_code)状态信息详细描述是否收费
0000 success 接口调用成功并返回相关数据
2000 Search success but no result 接口访问成功,但是搜索没有结果
4000 Server internal error 服务器内部错误
4001 Network error 网络错误
4002 Target server error 目标服务器错误
4003 Param error 用户输入参数错误 忽略
4004 Account not found 用户帐号不存在 忽略
4005 Invalid authentication credentials 授权失败 忽略
4006 API stopped 您的当前API已停用 忽略
4007 Account stopped 您的账户已停用 忽略
4008 API rate limit exceeded 并发已达上限 忽略
4009 API maintenance API维护中 忽略
4010 API not found with these values API不存在 忽略
4012 Please add api first 请先添加api 忽略
4013 Number of calls exceeded 调用次数超限 忽略
4014 Missing url param 参数缺失 忽略
4015 Wrong pageToken 参数pageToken有误 忽略
4016 Insufficient balance 余额不足 忽略
4017 timeout error 请求超时
5000 unknown error 未知错误

文章内容有限,欢迎广大码友私信沟通交流!