Getting Real-time exchange rates for currency - URLFETCH

I’m trying to get real-time currency exchange rates for 1 USD to KRW

To achieve this, I was hoping to urlfetch a google search result

shor url : https://bit.ly/2So7Acz

https://www.google.com/search?q=1+USD+to+KRW&sxsrf=ALeKk01NN-SiwQ8_T3GcC6CKeQtA22qX-Q%3A1620392386588&ei=wjmVYOu5I669hwP55pfABA&oq=1+USD+to+KRW&gs_lcp=Cgdnd3Mtd2l6EAMyBwgAEEYQggIyBQgAEMsBMgUIABDLATICCAAyBAgAEB4yBggAEAgQHjIGCAAQCBAeMgYIABAIEB4yBggAEAgQHjIGCAAQBRAeOgcIIxCwAxAnOgQIIxAnOgUIABCxAzoICAAQsQMQgwE6BAgAEEM6BwgAEIcCEBQ6BAgAEAo6BggAEAoQHlCy7wRYvYgFYMqKBWgDcAB4AIABdogBpwuSAQQwLjEzmAEAoAEBqgEHZ3dzLXdpesgBAcABAQ&sclient=gws-wiz&ved=0ahUKEwjrouWE0LfwAhWu3mEKHXnzBUgQ4dUDCA4&uact=5

and hopefully, possible parse the following span class

< span class=“DFlfde SwHCTb” data-precision=“2” data-value=“1116.335”>1,116.34</ span>

to retrieve the data-value.

Can this be done?

$(eval try{a=$(urlfetch ★★★ https://bit.ly/2So7Acz);${parseFloat(a.data-value)};}catch(e){Error!;})

Hey @cdtank!

We can’t exploit the output of a Google Search result, your best bet is to look for an API, I’m sure there are plently.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.