配送会社API - WhereParcel
グローバル配送会社の情報、メタデータ、対応国を取得。国別・地域別・配送会社タイプ別にフィルタリング可能。無料APIエンドポイント。
対応配送業者一覧の取得
概要
世界39社以上の配送業者の一覧とメタデータを取得します。無料APIで使用量は消費されません。
リクエスト例
// npm install whereparcel
import { WhereParcel } from 'whereparcel';
const wp = new WhereParcel('YOUR_API_KEY', 'YOUR_SECRET_KEY');
const carriers = await wp.getCarriers();
console.log(carriers); curl -X GET https://api.whereparcel.com/v2/carriers \ -H "Authorization: Bearer YOUR_API_KEY:YOUR_SECRET_KEY" \ -H "Content-Type: application/json"
const response = await fetch('https://api.whereparcel.com/v2/carriers', {
method: 'GET',
headers: {
"Authorization": "Bearer YOUR_API_KEY:YOUR_SECRET_KEY",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data); <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.whereparcel.com/v2/carriers'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); $headers = [ 'Authorization: Bearer YOUR_API_KEY:YOUR_SECRET_KEY', 'Content-Type: application/json' ]; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); curl_close($ch); $result = json_decode($response, true); print_r($result);
import requests
url = 'https://api.whereparcel.com/v2/carriers'
headers = {
'Authorization': 'Bearer YOUR_API_KEY:YOUR_SECRET_KEY',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
result = response.json()
print(result) package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.whereparcel.com/v2/carriers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer YOUR_API_KEY:YOUR_SECRET_KEY")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
} テスト用APIキーをダッシュボードで発行した実際のAPIキーに置き換えてください。
レスポンス
成功レスポンス (200)
200OK — 配送業者一覧の取得に成功しました
{
"success": true,
"data": [
"us.usps",
"us.fedex",
"us.ups",
"us.ontrac",
"ca.post",
"gb.fedex"
]
} エラーレスポンス (401)
401Unauthorized — 認証失敗
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
} 対応国一覧の取得
概要
配送追跡に対応している国の一覧を取得します。無料APIで使用量は消費されません。
リクエスト例
// npm install whereparcel
import { WhereParcel } from 'whereparcel';
const wp = new WhereParcel('YOUR_API_KEY', 'YOUR_SECRET_KEY');
const countries = await wp.getCountries();
console.log(countries); curl -X GET https://api.whereparcel.com/v2/countries \ -H "Authorization: Bearer YOUR_API_KEY:YOUR_SECRET_KEY" \ -H "Content-Type: application/json"
const response = await fetch('https://api.whereparcel.com/v2/countries', {
method: 'GET',
headers: {
"Authorization": "Bearer YOUR_API_KEY:YOUR_SECRET_KEY",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data); <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.whereparcel.com/v2/countries'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); $headers = [ 'Authorization: Bearer YOUR_API_KEY:YOUR_SECRET_KEY', 'Content-Type: application/json' ]; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); curl_close($ch); $result = json_decode($response, true); print_r($result);
import requests
url = 'https://api.whereparcel.com/v2/countries'
headers = {
'Authorization': 'Bearer YOUR_API_KEY:YOUR_SECRET_KEY',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
result = response.json()
print(result) package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.whereparcel.com/v2/countries"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer YOUR_API_KEY:YOUR_SECRET_KEY")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
} テスト用APIキーをダッシュボードで発行した実際のAPIキーに置き換えてください。
レスポンス
成功レスポンス (200)
200OK — 国一覧の取得に成功しました
{
"success": true,
"data": [
{
"code": "US",
"name": "United States"
},
{
"code": "CA",
"name": "Canada"
},
{
"code": "GB",
"name": "United Kingdom"
}
]
} エラーレスポンス (401)
401Unauthorized — 認証失敗
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
} 特定国の配送業者一覧を取得
概要
特定国で利用可能な配送業者をフィルタリングして取得します。無料APIで使用量は消費されません。
リクエスト例
// npm install whereparcel
import { WhereParcel } from 'whereparcel';
const wp = new WhereParcel('YOUR_API_KEY', 'YOUR_SECRET_KEY');
const carriers = await wp.getCarriersByCountry('kr');
console.log(carriers); curl -X GET https://api.whereparcel.com/v2/carriers/kr \ -H "Authorization: Bearer YOUR_API_KEY:YOUR_SECRET_KEY" \ -H "Content-Type: application/json"
const response = await fetch('https://api.whereparcel.com/v2/carriers/kr', {
method: 'GET',
headers: {
"Authorization": "Bearer YOUR_API_KEY:YOUR_SECRET_KEY",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data); <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.whereparcel.com/v2/carriers/kr'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); $headers = [ 'Authorization: Bearer YOUR_API_KEY:YOUR_SECRET_KEY', 'Content-Type: application/json' ]; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); curl_close($ch); $result = json_decode($response, true); print_r($result);
import requests
url = 'https://api.whereparcel.com/v2/carriers/kr'
headers = {
'Authorization': 'Bearer YOUR_API_KEY:YOUR_SECRET_KEY',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
result = response.json()
print(result) package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.whereparcel.com/v2/carriers/kr"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer YOUR_API_KEY:YOUR_SECRET_KEY")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
} テスト用APIキーをダッシュボードで発行した実際のAPIキーに置き換えてください。
パスパラメータ
countryCode string · required | <p>国コード (ISO 3166-1 alpha-2)</p>
kr |
レスポンス
成功レスポンス (200)
200OK — 国別配送業者一覧の取得に成功しました
{
"success": true,
"data": [
{
"code": "us.usps",
"name": "USPS (United States Postal Service)",
"serviceScope": "international"
},
{
"code": "us.fedex",
"name": "FedEx",
"serviceScope": "international"
},
{
"code": "us.ups",
"name": "UPS (United Parcel Service)",
"serviceScope": "international"
},
{
"code": "us.ontrac",
"name": "OnTrac",
"serviceScope": "national",
"region": "WEST"
},
{
"code": "us.ca.ontrac",
"name": "OnTrac (California)",
"serviceScope": "national",
"region": "CA"
}
]
} エラーレスポンス (401)
401Unauthorized — 認証失敗
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
} エラーレスポンス (404)
404Not Found — 国コードが見つかりません
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "No carriers found for country: ZZ"
}
} 特定国/地域の配送業者一覧を取得
概要
特定国の特定地域で利用可能な配送業者をフィルタリングして取得します。 米国や中国など国土が広く、特定地域でのみ運営される配送業者がある場合に使用します。 韓国のように全国配送のみの国ではこのエンドポイントは不要です。 無料APIで使用量は消費されません。
リクエスト例
// npm install whereparcel
import { WhereParcel } from 'whereparcel';
const wp = new WhereParcel('YOUR_API_KEY', 'YOUR_SECRET_KEY');
const carriers = await wp.getCarriersByRegion('us', 'ca');
console.log(carriers); curl -X GET https://api.whereparcel.com/v2/carriers/us/ca \ -H "Authorization: Bearer YOUR_API_KEY:YOUR_SECRET_KEY" \ -H "Content-Type: application/json"
const response = await fetch('https://api.whereparcel.com/v2/carriers/us/ca', {
method: 'GET',
headers: {
"Authorization": "Bearer YOUR_API_KEY:YOUR_SECRET_KEY",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data); <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.whereparcel.com/v2/carriers/us/ca'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); $headers = [ 'Authorization: Bearer YOUR_API_KEY:YOUR_SECRET_KEY', 'Content-Type: application/json' ]; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); curl_close($ch); $result = json_decode($response, true); print_r($result);
import requests
url = 'https://api.whereparcel.com/v2/carriers/us/ca'
headers = {
'Authorization': 'Bearer YOUR_API_KEY:YOUR_SECRET_KEY',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
result = response.json()
print(result) package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.whereparcel.com/v2/carriers/us/ca"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer YOUR_API_KEY:YOUR_SECRET_KEY")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
} テスト用APIキーをダッシュボードで発行した実際のAPIキーに置き換えてください。
パスパラメータ
countryCode string · required | <p>国コード (ISO 3166-1 alpha-2)</p>
us |
region string · required | <p>地域コード (州、県など)</p>
ca |
レスポンス
成功レスポンス (200)
200OK — 地域別配送業者一覧の取得に成功しました
{
"success": true,
"data": [
{
"code": "us.usps",
"name": "USPS (United States Postal Service)",
"serviceScope": "international"
},
{
"code": "us.fedex",
"name": "FedEx",
"serviceScope": "international"
},
{
"code": "us.ups",
"name": "UPS (United Parcel Service)",
"serviceScope": "international"
},
{
"code": "us.ca.ontrac",
"name": "OnTrac (California)",
"serviceScope": "national",
"region": "CA"
}
]
} エラーレスポンス (401)
401Unauthorized — 認証失敗
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
} エラーレスポンス (404)
404Not Found — 国または地域コードが見つかりません
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "No carriers found for ZZ/CA"
}
}