USPS API 的国家/地区列表
我将使用 USPS API 计算国际运费,但他们提供的列表有近 500 个国家/地区。列表包括:
Fernando Po (Equatorial Guinea)
Hashemite Kingdom (Jordan)
Muscat (Oman)
Nauru
Negri Sembilan (Malaysia)
它们都按照列表提供邮政费率。
但这个清单看起来真的很长。
我想知道是否有人对较短的列表有任何建议?
I'm going to use the USPS API for international shipping rates, but the list they provide is nearly 500 countries long. The listings include:
Fernando Po (Equatorial Guinea)
Hashemite Kingdom (Jordan)
Muscat (Oman)
Nauru
Negri Sembilan (Malaysia)
And they all work as listed to provide postal rates.
But the list seems REALLY long.
I wondered if anyone had any suggestions about a shorter list?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,我曾经手动浏览过该“列表”(大量页面),删除重复项、重命名引用等,并将它们与我最近编写的运输缓存 Java 应用程序的 ISO 代码相关联。我从未完成它;我最终没有使用它。
我发现获取他们的清单的一种更简单的方法是从另一端开始:从 USPS 本身窃取它。转到他们的国际汇率计算器并查看选择框的来源。然后几个正则表达式就可以让您上路了。它可能不是完全最新的,如果另一个部门或不同的人维护这两个列表,我不会感到惊讶,但它应该非常接近。
I actually once went through that "list" (those tons of pages) manually, removed duplicates, renamed references, etc. and correlated them with ISO codes for a shipping cache Java application I wrote recently. I never finished it; I ended up not using it in the end.
I found a much easier way to get their list was to start from the other end: just steal it from USPS itself. Go to their international rate calculator and view the source for the select box. A couple regular expressions should then have you on your way. It may not be completely up-to-date, I wouldn't be surprised if another department or different people maintained the two lists, but it should be pretty close.