Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate values for parameter 'symbols[]' https://api.binance.com/api/v3/ticker #507

Closed
jamesbayly opened this issue Jan 30, 2025 · 5 comments · Fixed by #508
Closed

Duplicate values for parameter 'symbols[]' https://api.binance.com/api/v3/ticker #507

jamesbayly opened this issue Jan 30, 2025 · 5 comments · Fixed by #508
Labels

Comments

@jamesbayly
Copy link

  const binanceData = await binanceClient.getRollingWindowTicker({
    symbols: ["BTCUSDT", "ETHUSDT"],
    windowSize: "5m",
    type: "MINI",
  });

results in

System.Private.CoreLib: Exception while executing function: Functions.getBinanceOHLC. System.Private.CoreLib: Result: Failure
[2025-01-30T07:40:54.066Z] Exception: {"code":-1101,"message":"Duplicate values for parameter 'symbols[]'.","body":{"code":-1101,"msg":"Duplicate values for parameter 'symbols[]'."},"headers":{"content-type":"application/json;charset=UTF-8","content-length":"66","connection":"keep-alive","date":"Thu, 30 Jan 2025 07:40:54 GMT","server":"nginx","x-mbx-uuid":"bff4a073-2449-437f-8084-8f5d7c993668","x-mbx-used-weight":"6","x-mbx-used-weight-1m":"6","strict-transport-security":"max-age=31536000; includeSubdomains","x-frame-options":"SAMEORIGIN","x-xss-protection":"1; mode=block","x-content-type-options":"nosniff","content-security-policy":"default-src 'self'","x-content-security-policy":"default-src 'self'","x-webkit-csp":"default-src 'self'","cache-control":"no-cache, no-store, must-revalidate","pragma":"no-cache","expires":"0","x-cache":"Error from cloudfront","via":"1.1 360cdb248de2ad362090d67754f85dba.cloudfront.net (CloudFront)","x-amz-cf-pop":"NRT57-P2","x-amz-cf-id":"9ysqM0kmnCv8SEdIbYKan14WzyKKUF07Kl-qMsxvlp_lRFGstZahTg=="},"requestUrl":"https://api.binance.com/api/v3/ticker","requestOptions":{"recvWindow":5000,"syncIntervalMs":3600000,"strictParamValidation":false,"disableTimeSync":true}}
[2025-01-30T07:40:54.066Z] Stack: Error: {"code":-1101,"message":"Duplicate values for parameter 'symbols[]'.","body":{"code":-1101,"msg":"Duplicate values for parameter 'symbols[]'."},"headers":{"content-type":"application/json;charset=UTF-8","content-length":"66","connection":"keep-alive","date":"Thu, 30 Jan 2025 07:40:54 GMT","server":"nginx","x-mbx-uuid":"bff4a073-2449-437f-8084-8f5d7c993668","x-mbx-used-weight":"6","x-mbx-used-weight-1m":"6","strict-transport-security":"max-age=31536000; includeSubdomains","x-frame-options":"SAMEORIGIN","x-xss-protection":"1; mode=block","x-content-type-options":"nosniff","content-security-policy":"default-src 'self'","x-content-security-policy":"default-src 'self'","x-webkit-csp":"default-src 'self'","cache-control":"no-cache, no-store, must-revalidate","pragma":"no-cache","expires":"0","x-cache":"Error from cloudfront","via":"1.1 360cdb248de2ad362090d67754f85dba.cloudfront.net (CloudFront)","x-amz-cf-pop":"NRT57-P2","x-amz-cf-id":"9ysqM0kmnCv8SEdIbYKan14WzyKKUF07Kl-qMsxvlp_lRFGstZahTg=="},"requestUrl":"https://api.binance.com/api/v3/ticker","requestOptions":{"recvWindow":5000,"syncIntervalMs":3600000,"strictParamValidation":false,"disableTimeSync":true}}
@tiagosiebler
Copy link
Owner

That's a bug! Binance has a peculiar way of handling arrays in requests - I'll push a fix shortly. Thanks for reporting it!

tiagosiebler added a commit that referenced this issue Jan 30, 2025
tiagosiebler added a commit that referenced this issue Jan 30, 2025
tiagosiebler added a commit that referenced this issue Jan 30, 2025
fix(v2.15.6, #507): correct handling for symbols array in rolling window tickers endpoint
@tiagosiebler
Copy link
Owner

Hi @jamesbayly - merged via #508

Should be on npm shortly, as of version v2.15.6. Thanks again for reporting it - let me know if you notice any other issues.

@jamesbayly
Copy link
Author

Thanks for the quick fix, tested and confirmed!

@jamesbayly
Copy link
Author

Hi @tiagosiebler I believe you've created another bug during this fix:

getRollingWindowTicker(params) {
        if (params && params['symbols'] && Array.isArray(params['symbols'])) {
            const symbolsQueryParam = JSON.stringify(params.symbols);
            return this.get('api/v3/ticker?symbols=' + symbolsQueryParam);
        }
        return this.get('api/v3/ticker', params);
    }

if I include symbols then you discard the other params provided (including windowSize?: string and type?: 'FULL' | 'MINI')

@tiagosiebler
Copy link
Owner

Hi @tiagosiebler I believe you've created another bug during this fix:

That was a silly mistake, and a reminder for me to be more careful when multitasking. Apologies, fix incoming via #511 - should be on npm shortly as of v2.15.7. Thank you for pointing it out.

tiagosiebler added a commit that referenced this issue Feb 1, 2025
fix(v2.5.7, #507): fix missing parameters when passing symbols in rolling tickers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants