title: How to get all Objects from a big Array by an API (C#)
body: <p><strong>Newtonsoft.Json.JsonReaderException: &quot;Additional text encountered after finished reading JSON content</strong><br />
  <br />
  Hello,
  I try to get every Object from a big Array provided by an API (steam-API).
  I need multiple calls to get all the Objects since they are a  <strong>&quot;total_count&quot;:15228</strong>.
  This is my method to get the <a href="https://steamcommunity.com/market/search/render/?search_descriptions=0&amp;sort_column=default&amp;sort_dir=desc&amp;appid=730&amp;norender=1&amp;count=100&amp;start=0" rel="nofollow noreferrer">first page</a>, which works perfectly fine:</p>
  <pre><code>public static Task LoadAllItemsAsync()
          {
              int start=0;
              string responseData = &quot;&quot;;
              
                  
                  using (WebClient w = new WebClient())
                  {
                      responseData = responseData + w.DownloadString(&quot;https://steamcommunity.com/market/search/render/?search_descriptions=0&amp;sort_column=default&amp;sort_dir=desc&amp;appid=730&amp;norender=1&amp;count=100&amp;start=&quot; + start);
                      
                      Thread.Sleep(3000);
                      w.Dispose();
                  }
                  start = start + 100;
              
  
              
  
              dynamic parsedJson = JsonConvert.DeserializeObject(responseData);
              string jsonData = JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
              System.IO.File.WriteAllText(System.IO.Path.GetFullPath(@&quot;..\..\SteamData\SteamItems.json&quot;), jsonData);
  
              return Task.CompletedTask;
  
          }
  </code></pre>
  <p>And to get all of the Objects, I try to loop through all pages, by increasing the <strong>start value by 100</strong>, and <strong>here is where I get an exception</strong> when I try to deserialize the <strong>responsData</strong> string.
  Code:</p>
  <pre><code>public static Task LoadAllItemsAsync()
          {
              int start=0;
              string responseData = &quot;&quot;;
              for(int i = 0; i &lt;= 1; i++)
              {
                  
                  using (WebClient w = new WebClient())
                  {
                      responseData = responseData + w.DownloadString(&quot;https://steamcommunity.com/market/search/render/?search_descriptions=0&amp;sort_column=default&amp;sort_dir=desc&amp;appid=730&amp;norender=1&amp;count=100&amp;start=&quot; + start);
                      
                      Thread.Sleep(3000);
                      w.Dispose();
                  }
                  start = start + 100;
              }
  
              
  
                dynamic parsedJson = JsonConvert.DeserializeObject(responseData); //Newtonsoft.Json.JsonReaderException: &quot;Additional text encountered after finished reading JSON content
              string jsonData = JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
              System.IO.File.WriteAllText(System.IO.Path.GetFullPath(@&quot;..\..\SteamData\SteamItems.json&quot;), jsonData);
  
              return Task.CompletedTask;
  
          }
  </code></pre>
  <p>I have found something on google, but I don't understand it and I don't know how to apply it on my code.
  I highly appreciate any answers.</p>
  <p>Edit: <br>
  What I have tried:</p>
  <pre><code>public static Task LoadAllItemsAsync()
          {
              int start=0;
              string responseData = &quot;&quot;;
              string jsonData = &quot;&quot;;
              for (int i = 0; i &lt;= 1; i++)
              {               
                  using (WebClient w = new WebClient())
                  {
                      responseData = responseData + w.DownloadString(&quot;https://steamcommunity.com/market/search/render/?search_descriptions=0&amp;sort_column=default&amp;sort_dir=desc&amp;appid=730&amp;norender=1&amp;count=100&amp;start=&quot; + start);
                      dynamic parsedJson = JsonConvert.DeserializeObject(responseData);
                      jsonData = jsonData + JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
                      
                  }
                  start = start + 100;
              }
              System.IO.File.WriteAllText(System.IO.Path.GetFullPath(@&quot;..\..\SteamData\SteamItems.json&quot;), jsonData);
              return Task.CompletedTask;
          }
  </code></pre>