RestCountries

Content Type: Module
Categories: Connectors

Overview

Simple get country info from RestCountries API. You can search by country code (Alpha2Code or Alpha3Code), calling code, currency, name, language, capital, region or regional block. Only need some info, but not all? Simply filter on fields by entering a comma seperated list of field names (see restcountries.com for field names). All calls will return a list of countries (when available).

Documentation

Description

Simple get country info from RestCountries API. You can search by country code (Alpha2Code or Alpha3Code), calling code, currency, name, language, capital, region or regional block.

Only need some info, but not all? Simply filter on fields by entering a comma seperated list of field names (see restcountries.com for field names).

All calls will return a list of countries (when available). 

Typical usage scenario

Do you want to check some info on a country? What is the country flag, what is the used currency, what borders does the country have, what languages are there, what timezones,…..

Features and limitations

Get country information by one of the listed parameters.

  • All
    Get all countries availabe.
  • Alpha
    Use Alpha2Code of Alpha3Code. Like NL or NLD. You can request multiple by using a comma seperated list of code like nl,be,gb,lu.
  • Calling code
    Use the calling code. Like 31 or 32 (without + or 00)
  • Capital
    Use acapital city of the country. Like Amsterdam.
  • Currency
    Use a currency. Like EUR.
  • Language
    Use a language. Like nl or nld.
  • Name
    Use a country name (English or native). Like Netherlands or Nederland
  • Region
    Use a region. The options are: 
    • Africa
    • Americas 
    • Asia
    • Europ,
    • Oceania
  • Regional bloc
    Use a regional bloc. The options are:
    • 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)

Dependencies

  • Mendix 8.12.1+
  • RestCountries.eu API

Installation

Simply import the module into your project.

Configuration

No configuration needed!

Usage

  • Create a CountrySearch entity. Use the three attributes:
    • SearchString
      String to search for.
    • FieldFilter (can be empty)
      Comma seperated list of fields. Like name,capital,currencies,languages
    • EndPoint
      Enumeration with all endpoints.
  • Call microflow GetCountries with CountrySearch as parameter.
    The microflow will return the list of countries. The list will also be associated with the CountrySearch object.

Frequently Asked Questions

  • Q: Do I need an account for RestCountries API?
  • A: No! At this moment it is a free service! Their statement:
    "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.”

Releases

Version: 2.0.0
Framework Version: 8.12.1
Release Notes: The API changed its URL, changed the fields option and added some extra fields. URL Change: OLD : https://restcountries.eu/rest/v2 NEW : https://restcountries.com/v2 Changed field options from a semicolon seperated list to a comma seperated list: (see restcountries.com for the available options) OLD: name;currencies;translations NEW: name,currencies,translations Changed field in Country: Flag : Now returns URL using CDN (https://flagcdn.com/nl.svg) Added fields in Country: FlagSVG : https://flagcdn.com/nl.svg FlagPNG : https://flagcdn.com/w320/nl.png Independent : [boolean] Added field in Translations: HU Fixed bug: Now creating correct endpoints. (Removed v1.3.x versions due to this bug)
Version: 1.2.0
Framework Version: 8.12.1
Release Notes: Upgraded to Mx8.12.1 (due to Mx9 support).
Version: 1.1.0
Framework Version: 7.23.2
Release Notes: First Marketplace release.