title: Delphi JSON parser
body: <p>My current code: </p>
  
  <pre><code>procedure TForm1.Button10Click(Sender: TObject);
  var
    IdHTTP: TIdHTTP;
    IdSSL: TIdSSLIOHandlerSocketOpenSSL;
    JSON: string;
    jsonObiekt: TJSONObject;
    streams: TJSONValue;
    liczbaStrumieni: integer;
    i: integer;
  begin
    IdHTTP := TIdHTTP.Create;
    try
      IdSSL := TIdSSLIOHandlerSocketOpenSSL.Create(IdHTTP);
      IdHTTP.IOHandler := IdSSL;
      IdHTTP.Request.CustomHeaders.AddValue('Accept', 'application/vnd.twitchtv.v3+json');
      IdHTTP.Request.CustomHeaders.AddValue('Client-ID', 'smb61nyd0vxmqdn9d3k735qbx41cdyg');
      JSON := IdHTTP.Get('https://api.twitch.tv/kraken/streams?game=StarCraft:%20Brood%20War');
    finally
      IdHTTP.Free;
    end;
    jsonObiekt := nil;
    try
      jsonObiekt := TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(JSON), 0) as TJSONObject;
      streams := jsonObiekt.Get('streams').JsonValue;
      liczbaStrumieni := TJSONArray(streams).Size;
      for i := 0 to liczbaStrumieni - 1 do
      begin
        Memo6.Lines.Add(TJSONObject(TJSONArray(streams).Get(i)).Get('viewers').JsonValue.Value);
      end;
    finally
      jsonObiekt.Free;
    end;
  end;
  </code></pre>
  
  <p>With this code i am able to get viewers for every entries in "streams" 
  <img src="https://i.stack.imgur.com/DCzfs.png" alt="enter image description here"></p>
  
  <p>My goal is to get "status" from "channel", but thats too hard for me. Tried learn from this <a href="https://stackoverflow.com/questions/10808912/how-to-parse-nested-json-object-in-delphi-xe2">How to parse nested JSON object in Delphi XE2?</a> but no result, still dont understand it well. Thanks for help. </p>