Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
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 answers
Answer question

0

You have to use

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

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!