https://github.com/izolate/countries
Useful data for every country in the ISO 3166 standard
https://github.com/izolate/countries
Last synced: 6 months ago
JSON representation
Useful data for every country in the ISO 3166 standard
- Host: GitHub
- URL: https://github.com/izolate/countries
- Owner: izolate
- License: mit
- Created: 2015-02-08T18:18:03.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-02-08T20:09:17.000Z (about 11 years ago)
- Last Synced: 2025-02-17T06:41:32.677Z (about 1 year ago)
- Language: Dart
- Size: 156 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# countries
Useful data for every country in the ISO 3166 standard
## Usage
Instantiate the class: `Countries countries = new Countries()`
### `countries.code(String)`
Lookup a country based on its 2-digit, [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.
**Example**
```
countries.code('GB');
```
**Response**:
```
{
"capital": "London",
"continent": "EU",
"currency": "GBP",
"languages": "en",
"name": "United Kingdom",
"native": "United Kingdom",
"phone": 44,
"code": "GB"
}
```
### `countries.name(String)`
Lookup a country by its official name in English.
**Example**
```
countries.name('South Korea');
```
**Response**
```
{
"capital": "Seoul",
"continent": "AS",
"currency": "KRW",
"languages": "ko",
"name": "South Korea",
"native": "대한민국",
"phone": 82,
"code": "KR"
}
```