Always get 403 forbidden when use await mexc.loadMarkets()
See original GitHub issueWhen I’m going to load all the markets from below, I will always the the error below even if I tried to change my IP address, but it will success last week, and now I can even runs well using command line on Terminal: curl https://www.mexc.com/open/api/v2/market/coin/list
- OS: MACOS/ LINUX
- Programming Language version: nodejs 18.02
- CCXT version: latest
export const exchangeArray = [
{name: "kraken", exchange: kraken},
{name: "bitfinex", exchange: bitfinex},
{name: "huobipro", exchange: huobipro},
{name: "okex", exchange: okex},
{name: "mexc", exchange: mexc},
{name: "binance", exchange: binance},
{name: "kucoin", exchange: kucoin},
// {name: "gateio", exchange: geteio}
]
export const loadExchanges = async () => {
let promises = [];
for (let i = 0; i < exchangeArray.length; i++) {
promises.push(exchangeArray[i].exchange.loadMarkets())
}
await Promise.all(promises)
return "success"
}
ExchangeNotAvailable: mexc GET https://www.mexc.com/open/api/v2/market/coin/list 403 Forbidden <HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD><BODY>
<H1>Access Denied</H1>
You don't have permission to access "http://www.mexc.com/open/api/v2/market/coin/list" on this server.<P>
Reference #18.1fcbdc17.1669729350.8cdc15
</BODY>
</HTML>
at mexc.handleHttpStatusCode (/Users/amandachadwick/PycharmProjects/freelancer/0_mine/node_modules/ccxt/js/base/Exchange.js:753:19)
at /Users/amandachadwick/PycharmProjects/freelancer/0_mine/node_modules/ccxt/js/base/Exchange.js:600:22
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async timeout (/Users/amandachadwick/PycharmProjects/freelancer/0_mine/node_modules/ccxt/js/base/functions/time.js:181:20)
at async mexc.fetch2 (/Users/amandachadwick/PycharmProjects/freelancer/0_mine/node_modules/ccxt/js/base/Exchange.js:1901:16)
at async mexc.request (/Users/amandachadwick/PycharmProjects/freelancer/0_mine/node_modules/ccxt/js/base/Exchange.js:1905:16)
at async mexc.fetchCurrencies (/Users/amandachadwick/PycharmProjects/freelancer/0_mine/node_modules/ccxt/js/mexc.js:408:26)
at async mexc.loadMarketsHelper (/Users/amandachadwick/PycharmProjects/freelancer/0_mine/node_modules/ccxt/js/base/Exchange.js:624:26)
at async Promise.all (index 4)
at async loadExchanges (file:///Users/amandachadwick/PycharmProjects/freelancer/0_mine/cex/cex.js:32:5) {
constructor: [class ExchangeNotAvailable extends NetworkError]
}
Node.js v18.12.1
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
What Is the 403 Forbidden Error and How to Fix It (8 Methods ...
403 Forbidden – you don't have permission to access this resource is an HTTP status code that occurs when the web server understands...
Read more >How to Fix the 403 Forbidden Error (2 Methods That Work)
The 403 forbidden error can bar access to a website. In this post, we'll show you a few easy ways to fix this...
Read more >403 Forbidden error: What it is and how to fix it - Allconnect.com
Status code 403; Access denied. Before we jump into how to solve the issue, let's explore why you're getting the message in the...
Read more >HTTP 403: Forbidden error when starting jupyterhub #1377
Hi, I have been trying to use jupyterhub for a while now but I am struggling with a 403 error which I cannot...
Read more >How to Fix a 403 Forbidden Error on Your WordPress Site
The 403 Forbidden error indicates that the server understood the request but refuses to authorize it. Find out more about the causes and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On my machine,
curl
works butfetch
only works in the browser - not on Node.js (v19).It’s not the IP, or the request content/headers, nor the
User-Agent
. Akamai is fingerprinting and blocking these HTTPS requests to MEXC based on your TLS ciphers. Explanation here, but I agree that MEXC should fix this.Until then, just reorder your TLS ciphers at the start of your program. Fixed it for me.
issue has been fixed by mexc API.