This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * @return Acessa radaropcoes.com e retorna informações de um título específico do Tesouro Direto | |
| * Endpoint: https://api.radaropcoes.com/bonds/{bondName} | |
| */ | |
| function TESOURODIRETO(bondName, argumento = "r") { | |
| let srcURL = "https://api.radaropcoes.com/bonds/" + encodeURIComponent(bondName); | |
| let response = UrlFetchApp.fetch(srcURL, { | |
| muteHttpExceptions: true | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * @return Retorna a cotação atual de um título específico do Tesouro Direto Junto com a taxa anual de retorno | |
| * @customfunction | |
| **/ | |
| function TESOURODIRETO(bondName) { | |
| let srcURL = "https://www.tesourodireto.com.br/json/br/com/b3/tesourodireto/service/api/treasurybondsinfo.json"; | |
| let jsonData = UrlFetchApp.fetch(srcURL); | |
| let parsedData = JSON.parse(jsonData.getContentText()).response; | |
| for(let bond of parsedData.TrsrBdTradgList) { |