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

204
Visualizações
Getting network error while sending an API request

I am sending an API request to: https://api.chart-img.com/v1/tradingview/advanced-chart?key={API_KEY} It also requires a Bearer token in the header which is also included. When I send the call through Postman, I get the expected response. This is my request:

const API_KEY = "bbd46466-5c55-427b-aaa7-7a19b6ea7e07";
const API_URL = `https://api.chart-img.com/v1/tradingview/advanced-chart?key=${API_KEY}`;

const Header = {
  Authorization: `Bearer ${API_KEY}`,
};

axios.get(API_URL, Header).then((res) => console.log(res));

But when I send the call from my code, I receive this error:

The error message

It is working fine on postman and not in my code, can I assume it is some sort of security issue like CORS? Any help in this will be appreciated. The link to the documentation is given:

https://doc.chart-img.com/

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You have to use

axios.get(API_URL, { headers: Headers }).then((res) => console.log(res));
about 4 years ago · Juan Pablo Isaza Relatório

0

You don't need to put API_KEY inside Authorization header. Just write it as API_URL. As mentioned in documentation.

documentation

const axios = require("axios")
const API_URL = `https://api.chart-img.com/v1/tradingview/advanced-chart?key=XXX`
axios.get(API_URL).then((res) => console.log(res));
about 4 years ago · Juan Pablo Isaza Relatório
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