Stock Price

FREEMIUM
By fridaystock | Updated 21 день назад | Finance
Popularity

6.9 / 10

Latency

221ms

Service Level

100%

Health Check

N/A

Back to All Discussions

Getting 502 (Bad Gateway) Error

Rapid account: Jwdlmh A V Td Be 3 Wfyd
jwdlmh-aVTdBe3Wfyd
2 года назад

I am getting a 502 (Bad Gateway) error when I do the fetch api in Javascript. Plus message that says {message: ‘API Request failed due to Provider configuration e…application/json. Please contact the API Provider’, info: ‘Your Client (working) —> Gateway (working) —> API (not working)’}

It says to contact API provider. Wondering if you guys know how I can fix this issue?

Rapid account: Fridaystock
fridaystock Commented 2 года назад

Hello!
Thanks for reaching out. I just tested this both via the sandbox console and JS axios and all seems to be working as intended. Are you still having this issue? Here’s some example code to try with.

const axios = require("axios");

const options = {
    method: 'GET',
    url: 'https://stock-price4.p.rapidapi.com/price/TSLA',
    headers: {
        'X-RapidAPI-Host': 'stock-price4.p.rapidapi.com',
        'X-RapidAPI-Key': 'YOURKEY'
    }
};

axios.request(options).then(function (response) {
    console.log(response.data);
}).catch(function (error) {
    console.error(error);
});

Join in the discussion - add comment below:

Login / Signup to post new comments