title: Get and show json data from website's APIs in Delphi XE
body: <p>I am trying to re-write a piece of code I wrote in Python to Delphi. 
  The Python code is:</p>
  
  <pre><code>url = "https://www.bitstamp.net/api/ticker/"
  response = urllib.urlopen(url)
  data = json.loads(response.read())
  lastvalue = data['last']
  </code></pre>
  
  <p>And this is enough to assign to the variable called "lastvalue" the value that I get from bitstamp's API. </p>
  
  <p>I would like to do the same thing with delphi (I am using delphi XE6). I tried to find some answer here, and I am able to connect to the bitstamp's website and to get the full string, by doing this: </p>
  
  <pre><code>function GetURLAsString(const aurl:  string): string;
  var
    lHTTP: TIdHTTP;
  begin
    lHTTP := TIdHTTP.Create(nil);
    try
      lHTTP.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(lHTTP);
      Result := lHTTP.Get(aURL);
    finally
      lHTTP.Free;
    end;
  end;
  </code></pre>
  
  <p>And then I call this function with this: </p>
  
  <pre><code>procedure TForm2.Button1Click(Sender: TObject);
  var
  mydata : string;
  
  begin
  mydata := GetURLAsString('https://www.bitstamp.net/api/ticker/');
  Label1.Text := mydata;
  end;
  </code></pre>
  
  <p>I'm stuck here. I searched a lot but I am not able to figure out how can I assign to Label1.Text just the value assigned to "last".</p>
  
  <p>When I run this I get <code>{"high": "629.40", "last": "622.00", "timestamp": "1401544416", "bid": "621.99", "vwap": "617.47", "volume": "15147.30475739", "low": "602.26", "ask": "622.00"}</code> assigned to Label1.Text.</p>
  
  <p>I hope I was able to explain the question. I am really stuck in this point for some days, I hope someone can help me. </p>