title: How to read from different sheets in a spreadsheet using gid value. Google sheets API
body: <p>I am using the <a href="https://developers.google.com/sheets/api/reference/rest/" rel="nofollow noreferrer">Google Sheets API</a> to read data from a spreadsheet, but that spreadsheet has many sheets inside it. And I could not find a way to specify which sheet I have to read from, using the <code>gid</code> value in the link of the spreadsheet.</p>
  
  <p>My code which retrieves data is:</p>
  
  <pre><code>ValueRange result = service.spreadsheets().values().get(spreadsheetId, range).execute();
  </code></pre>
  
  <p>In the above <code>get()</code> method there is an argument for <code>spreadsheetId</code>, but not for <code>sheetId</code>. How can I specify the sheet I want to retrieve data from?</p>