-1

What I'm trying to do:

Dynamically import the bitcoin/BTC price, from https://www.luno.com/en/price/, OR https://www.luno.com/en/price/BTC.

So I've read everything there is to read (on this site anyway) about importXML, and cannot find what I'm doing wrong. My method works on other websites, where I get a list of expected results, however, using importXML is not working. See below code I'm using (I've used other variants, but this is the one suggested using SelectorGadget:

=IMPORTXML("https://www.luno.com/en/price/", "//*[contains(concat( ' ', @class, ' ' ), concat( ' ', 'ng-binding', ' ' ))]")

Of course, I get the dreaded " Imported Content is Empty " error.

Any help?

Mika Sundland
  • 18,120
  • 16
  • 38
  • 50
Wazza
  • 1
  • 1
  • Nothing. I tried to add, but it wouldn't let me add anything useful, and suggested angularjs, failing, it would not accept my post. – Wazza Dec 07 '17 at 13:44

1 Answers1

-1

You can load this ajax endpoint to get the current USD:

https://www.luno.com/ajax/1/display_ticker

or for all currency pairs:

https://www.luno.com/ajax/1/price_chart?currency=

if your want to parse the json - there is a wonderful - already written importJson script (https://github.com/bradjasper/ImportJSON/blob/master/ImportJSON.gs), you literally just copy paste it into your apps script and then call the url directly as such:

=importJSON("https://www.luno.com/ajax/1/price_chart?currency=")

or

=importJSON("https://www.luno.com/ajax/1/display_ticker?currency=XBT")

enter image description here

enter image description here

Aurielle Perlmann
  • 5,323
  • 1
  • 15
  • 26