orinoco-countries
v1.0.10
Published
A Package for Orinoco Dev Countries API
Downloads
4
Readme
This is a sdk for OrinocoDev Countries API
Install
npm i orinoco-countries
Usages
const { getAllCountries, getOneCountry, getOneByPhone, getByCurrency } = require('orinoco-countries')
getAllCountries
Params apiKey (ApiKey from OrinocoDev Countries API)
getAllCountries(apiKey)
Return a array of countries
[
{
currency: { name: 'Euro', symbol: 'EUR' },
_id: '6217ee7be67a8320858f6013',
name: 'Greece',
phoneCode: '+30',
flag: 'https://www.placesapi.dev/flags/GR.gif',
shortName: 'GR'
},
{
currency: { name: 'Pound', symbol: 'GBP' },
_id: '6217ee7be67a8320858f6014',
name: 'South Georgia and the South Sandwich Islands',
phoneCode: '+null',
flag: 'https://www.placesapi.dev/flags/GS.gif',
shortName: 'GS'
},
...
]
getOneCountry
Params apiKey (ApiKey from OrinocoDev Countries API)
Params country (name of country)
getOneCountry(apiKey, country)
Return a country
{
currency: { name: 'Euro', symbol: 'EUR' },
_id: '6217ee7be67a8320858f6013',
name: 'Greece',
phoneCode: '+30',
flag: 'https://www.placesapi.dev/flags/GR.gif',
shortName: 'GR'
}
getOneByPhone
Params apiKey (ApiKey from OrinocoDev Countries API)
Params phoneCode (Phone code of country)
getOneCountry(apiKey, phoneCode)
Return a country by phone code
{
currency: { name: 'Euro', symbol: 'EUR' },
_id: '6217ee7be67a8320858f6013',
name: 'Greece',
phoneCode: '+30',
flag: 'https://www.placesapi.dev/flags/GR.gif',
shortName: 'GR'
}
getByCurrency
Params apiKey (ApiKey from OrinocoDev Countries API)
Params currencySymbol (ApiKey from OrinocoDev Countries API)
getByCurrency(apiKey, currencySymbol)
Return a array of countries by currency symbol
[
{
currency: { name: 'Euro', symbol: 'EUR' },
_id: '6217ee7be67a8320858f6013',
name: 'Greece',
phoneCode: '+30',
flag: 'https://www.placesapi.dev/flags/GR.gif',
shortName: 'GR'
},
{
currency: { name: 'Euro', symbol: 'EUR' },
_id: '6217ee7be67a8320858f60af',
name: 'Kosovo',
phoneCode: '+null',
flag: 'https://www.placesapi.dev/flags/XK.gif',
shortName: 'XK'