A simple encyclopia for countries of the world. It is a RESTful API that I created using Node.js's Express framework and it is just a starter project. The data about the countries could be found in 'data/countries.json' file.
$ git clone https://github.com/yasir-lateef/CountryPedia-API.git
$ cd CountryPedia-API
$ npm install
- List of all the countries
http://localhost:2000/api/countries/all
- Information about a country
http://localhost:2000/api/countries/:countryName
Replace 'countryName' with the name of the country you want info about. For Example Pakistan, United States etc.
- Information about a country's specific attribute
http://localhost:2000/api/countries/:countryName/:attribName
Replace 'countryName' and 'attribName' parameters with the country and attribute(lowercase) you want info about. For Example Pakistan, United States etc.
- name
- capital
- region
- altSpellings
- subregion
- population
- demonym
- area
- timezones
- borders
- callingCodes
- currencies
- languages
- List of Regions(with list of its subregions)
http://localhost:2000/api/regions/all
- Region Detail with List of Countries in it
http://localhost:2000/api/regions/:regionName
Replace 'regionName' parameter with the name of one of the regions. For Example Africa, Europe etc.
-
Asia
-
Europe
-
Africa
-
Oceania
-
Americas
-
List of countries in a subregion
http://localhost:2000/api/regions/:regionName/:subRegionName
Replace 'regionName' and 'subRegionName' parameters with the name region and its subregion respectively. For Example 'http://localhost:2000/api/regions/Asia/Southern Asia'
- Asia
- Southern Asia
- South-Eastern Asia
- Central Asia
- Eastern Asia
- Western Asia
- Europe
- Northern Europe
- Southern Europe
- Eastern Europe
- Western Europe
- Africa
- Northern Africa
- Southern Africa
- Middle Africa
- Eastern Africa
- Western Africa
- Oceania
- Polynesia
- Melanesia
- Micronesia
- Australia and New Zealand
- Americas
- Caribbean
- Northern America
- South America
- Central America
- List of Language Codes
http://localhost:2000/api/isolanguagecodes/all
Search by Language Code
http://localhost:2000/api/isolanguagecodes/search/?attr=code&value=[lang_code]
Replace [lang_code] with the ISO 639-1(two-letter) language code i.e EN for English, FR for French etc
Search by Language Name
http://localhost:2000/api/isolanguagecodes/search/?attr=code&value=[lang_Name]
- List of Country Codes
http://localhost:2000/api/isocountrycodes/all
Search by Country Code
http://localhost:2000/api/isocountrycodes/search/?attr=code&value=[country_code]
Replace [country_code] with the ISO 639-1(two-letter) country code i.e IRN for IRAN, PAK for Pakistan etc
Search by Country Name
http://localhost:2000/api/isocountrycodes/search/?attr=name&value=[country_Name]
Replace [country_name] with the language name i.e English, French etc