title: How to get more API records when the response size is limited
body: <p>I don't have much experience with React or JavaScript. I am creating a simple application that fetches time series data from an API. The data is used to plot a line chart (React Apex Chart). All good.</p>
  
  <p>The problem is that the API response size is limited to a maximum of 2,000 records, and sometimes we need more data.</p>
  
  <h3>The API documentation says:</h3>
  
  <p><i> The response size is limited to a maximum of 2,000 records. If more records have to be returned, the response header contains a Link header with a URI to get the next set of records:</p>
  
  <p>Link: <a href="https://apiurl" rel="nofollow noreferrer">https://apiurl</a>; rel="next" </i></p>
  
  <h3>My Fetch Code:</h3>
  
  <p>My code fetches the api data, sorts it and sends it to the child component(Chart).</p>
  
  <pre><code>  FetchAPI(){
      fetch(https://MYURLHERE?from=FROMDATE&amp;to=TODATE)
        .then(response =&gt; response.json())
        .then(data =&gt; this.setState({ 
          kWhData: data.map((kWh) =&gt; kWh._kWh),
          TimeStampData: data.map((time) =&gt; time._time),
          loading: false
        }))
        .catch(error =&gt; console.log('Fetching failed', error))
    }
  </code></pre>
  
  <pre><code>Link header: link →&lt;https://MYURLHERE?from=FROMDATE&amp;limit=2000&amp;to=TODATE&gt;; rel="next"&gt;
  </code></pre>
  
  <p>I know the solution may be some kind of pagination but I do not fully understand this concept. I have searched for similar problems with no luck.</p>
  
  <p>Hope someone could provide me with a helping hand, tips or code.</p>