快递查询

完整快递查询API

接口信息
总调用: 0
最后更新: 2026-01-18
调用权限: 密钥调用
调用价格: 不收费
接口ID: chaexpress
接口来源: 自建接口
请求信息

接口地址

https://chaexpress.api1.sbs

文档地址

https://api1.sbs/?chaexpress
秘钥方案
方案1:通过各种方案传入Token调用,以下是Token;
方案1的值可通过get或post及Authorization或请求头传入
方案2:通过get或post传入user,pwd或username,password调或通过Authorization或请求头传入;
方案3:通过api获取AccountToken,以下位AccountToken生成链接;
https://accopen.suppx.cn/?token=
方案3的第二步,将调用返回的json中的AccToken充当Token调用,有效期生成起3日,值可通过get或post及Authorization或请求头传入;
生成调用后上一次调用生成的AccountToken将失效,新的会替换,生成的三天后也会失效。
请求参数
参数名 类型 必填 说明
inflexion string 快递单号
在线测试
此处将显示接口返回结果...
调用示例
PHP 调用示例
<?php $apiUrl = 'https://chaexpress.api1.sbs'; $apiKey = ''; // 替换为您的API密钥 // 准备请求参数 $params = [ 'inflexion' => 'value', // 快递单号 (必填) // 可以添加其他参数 ]; // 构建查询字符串 $queryString = http_build_query($params); // 初始化cURL $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $apiUrl . '?' . $queryString); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 执行请求 $response = curl_exec($ch); if (curl_errno($ch)) { echo '请求错误: ' . curl_error($ch); } else { // 尝试解析JSON响应 $json = json_decode($response, true); if (json_last_error() === JSON_ERROR_NONE) { print_r($json); } else { echo $response; } } // 关闭cURL资源 curl_close($ch);
Python 调用示例
import requests api_url = "https://chaexpress.api1.sbs" api_key = "" # 替换为您的API密钥 # 准备请求参数 params = { 'inflexion': 'value', # 快递单号 (必填) # 可以添加其他参数 } try: response = requests.get(api_url, params=params) response.raise_for_status() # 检查请求是否成功 # 尝试解析JSON响应 try: json_response = response.json() print(json_response) except ValueError: print(response.text) except requests.exceptions.RequestException as e: print(f"请求错误: {e}")
Node.js 调用示例
const axios = require('axios'); // 或者使用内置的https模块: const https = require('https'); const apiUrl = 'https://chaexpress.api1.sbs'; const apiKey = ''; // 替换为实际API密钥 // 准备请求参数 const params = { inflexion: 'value', // 快递单号 (必填) // 可以添加其他参数 }; // 使用axios axios.get(apiUrl, { params }) .then(response => { try { // 如果是JSON响应 if (typeof response.data === 'object') { console.log(JSON.stringify(response.data, null, 2)); } else { console.log(response.data); } } catch (e) { console.log(response.data); } }) .catch(error => { console.error('请求失败:', error.message); }); // 或者使用原生https模块 /* const querystring = require('querystring'); const query = querystring.stringify(params); https.get(`${apiUrl}?${query}`, (res) => { let data = ''; res.on('data', (chunk) => data += chunk); res.on('end', () => { try { console.log(JSON.parse(data)); } catch { console.log(data); } }); }).on('error', (err) => { console.error('Error:', err.message); }); */