API công khai (/v1)
Quốc gia
GET /v1/countries — list countries with eSIMs on sale, with plan counts and lowest prices.
Request#
GET
/v1/countriescurl "https://api.esimoa.com/v1/countries?q=japan&lang=en" \
-H "X-API-Key: esk_live_your_key_here"const res = await fetch('https://api.esimoa.com/v1/countries?q=japan&lang=en', {
headers: { 'X-API-Key': process.env.ESIMOA_API_KEY },
});
const { items } = await res.json();res = requests.get(
"https://api.esimoa.com/v1/countries",
params={"q": "japan", "lang": "en"},
headers={"X-API-Key": os.environ["ESIMOA_API_KEY"]},
timeout=10,
)
countries = res.json()["items"]Query parameters#
| Tham số | Loại | Mô tả |
|---|---|---|
q | string | Tìm theo tên hoặc mã quốc gia (không bắt buộc) |
lang | string | Ngôn ngữ phản hồi: ko | en | ja | zh-CN | zh-TW (mặc định en) |
q khớp với tên quốc gia ở bất kỳ ngôn ngữ nào trong năm ngôn ngữ (VD: japan, 일본, 日本).
Phản hồi#
200 OKjson
{
"success": true,
"items": [
{
"countryCode": "JP",
"name": "Japan",
"planCount": 128,
"lowestPriceKrw": 1000,
"url": "https://www.esimoa.com/en/plans/jp?ref=p_yourcode"
}
]
}The Country object#
| Trường | Loại | Mô tả |
|---|---|---|
countryCode | string | Mã quốc gia ISO 3166-1 alpha-2 |
name | string | Tên quốc gia (theo lang) |
planCount | integer | Số gói đang bán |
lowestPriceKrw | integer | null | Giá thấp nhất tính theo KRW |
url | string | Trang gói cước theo quốc gia — kèm mã đối tác của bạn (?ref=) |
