Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

287
Visualizações
FetchError: request to https://api.polygon.io/v2/aggs/ticker/ITRG

I have over 4000 tickers in sqlite3 and when I retrieve the tickers I want to pull the data for each tickers from polygon.io and then save the data to sqlite3. But my problem is when I am iterating the tickers to get the data I get an error, errno: 'ETIMEDOUT', if I rerun it again I get the same error but on a different tickers. So, my question is what am I doing wrong or is it from polygon.

This is my output:

FetchError: request to https://api.polygon.io/v2/aggs/ticker/ITRG/range/1/day/2021-12-27/2021-12-27?adjusted=true&sort=asc&limit=120&apiKey=APIKEY failed, reason: connect ETIMEDOUT 198.44.194.42:443
    at ClientRequest.<anonymous> (c:\Users\mo654\OneDrive\Desktop\snapchat2\node_modules\node-fetch\lib\index.js:1461:11)
    at ClientRequest.emit (node:events:390:28)
    at TLSSocket.socketErrorListener (node:_http_client:447:9)
    at TLSSocket.emit (node:events:390:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT'
}

const candle2 = require("./test2");
const AppDAO = require('./dao')
const ProjectRepository = require('./project_repository')
const TaskRepository = require('./task_repository')


async function asyncCall() {
    const dao = new AppDAO('./Stocks.db')
    const projectRepo = new ProjectRepository(dao)
    const taskRepo = new TaskRepository(dao)
    const bar = new candle2()

    projectRepo.getAll()
    .then(ticks =>{
        ticks.forEach(element => {
            bar.dailyBar(element.Tickers, '2021-12-27', '2021-12-27').then(result =>{
                if (result !== undefined){
                    console.log(result)
                    for (i = 0; i < result.length; i++){
                        taskRepo.create(element.Id, result[i].t, result[i].o, result[i].h, result[i].l, result[i].c, result[i].v)
                    }
                }
            })
        });
    })
}
asyncCall()

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda