Se você encontrar erros 500 ao usar a API Sheets, isso
normalmente indica que há um problema com a própria API. Envie um relatório de bug
no Issue Tracker da API Planilhas com a solicitação que causou
o erro.
503 Service Unavailable
A API Sheets retorna um erro 503 quando o serviço está indisponível ou
quando a complexidade da solicitação ou planilha é alta. Confira a seguir algumas sugestões para limitar a taxa de erros 503 modificando as solicitações da API e a planilha.
Solicitação
Use batchUpdate para combinar atualizações relacionadas em uma única solicitação.
Tenha cuidado ao agrupar atualizações grandes, porque isso pode acionar um
tempo limite.
Limite o número de solicitações simultâneas para a API por planilha a uma
por segundo.
Para planilhas grandes, extraia apenas os valores necessários usando a notação A1 e limite o uso de includeGridData.
Use máscaras de campo para limitar a quantidade de dados retornados pela API.
Use a espera exponencial para ajudar nas tentativas.
Planilha
Para planilhas atualizadas com frequência, alterne para uma nova planilha periodicamente para
reduzir a acumulação de versões.
[null,null,["Última atualização 2024-12-21 UTC."],[[["This page provides troubleshooting steps for common errors (`400`, `500`, `503`) when using the Google Sheets API."],["The Google Status Dashboard offers real-time updates on the Sheets API's status and can help identify potential service disruptions."],["For `503` errors, strategies include batching updates, limiting concurrent requests, optimizing data retrieval, and simplifying spreadsheet structure."],["When encountering a `400` error, refer to the API documentation and support page to ensure your request is properly formatted."],["`500` errors typically indicate an issue with the Sheets API itself and should be reported through the Issue Tracker with the request details."]]],["The Sheets API's Status Dashboard is the first place to check for errors. `400 Bad Request` errors indicate a malformed request; consult the reference and support documentation. `500 Internal Server Error` signifies an API issue; file a bug report. `503 Service Unavailable` errors can be mitigated by using `batchUpdate`, limiting concurrent requests, retrieving only necessary data, employing field masks, and using exponential backoff. For spreadsheets, reducing formula complexity and limiting access can help.\n"]]