title: Is there a better way to find price data using Kraken's API?
body: <p>I am trying to find how to pluck the price data of a coin from Kraken's crypto exchange. Here is my code:</p>
  <pre><code>def populateArray():
      priceChange = ['/', '/', '/', '/', '/', '/', '/', '/', '/', '/']
      prices = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
  
      while True:       
          for i in range(10):
              priceChange[9 - i] = priceChange[8 - i]
          for i in range(10):
              prices[9 - i] = prices[8 - i]
          resp = requests.get('https://api.kraken.com/0/public/Ticker?pair=XDGUSD').text
          prices[0] = resp[38:49:1] 
  
          while(float(prices[0]) == float(prices[1])):
              resp = requests.get('https://api.kraken.com/0/public/Ticker?pair=XDGUSD').text
              prices[0] = resp[38:49:1] 
  
          if float(prices[0]) &lt; float(prices[1]):
              priceChange[0] = '-'
          elif float(prices[0]) &gt; float(prices[1]):
              priceChange[0] = '+'
          time.sleep(1)
          print(prices)
          print(priceChange)
  </code></pre>
  <p>This is very simple, all it does is check if a price change is detected and then log it into an array. However, I am not a big fan of having to use a substring to find the information from the Response object. I am using .text to output the text of the ticker information, but I feel like there may be a better way than using a substring of the .text output. Any help is appreciated, thank you in advance!!</p>
  <pre><code>resp = requests.get('https://api.kraken.com/0/public/Ticker?pair=XDGUSD').text
  prices[0] = resp[38:49:1] 
  </code></pre>
  <p>This is the part that finds the substring.</p>