I am trying to fetch data from the coinmarketcap api. It worked through Postman once yesterday, but then ever since I keep attempting to hit the api I keep getting this error:
GET /cryptocurrency/info?id=1 200 - - 190.846 ms
error Error: write EPROTO 4375776704:error:1408F10B:SSL
routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
This also happens when I attempt to call the api through a proxy server.
const requestOptions = {
method: "GET",
uri: "https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest",
qs: {
start: "1",
limit: "10",
convert: "USD",
},
headers: {
"X-CMC_PRO_API_KEY": "my_api_key",
"Accept": "application/json",
},
json: true,
gzip: true,
};
Everything I read says to just change https to http but the api is definitely https and I've tried every variation just in case (including http://localhost for the proxy layer). I've also signed up for a different API account in case the key I had originally was compromised from my initial experimenting. However the new key has the same issue.
I've run out of ideas here, does anyone else know what could be wrong?