Skip to content

jonathantneal/countries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Countries

Useful information about every country, packaged as objects. Created from the countries ruby gem.

Usage

Return an array of country names. [test]

<script src="?return[]=name"></script>
[{"name":"Andorra"},{"name":"United Arab Emirates"},...]

Return a keyless array of country names. [test]

<script src="?return[]=name&keyless"></script>
[["Andorra"],["United Arab Emirates"],...]

Return a callback array of country names. [test]

<script src="?return[]=name&callback=foo"></script>
foo([["Andorra"],["United Arab Emirates"],...]);

Return a human-readable array of country names. [test]

<script src="?return[]=name&readable"></script>
[
	{
		"name": "Andorra"
	},
	{
		"name": "United Arab Emirates"
	},
	...
]

Return an array of country names and their ISO 3166 Alpha 2 codes. [test]

<script src="?return[]=name&return[]=alpha2"></script>
[{"name":"Andorra","alpha2":"AD"},{"name":"United Arab Emirates","alpha2":"AE"},...]

Return an array of one item — the United State’s name and latitude–longitude coordinates. [test]

<script src="?alpha2[]=US&return[]=name&return[]=latlng"></script>
[{"name":"United States","latlng":[38,-97]}]

Return an object — the United State’s name and latitude–longitude coordinates. [test]

<script src="?alpha2=US&return[]=name&return[]=latlng"></script>
{"name":"United States","latlng":[38,-97]}

Return an array of all countries’ data. [test]

<script src="?return"></script>
[{"addressFormat":null,"alpha2":"AD",...},...]

License

Data taken from the countries ruby gem is licensed MIT. Any additional data and everything else is dedicated to the public domain (CC0).

About

Useful information about every country, packaged as objects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published