UPS
货运和地址信息
- 认证方式
- API Key
- HTTPS
- Yes
- CORS
- Unknown
- 分类
- 物流追踪
简介
UPS 的 REST API 覆盖追踪、报价、发货和地址验证。认证是 OAuth 2.0 client-credentials 令牌(无令牌请求返回 401,已实测)。
快速开始
获取令牌(替换 CLIENT_ID、CLIENT_SECRET):
curl -X POST "https://onlinetools.ups.com/security/v1/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-u "CLIENT_ID:CLIENT_SECRET" \
-d "grant_type=client_credentials"
{ "token_type": "Bearer", "access_token": "...", "expires_in": "14399" }
追踪包裹(替换 YOUR_TOKEN):
curl "https://onlinetools.ups.com/api/track/v1/details/1Z999AA10123456784" \
-H "Authorization: Bearer YOUR_TOKEN"
认证方式
- 在 ups.com/upsdeveloperkit 注册 → 创建应用 → Client ID + Secret。
- 服务端对服务端用 OAuth 2.0 client-credentials。
- 通过
Authorization: Bearer YOUR_TOKEN携带令牌(缺失 → 401,已实测)。
速率限制与注意事项
- 免费开发者层带各 API 限流(见开发者门户)。
- API:追踪(
/api/track/v1/)、报价、发货和地址验证。 - 令牌按小时过期(
expires_in)——用同一端点刷新。 - 沙盒(
wwwcie.ups.com)可用于测试。
常见问题
UPS API 免费吗? 免费开发者层带限流;量大有生产协议。
如何获取令牌? 用 Client ID/Secret 走 OAuth 2.0 client-credentials。
沙盒是什么?
wwwcie.ups.com 用于测试。
物流追踪 分类更多
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| Aftership API to update, manage and track shipment efficiently | API Key | Yes | Yes | ↗ |
| Correios Integration to provide information and prepare shipments using Correio's services | API Key | Yes | Unknown | ↗ |
| Mapbox Maps, directions, geocoding | API Key | Yes | Unknown | ↗ |
| Pixela API for recording and tracking habits or effort, routines | X-Mashape-Key | Yes | Yes | ↗ |
| PostalPinCode API for getting Pincode details in India | No auth | Yes | Unknown | ↗ |