Getting Real-time exchange rates for currency - URLFETCH

Asked May 7, 2021·1 reply·Last activity 5 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

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_T3GcC6CKeQ…

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!;})

1 reply

Hey @Frank Narwhal!

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.