kucoin-python-sdk icon indicating copy to clipboard operation
kucoin-python-sdk copied to clipboard

send order with proxy

Open progmlp opened this issue 3 years ago • 6 comments

How to send a limit order request with a proxy in this module?

progmlp avatar Jul 30 '22 16:07 progmlp

How to send a limit order request with a proxy in this module?

Hi, it is the requests library used by SDK, you can modify the source code to add proxis parameter to support.

codewc avatar Aug 01 '22 07:08 codewc

Hello Thanks for your answer. How can I modify this library to send requests with proxy? I try to do that but I can't solve this problem yet. Please help me if it's possible for you. Do you have any version of this library for using proxy?

در تاریخ دوشنبه ۱ اوت ۲۰۲۲،‏ ۱۱:۳۶ codewc @.***> نوشت:

How to send a limit order request with a proxy in this module?

Hi, it is the requests library used by SDK, you can modify the source code to add proxis parameter to support.

— Reply to this email directly, view it on GitHub https://github.com/Kucoin/kucoin-python-sdk/issues/79#issuecomment-1200799668, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIWQ225U3BV5RNKJZ6ARUO3VW5ZQ7ANCNFSM55DPSYLA . You are receiving this because you authored the thread.Message ID: @.***>

progmlp avatar Aug 01 '22 15:08 progmlp

Hello

  1. First import the requests package.

  2. Create a proxies dictionary that defines the HTTP and HTTPS connections. This variable should be a dictionary that maps a protocol to the proxy URL. Additionally, make a URL variable set to the webpage you're scraping from. You may use the same syntax for different API calls, but regardless of the call you're making, you need to specify the protocol.

Example:

> 
> import requests
> 
> proxies = {
>    'http': 'http://proxy.example.com:8080',
>    'https': 'http://secureproxy.example.com:8090',
> }
> 
> url = 'http://mywebsite.com/example'
> 
> response = requests.post(url, proxies=proxies)

Requests Methods ✍️ response = requests.get(url) response = requests.post(url, data={"a": 1, "b": 2}) response = requests.put(url, data=put_body) response = requests.delete(url) response = requests.patch(url, data=patch_update) response = requests.head(url) response = requests.options(url)

Proxy Authentication 👩‍💻 If you need to add authentication, you can rewrite your code using the following syntax:

response = requests.get(url, auth=('user', 'pass'))

progressivehed avatar Aug 03 '22 14:08 progressivehed

Please message me in API telegram group if you needed more help

progressivehed avatar Aug 03 '22 14:08 progressivehed

Hello

Thanks for your answer. I understand how to use proxy in requests package, but my problem is that I can't use proxy in kucoin-python library. In other word, how to change kucoin-python library for using proxy inside this library. So can you help me to change this library for using create-limit-order() method with proxy?

در تاریخ چهارشنبه ۳ اوت ۲۰۲۲،‏ ۱۹:۱۰ Hed @.***> نوشت:

Hello

First import the requests package https://requests.readthedocs.io/en/master/. 2.

Create a proxies dictionary that defines the HTTP and HTTPS connections. This variable should be a dictionary that maps a protocol to the proxy URL. Additionally, make a URL variable set to the webpage you're scraping from. You may use the same syntax for different API calls, but regardless of the call you're making, you need to specify the protocol.

Example:

import requests

proxies = {

'http': 'http://proxy.example.com:8080',

'https': 'http://secureproxy.example.com:8090',

}

url = 'http://mywebsite.com/example'

response = requests.post(url, proxies=proxies)

Requests Methods ✍️ response = requests.get(url) response = requests.post(url, data={"a": 1, "b": 2}) response = requests.put(url, data=put_body) response = requests.delete(url) response = requests.patch(url, data=patch_update) response = requests.head(url) response = requests.options(url)

Proxy Authentication 👩‍💻 If you need to add authentication, you can rewrite your code using the following syntax:

response = requests.get(url, auth=('user', 'pass'))

— Reply to this email directly, view it on GitHub https://github.com/Kucoin/kucoin-python-sdk/issues/79#issuecomment-1204040035, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIWQ222Z7DB3EWX2VEWLXTLVXKAF7ANCNFSM55DPSYLA . You are receiving this because you authored the thread.Message ID: @.***>

progmlp avatar Aug 03 '22 14:08 progmlp

You can simply find all the source codes here:

https://github.com/Kucoin/kucoin-python-sdk/tree/master/kucoin

Just edit them based on your needs

progressivehed avatar Aug 03 '22 15:08 progressivehed