百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

restcountries

> 编程语言
开源

通过 RESTful API 获取有关各国的信息

2.3K stars0 点赞1 次浏览
访问官网GitHub

工具介绍

通过 RESTful API 获取有关各国的信息

REST Countries

Get information about countries via a RESTful API https://restcountries.eu Donate!

The restcountries project has been acquired by apilayer, one of the leading providers of API microservices. We will keep supporting restcountries and providing it as a free solution for developers. We will finance this project fully and have turned off the donations feature.

Users

RESTCountries has over 1200 users, including:

TTÜ

Spotify International Pricing Index

Gorillaz

Wanderlust

Xero

FxPro

SKROSS

onefinestay

Much Better Adventures

Stay up-to-date

Follow RESTCountries on Twitter

Or subscribe to the mailing list

API Endpoints

Below are described the REST endpoints available that you can use to search for countries

All

xml
https://restcountries.eu/rest/v2/all

Name

Search by country name. It can be the native name or partial name

javascript
https://restcountries.eu/rest/v2/name/{name}
xml
https://restcountries.eu/rest/v2/name/eesti
xml
https://restcountries.eu/rest/v2/name/united

Full Name

Search by country full name

javascript
https://restcountries.eu/rest/v2/name/{name}?fullText=true
xml
https://restcountries.eu/rest/v2/name/aruba?fullText=true

Code

Search by ISO 3166-1 2-letter or 3-letter country code

javascript
https://restcountries.eu/rest/v2/alpha/{code}
xml
https://restcountries.eu/rest/v2/alpha/co
xml
https://restcountries.eu/rest/v2/alpha/col

List of codes

Search by list of ISO 3166-1 2-letter or 3-letter country codes

javascript
https://restcountries.eu/rest/v2/alpha?codes={code};{code};{code}
xml
https://restcountries.eu/rest/v2/alpha?codes=col;no;ee

Currency

Search by ISO 4217 currency code

javascript
https://restcountries.eu/rest/v2/currency/{currency}
xml
https://restcountries.eu/rest/v2/currency/cop

Language

Search by ISO 639-1 language code

javascript
https://restcountries.eu/rest/v2/lang/{et}
xml
https://restcountries.eu/rest/v2/lang/es

Capital city

Search by capital city

javascript
https://restcountries.eu/rest/v2/capital/{capital}
xml
https://restcountries.eu/rest/v2/capital/tallinn

Calling code

Search by calling code

javascript
https://restcountries.eu/rest/v2/callingcode/{callingcode}
xml
https://restcountries.eu/rest/v2/callingcode/372

Region

Search by region: Africa, Americas, Asia, Europe, Oceania

javascript
https://restcountries.eu/rest/v2/region/{region}
xml
https://restcountries.eu/rest/v2/region/europe

Regional Bloc

Search by regional bloc:

  • EU (European Union)
  • EFTA (European Free Trade Association)
  • CARICOM (Caribbean Community)
  • PA (Pacific Alliance)
  • AU (African Union)
  • USAN (Union of South American Nations)
  • EEU (Eurasian Economic Union)
  • AL (Arab League)
  • ASEAN (Association of Southeast Asian Nations)
  • CAIS (Central American Integration System)
  • CEFTA (Central European Free Trade Agreement)
  • NAFTA (North American Free Trade Agreement)
  • SAARC (South Asian Association for Regional Cooperation)
javascript
https://restcountries.eu/rest/v2/regionalbloc/{regionalbloc}
xml
https://restcountries.eu/rest/v2/regionalbloc/eu

Response Example

xml
https://restcountries.eu/rest/v2/alpha/col
…

Filter Response

You can filter the output of your request to include only the specified fields.

javascript
https://restcountries.eu/rest/v2/{service}?fields={field};{field};{field}
xml
https://restcountries.eu/rest/v2/all?fields=name;capital;currencies

Sources

  • @mledoze
  • List of countries
  • Languages
  • Currencies
  • Area

Similar projects

  • Countries of the world
  • REST Countries Node.js
  • REST Countries Ruby
  • REST Countries Go
  • REST Countries Python
  • world-currencies
  • REST Countries C#

License

Mozilla Public License MPL 2.0

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javacountriesjavarestrest-api

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言