Ferramenta do google para integrar com os seus serviços. É puramente em Javascript.
URL da documentação: https://developers.google.com/apps-script?hl=pt-br
Funções personalizadas: https://developers.google.com/apps-script/guides/sheets/functions?hl=pt-br#getting_started
Exemplo de código para preencher a primeira coluna da planilha:
function fetchPosts() {
var sheet = SpreadsheetApp.getActiveSheet();
sheet.clear(); // Clears the current sheet
var url = "https://jsonplaceholder.typicode.com/posts";
var response = UrlFetchApp.fetch(url); // Fetches the API data
var json = response.getContentText();
var data = JSON.parse(json);
// Assuming data is an array of posts
var titles = data.map(function(post) {
return [post.title]; // Returns title in an array to match the expected range format
});
// Write data to the sheet
sheet.getRange(1, 1, titles.length, 1).setValues(titles); // Writes titles starting from cell A1
}
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Fetch Data')
.addItem('Get Posts Titles', 'fetchPosts')
.addToUi();
}
(configure para rodar a função onOpen
para criar a opção do menu).