Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

API for currency exchange rate

Rahul_Analyst
9 - Comet

Hi,

 

I want to make a macro which should convert multiple currencies into US dollar on the current date. I know we can use download tool to get it. However, I am finding difficulty in finding API address or URL address which we can put in formula tool. 

 

Any help would be appreciated! 

16 REPLIES 16
Emil_Kos
17 - Castor
17 - Castor

Hi,


I would recommend starting with watching a video about API:

 

https://www.youtube.com/watch?v=7zbMHdXS-cQ

 

This webinar should help you solve your problem. 

Learn how to connect to APIs in Alteryx, no coding required. In this webinar we will connect to the Foreign Exchange Rates API (https://exchangeratesapi.io) to bring historical or latest exchange rates directly into your workflow. Links ...
Luke_C
17 - Castor
17 - Castor

Hi @Rahul_Analyst 

 

While not exactly an API, Yahoo Finance works nicely for this last I checked. I would doubt that you'll find a free API service to do this. Take a look at my solution from the below post:

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Currency-Converter/td-p/748383

 

Rahul_Analyst
9 - Comet

@Luke_C , Thanks for the response. I got a few queries using it.

1) I could see data for upcoming days and months in output, is it pridicting the fx rates ?

2) It is creating new headers for different pairs. In this example, another header is created for CADUSD (record no. 262). why ? how to get only one header ?

3)If I verify fx rates from alteryx and on website by the link given by you. It is not matching. Records -238, here EURUSD vale is 1.190.. but on website 0.90... why is it ?

Rahul_Analyst_0-1647528464810.png

 

Luke_C
17 - Castor
17 - Castor

Hi @Rahul_Analyst - the dates there are last year, does that resolve the questions? 

For the CAD, I'm not seeing that? Can you share your workflow?

Rahul_Analyst
9 - Comet

Hi @Emil_Kos, thanks for the respnse. I treid using the API link given in the video. However, it is giving me error.

 

This is the error-

 

{
"success": false,
"error": {
"code": 101,
"type": "missing_access_key",
"info": "You have not supplied an API Access Key. [Required format: access_key=YOUR_ACCESS_KEY]"
}
}
 

Rahul_Analyst
9 - Comet

@Luke_C , got it, I did not pay attention earlier. I want to get latest rates when I run the workflow. is it possible ? the workflow is same as you provided. I did not make any change.

Luke_C
17 - Castor
17 - Castor

Hi @Rahul_Analyst , the workflow is a year old.. you may need to tweak the URL. I believe the highlighted part controls the date. You should be able to navigate to the yahoo finance page for a currency and find the new URL.  Let me know if you have any issues.

 

Luke_C_0-1647529662343.png

 

 

Rahul_Analyst
9 - Comet

@Luke_C , thanks, by changing the portion, you highlighted, it worked. However, again I got another header in between. Please see in the attached workflow. 

 

 

Luke_C
17 - Castor
17 - Castor

Hi @Rahul_Analyst 

 

Got it, just add a filter tool to take care of it. Each currency comes back in as it's own table, so not surprising they're getting unioned like that. Please consider accepting as the solution if this works. You could probably make the URL more dynamic if needed, for reference the dates in the URL are in epoch format (there are resources here on how to convert to normal dates if needed).

 

For your point on the API, you would need to register with whatever the API provider is and get your own API token.

 

Luke_C_0-1647530689721.png

 

 

Labels
Top Solution Authors