Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

194
Vistas
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 Respuestas
Responde la pregunta

0

You have to use

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

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda