Skip to content

7.1 Google Sheets

Jos de Weger edited this page Jan 1, 2019 · 2 revisions

Getting the data for a public document requires the use of the GoogleSheetAdapter. This adapter has one method for getting data: Task<Sheet> GetAsync(string sheetId, string range, string apiKey).

Parameters explained:

  • sheetId: the id of the sheet, which you can find in the url when viewing the sheet on Google Sheets
  • range: for example 'my sheet'!A1:E4
  • apiKey: your apikey for accessing https://sheets.googleapis.com/v4

Example:

var adapter = new GoogleSheetAdapter();
var sheetData = await adapter.GetAsync("my-sheet-id", "A1:E4", "my-api-key");
var result = sheetMapper.Map<MyModel>(sheetData);          
Clone this wiki locally