Sem ver o json que é retornado realmente fica complicado de ter uma boa idéia de como resolver, mas acredito que com um simples .replace('[', '').replace(']', '') dê para resolver.

PS: Não que seja a melhor forma, mas é como eu faria. 😁

Fiz a alteração sugerida mas ainda retornou com o mesmo problema. Segue o código:

import requests

def f_answers():
    for ticket_number in range (0, 1000):
        no_data1 = '{"error":"Ticket not found"}'
        no_data2 ='[]'
        url = 'https://api.tiflux.com/api/v1/tickets/{}/answers?offset=1&limit=200'.format(ticket_number)
        headers = {
            'Content-Type': 'application/json',
            'Authorization': 'Basic {token}'
        }
        
        answers = requests.get(url, headers = headers)
        
        if answers.text == no_data1:
            print('O ticket nº{} não existe.'.format(ticket_number))
        elif answers.text == no_data2:
            print('O ticket nº{} não há respostas.'.format(ticket_number))                           
        else:           
            file_json = open('/home/trade/_business_intelligence/Indicadores/infra_sustentacao/json/_tiflux/_answers/_answers.json', 'a', encoding = 'utf-8')
            file_json.write(answers.text.replace('][', ''))
            url = 'https://api.tiflux.com/api/v1/tickets/{}/answers?offset=1&limit=200'.format(ticket_number)
            answers = requests.get(url, headers = headers)
            
        
        
f_answers()
`[EDIT]` Testei com a API aqui do TabNews e deu certinho: --- Então, subentendendo que o seu arquivo `"/home/trade/_business_intelligence/Indicadores/infra_sustentacao/json/_tiflux/_answers/_answers.json"` já possui uma lista dentro dele, mesmo que vazia `[]` eu usaria da seguinte maneira: ```py import requests import json def f_answers(): for ticket_number in range(0, 1): no_data1 = '{"error":"Ticket not found"}' no_data2 = '[]' url = 'https://api.tiflux.com/api/v1/tickets/{}/answers?offset=1&limit=200'.format(ticket_number) headers = { 'Content-Type': 'application/json', 'Authorization': 'Basic {token}' } answers = requests.get(url, headers=headers) if answers.text == no_data1: print('O ticket nº{} não existe.'.format(ticket_number)) elif answers.text == no_data2: print('O ticket nº{} não há respostas.'.format(ticket_number)) else: answer_JSON = answers.json() file_path = '/home/trade/_business_intelligence/Indicadores/infra_sustentacao/json/_tiflux/_answers/_answers.json' with open(file_path, 'r+', encoding='utf-8') as file: # Lê o conteúdo do arquivo file_json = json.load(file) # Modifica o conteúdo do arquivo for answer in answer_JSON: file_json.append(answer) # Volta para o início do arquivo file.seek(0) # Sobrescreve o conteúdo do arquivo com o conteúdo modificado json.dump(file_json, file, indent=4) f_answers() ``` Note que será necessário a biblioteca `json`. Além disso, é recomendado usar o gerenciador de contexto `with` para abrir o arquivo, pois isso garante que o arquivo será fechado corretamente após a leitura.