{"id":19902604,"url":"https://github.com/keivanipchihagh/kucoin-websocket","last_synced_at":"2025-11-24T15:11:46.594Z","repository":{"id":60934565,"uuid":"546723013","full_name":"keivanipchihagh/kucoin-websocket","owner":"keivanipchihagh","description":"Multi-threaded KuCoin WebSocket with self-management mechanisms to ensure stable streaming at all times","archived":false,"fork":false,"pushed_at":"2022-10-07T08:26:06.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-24T09:25:00.587Z","etag":null,"topics":["kline","kucoin","kucoin-api","kucoin-token","self-managed","websocket"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/kucoin-websocket/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keivanipchihagh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-06T14:38:19.000Z","updated_at":"2023-01-16T15:26:41.000Z","dependencies_parsed_at":"2022-10-07T02:44:46.980Z","dependency_job_id":null,"html_url":"https://github.com/keivanipchihagh/kucoin-websocket","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keivanipchihagh%2Fkucoin-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keivanipchihagh%2Fkucoin-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keivanipchihagh%2Fkucoin-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keivanipchihagh%2Fkucoin-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keivanipchihagh","download_url":"https://codeload.github.com/keivanipchihagh/kucoin-websocket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241329416,"owners_count":19944985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kline","kucoin","kucoin-api","kucoin-token","self-managed","websocket"],"created_at":"2024-11-12T20:18:37.434Z","updated_at":"2025-11-24T15:11:46.587Z","avatar_url":"https://github.com/keivanipchihagh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kucoin-websocket\nMulti-threaded KuCoin WebSocket with self-management mechanisms to ensure stable streaming at all times. More control and abstraction than the native [kucoin-python-sdk](https://github.com/Kucoin/kucoin-python-sdk).\n\u003e **Note**\n\u003e This package is still under development and probably will not contain the full functionality described under [KuCoin documentation](https://docs.kucoin.com/#websocket-feed)!\n\n## Features\n### Subscription Strategy\nAccording to [KuCoin documentations](https://docs.kucoin.com/#request-rate-limit), maximum number of batch subscriptions is **100 topics per 10 seconds**. KuCoin policy is to ignore the rest of the subscriptions if the limitation is violated. To avoid this behavior, a configurable **Backoff Strategy** is used to keep congestion low while allowing for asynchronous subscription.\n\n### Auto-connect on Errors\nThere are numerous errors that can occur during the stream ([KuCoin errors](https://docs.kucoin.com/#request)) that can interrupt the stream flow. Most of the errors are *TimeOut* or *ConnectionClosed* and such errors are generally not a big concern due to network volatility, so the WebSocket tries to reconnect at most 5 times before giving up.\n\n### Auto-Token Renewal\nCurrently, KuCoin tokens expire after **24 hours** ([KuCoin FAQ](https://docs.kucoin.com/#faq)) and the stream is stopped immediately. To overcome this, WebSocket details like *token* and *endpoint* are renewed after an interval, so that the connection stays alive at all time. Default interval is set to **12 hours** to leave no room for error.\n\n### Limitless Subscriptions\nKuCoin has a limitation of maximum **300 active subscriptions** at the time ([KuCoin FAQ](https://docs.kucoin.com/#faq)). To scale the subscriptions, multiple WebSockets are automatically created on parallel threads that at most **200 subscriptions**. (*to my experience, better not challenge the threshold* ^_^)\n\n## Credits\n- [python-kucoin](https://github.com/sammchardy/python-kucoin) by sammchardy\n\n## 🤝 Contribution \nYour contributions are welcomed, as always!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeivanipchihagh%2Fkucoin-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeivanipchihagh%2Fkucoin-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeivanipchihagh%2Fkucoin-websocket/lists"}