CurrencyExhange in Alexa Skill store
CurrencyExchange skill
Ever wondered about the currency rate between 2 currencies but too lazy to go and type it in the browser. Alexa CurrencyExchange skill is here for you. You can ask it for the exchange rate between any 2 currencies and for the desired amount and it will get back to you with an answer.
How this works
The user asks Alexa about something for example: "Alexa ask CurrencyExchange ..." This wakes up the currency skill and waits for the command. And after saying the required command, it is sent to Amazon Lambda which validates the data, processes the information from the API and then returns the value.
Phrases
Alexa ask currency exchange to get me the exchange rate the Bulgarian lev and pound sterling.
Alexa ask currency exchange how many British pound sterling is a USD.
Alexa ask currency exchange to convert 10 Japanese yen to bitcoin.
Node.js is used to program for the server side. The echo makes a GET request to the API endpoint and I then return the response accordingly.
If you want to replicate the project - git clone my github repo and follow the steps.
Step 1: Define Your SkillComplete the Skill Information page after creating a skill on Amazon Alexa skills page.
Application ID
The ID for this skill (non-editable, but this is your generated application ID).
Skill Type (Required)
You can choose a Skill API or define the interaction model.
- Custom Interaction Model
- Smart Home Skill API
For this project I am using "Custom Interaction Model"
Name (Required)
The name of this skill. This is the name displayed in the Alexa App.
Invocation Name (Required)
The name users will say to interact with this skill. This does not have to be the same as the skill name. The invocation name must comply with the Invocation Name Guidelines.
Step 2: Define your InteractionComplete the Interaction Model page.
Intent Schema (Required)
The schema of user intents in JSON format. For more information, see Intent Schema.
Also see built-in slots and built-in intents.
{
"intents": [
{
"intent": "GetExchangeRate",
"slots": [
{
"name": "CURRENCY_FROM",
"type": "CURRENCIES"
},
{
"name": "CURRENCY_TO",
"type": "CURRENCIES"
},
{
"name":"AMOUNT",
"type": "AMAZON.NUMBER"
}
]
},
{
"intent": "AMAZON.HelpIntent"
},
{
"intent": "AMAZON.StopIntent"
},
{
"intent": "AMAZON.CancelIntent"
}
]
}
Custom slot types (Optional)
Not all types are provided by Amazon; in case you need your own custom type, you need to define it (for example: currency codes).
Update
Added more representations for each currency, so that users can say the full name instead of just the symbol of the particular currency. In the future, I may add the functionality of mapping a country to its currency so if the user is not familiar with the currency, they can just say the country.
CURRENCIES
aed | afn | all | amd | ang | aoa | ars | aud | awg | azn | bam | bbd | bdt | bgn | bhd | bif | bmd | bnd | bob | brl | bsd | btc | btn | bwp | byn | bzd | cad | cdf | chf | clf | clp | cny | cop | crc | cuc | cup | cve | czk | djf | dkk | dop | dzd | eek | egp | ern | etb | eur | fjd | fkp | gbp | gel | ggp | ghs | gip | gmd | gnf | gtq | gyd | hkd | hnl | hrk | htg | huf | idr | ils | imp | inr | iqd | irr | isk | jep | jmd | jod | jpy | kes | kgs | khr | kmf | kpw | krw | kwd | kyd | kzt | lak | lbp | lkr | lrd | lsl | ltl | lvl | lyd | mad | mdl | mga | mkd | mmk | mnt | mop | mro | mtl | mur | mvr | mwk | mxn | myr | mzn | nad | ngn | nio | nok | npr | nzd | omr | pab | pen | pgk | php | pkr | pln | pyg | qar | ron | rsd | rub | rwf | sar | sbd | scr | sdg | sek | sgd | shp | sll | sos | srd | std | svc | syp | szl | thb | tjs | tmt | tnd | top | try | ttd | twd | tzs | uah | ugx | usd | uyu | uzs | vef | vnd | vuv | wst | xaf | xag | xau | xcd | xdr | xof | xpd | xpf | xpt | yer | zar | zmw | zwl | united arab emirates dirham | arab dirham | emirates dirham | arab emirates dirham | afghan afghani | afghani | afghanistan afghani | albanian lek | albania lek | albani lek | lek | armenian dram | armenia dram | dram | netherlands antillean guilder | guilder | netherlands guilder | angolan kwanza | angola kwanza | kwanza | argentine peso | australian dollar | aruban florin | florin | azerbaijani manat | azerbaijani new manat | bosnia-herzegovina convertible mark | bosnia and herzegovina convertible mark | bosnia-herzegovina convertible marka | bosnia and herzegovina convertible marka | barbadian dollar | bangladeshi taka | bangladesh taka | taka | bulgarian lev | lev | bahraini dinar | bahrain dinar | burundian franc | burundi franc | bermudan dollar | brunei dollar | bolivian boliviano | brazilian real | real | bahamian dollar | bitcoin | bhutanese ngultrum | botswanan pula | belarusian ruble | belize dollar | canadian dollar | congolese franc | swiss franc | chilean unit of account | chilean peso | chinese yuan | yuan | colombian peso | costa rican colon | cuban convertible peso | cuban peso | cape verdean escudo | czech republic koruna | koruna | czech koruna | djiboutian franc | danish krone | dominican peso | algerian dinar | estonian kroon | egyptian pound | eritrean nakfa | ethiopian birr | euro | fijian dollar | falkland islands pound | british pound sterling | pound sterling | sterling | pound | georgian lari | guernsey pound | ghanaian cedi | gibraltar pound | gambian dalasi | guinean franc | guatemalan quetzal | guyanaese dollar | hong kong dollar | honduran lempira | croatian kuna | haitian gourde | hungarian forint | indonesian rupiah | israeli new sheqel | manx pound | indian rupee | iraqi dinar | iranian rial | icelandic krona | jersey pound | jamaican dollar | jordanian dinar | japanese yen | yen | kenyan shilling | kyrgystani som | cambodian riel | comorian franc | north korean won | south korean won | kuwaiti dinar | cayman islands dollar | kazakhstani tenge | laotian kip | lebanese pound | sri lankan rupee | liberian dollar | lesotho loti | lithuanian litas | latvian lats | libyan dinar | moroccan dirham | moldovan leu | malagasy ariary | macedonian denar | myanma kyat | mongolian tugrik | macanese pataca | mauritanian ouguiya | maltese lira | mauritian rupee | maldivian rufiyaa | malawian kwacha | mexican peso | malaysian ringgit | mozambican metical | namibian dollar | nigerian naira | nicaraguan cordoba | norwegian krone | nepalese rupee | new zealand dollar | omani rial | panamanian balboa | peruvian nuevo sol | papua new guinean kina | philippine peso | pakistani rupee | polish zloty | paraguayan guarani | qatari rial | romanian leu | serbian dinar | russian ruble | rwandan franc | saudi riyal | solomon islands dollar | seychellois rupee | sudanese pound | swedish krona | singapore dollar | saint helena pound | sierra leonean leone | somali shilling | surinamese dollar | sao tome and principe dobra | salvadoran colon | syrian pound | swazi lilangeni | thai baht | thailand baht | tajikistani somoni | turkmenistani manat | turkmenistan manat | tunisian dinar | tunisia dinar | tongan paanga | tonga paanga | paanga | turkish lira | turk lira | trinidad and tobago dollar | new taiwan dollar | tanzanian shilling | tanzania shilling | ukrainian hryvnia | ukrainia hryvnia | hryvnia | ugandan shilling | uganda shilling | united states dollar | american dollar | us dollar | dollar | uruguayan peso | uruguay peso | uzbekistan som | venezuelan bolivar fuerte | venezuelan fuerte | venezuela fuerte | fuerte | vietnamese dong | dong | vietnam dong | vanuatu vatu | vatu | samoan tala | tala | cfa franc beac | silver ounce | silver | gold ounce | gold | east caribbean dollar | cfa franc bceao | palladium ounce | cfp franc | platinum ounce | platinum | yemeni rial | yemen rial | south african rand | african rand | south africa rand | africa rand | rand | zambian kwacha | zambia kwacha | zimbabwean dollar | zimbabwe dollar
Edit
Sample Utterances (Required)
Phrases the end users say to interact with the skill. For better results, provide as many samples as you can.
Note that you must select three of these to use as your Example Phrases on the Description tab.
Here is where you define what YOU say. You start with what "Intent" the phrase should be mapped to, and include any custom slots in curly brackets.
GetExchangeRate how much {CURRENCY_TO} is {AMOUNT} {CURRENCY_FROM}
GetExchangeRate the exchange rate from {CURRENCY_FROM} to {CURRENCY_TO}
GetExchangeRate get me the exchange rate {CURRENCY_FROM} {CURRENCY_TO}
GetExchangeRate how much {CURRENCY_TO} is a {CURRENCY_FROM}
GetExchangeRate show me the exchange rate from {CURRENCY_FROM} to {CURRENCY_TO}
GetExchangeRate get me the exchange rate {CURRENCY_FROM} to {CURRENCY_TO}
GetExchangeRate {CURRENCY_FROM} to {CURRENCY_TO}
GetExchangeRate {AMOUNT} {CURRENCY_FROM} to {CURRENCY_TO}
GetExchangeRate convert {CURRENCY_FROM} to {CURRENCY_TO}
GetExchangeRate convert {AMOUNT} {CURRENCY_FROM} to {CURRENCY_TO}
AMAZON.HelpIntent help
AMAZON.HelpIntent help me
AMAZON.StopIntent stop
AMAZON.CancelIntent cancel
Step 3. ConfigurationEndpoint (Required)
Here is where you map the web service that drives the backend interaction with the Alexa Skill. Here is where you point your skill at that service, described in the code section. You can map it to your own hosted service or a service you construct in AWS Lambda.
Step 4. TestThis is where you test your service. You can pass your Utterances in the "Enter Utterance" field and click the "Ask Your Service Name" button to test the interaction.
You will see the formatted Lambda Request and Lambda Response in the boxes below.
Caution
So far the model only accepts certain representations for each currency. For more information, check the file currency.js in the repository.
The skill has been certified and published in the Alexa store.
Comments