How To Fetch CoinEx API With Access ID And Secret Key In JavaScript?

I Trying To Fetch CoinEx API And Get Account Info But I Receive Error .

API Documentation :

API Invocation Description

Acquire Market Statistics

Inquire Account Info

Note : This Account Is Only For Test (Sharing Access ID And Secret Key In Public)

<script src=""></script>
<script src=""></script>
let ServerTime=0;
let AccessID="61CFB9AB7F0B46B18F26EE2E3F155F4C";
let SecretKey="109E2A9E37DD4257D4C6DEDFE3F261A269EEB98DAA48B3E1";
let Signature=CryptoJS.MD5(SecretKey).toString().toUpperCase();

async function Process()
await MarketStatistics();
await AccountInfo(ServerTime,AccessID,SecretKey,Signature);

async function MarketStatistics()
let MarketStatistics_Fetch=await fetch("");
let MarketStatistics_JSON=await MarketStatistics_Fetch.json();


async function AccountInfo(ServerTime,AccessID,SecretKey,Signature)
let AccountInfo_Fetch=await fetch(""+"?"+"access_id="+AccessID+"&"+"tonce="+ServerTime+"&"+"secret_key="+SecretKey,{method:"get",headers:{"authorization":Signature}});
let AccountInfo_JSON=await AccountInfo_Fetch.json();


Result : Signature error.

Maybe I’m misunderstanding something here:

let Signature=CryptoJS.MD5(SecretKey).toString().toUpperCase();

First of all, I would expect the hash to already be a string, and wouldn’t converting it to uppercase corrupt the hash?

Might be this?

Use 32-bit MD5 Algorithm Signature

Use MD5 algorithm to encrypt the signature string, convert encrypted result to uppercase, get signature data and put signature data in HTTP Header - authorization:

authorization: C6F0DDA352101C2258F992A277397F4A

Here is how it looks in the example demo they have:

return crypto

Although, not knowing anything about the API I’m not sure if it’s even doing the same thing. It’s just what I found skimming through it.

1 Like

I’m doing anything they said in api documentation !

Sure, it just looked odd to me.

Might not just be you.

I didn’t test anything, just wanted to let you know.