Python package for Advanced Trading

A couple years ago I installed cbpro from github and have been using it to buy/sell on CoinbasePro. Is there a similar package the has been developed for Advanced Trading?

However, I would really like to be able to do it with sp_OACreate and sp_OAMethod inside of SQL Server but I can’t get the “params” value correct when trying to use hmac and all. I get “Unathorized”.

I’ve been trying this hmac function:

and this function

https://itecnote.com/tecnote/sql-way-to-use-sp_oacreate-with-authorization-header-with-bearer-and-jwt-token/

with these params:

request[“CB-ACCESS-KEY”] = $ACCESS_KEY
request[“CB-ACCESS-SIGN”] = signature
request[“CB-ACCESS-TIMESTAMP”] = timestamp

This is what the string looks like before encryption (for the signature).

1672630585GET/api/v3/brokerage/products/BTC-USD/ticker

select dbo.GetPostAPI(@method,@url,@token,@params) as sonuc

This is what the @params variable winds up looking like. It probably isn’t encrypted correctly but I’m not sure what I’m doing wrong.

{ “CB-ACCESS-KEY” = my_key “CB-ACCESS-SIGN” = 0xc589e0e281a672c6bb8e5b03916e24bf2d2a445606ba931d5939c153839c8f5f “CB-ACCESS-TIMESTAMP” = 1672630585 }

I get an “Unauthorized”. Any ideas? If I can’t get it to work inside of SQL Server, I’m hoping a similar package to cbpro has been developed for Advanced Trading.

Thanks for any help.

1 Like

Hi @Hawkster! Thank you for taking an interest in trying out Coinbase APIs. For the details regarding your inquiry, we will check on this for you with our team to see how we can best assist. We’ll get back to you once we have more information. Keep in touch!

1 Like

Thanks. If there is a python package similar to cbpro but for Advanced Trade, that would be great.

Hi @Hawkster! Thank you for your patience as we look into this.

As per our checking, we regret to inform you that we currently do not have a Github package that is dedicated to Advanced Trading. However, if you could enlighten us with your intended use case for this, we could have this tagged as a feature request with our internal teams so we can continue improving our user experience. Most new features and improvements to Coinbase products come directly from feedback like yours, so it’s very valuable to them. While Coinbase can’t offer any specific timeline for adding features, they are constantly working to build products that their customers will love.

In the meantime, we highly recommend that you try checking our documentation about Authenticating Messages, wherein sample Signature Generation codes are provided in different programming languages which you may find helpful with debugging your code and checking if the proper syntax was followed.

Please feel free to reply back to this thread if you have other queries or concerns. Have a great day!

Thanks for the reply. There is a python package on github called cbpro that is very useful for setting up trading with the api on CoinbasePro. I am hoping that something similar will be developed for Coinbase Advanced Trade.

Currently I’m having an issue with getting the websocket for Advanced Trade to work via python.

Hello @Hawkster! Thanks for providing us with the detailed description on how you want a Python package on Github to be developed for Coinbase Advanced Trade. However, as previously mentioned we will tag this as a feature request with our internal teams so we can continue to improve your experience.

Regarding the issue you encountered with the Websocket for Advanced Trade to work via Python, as mentioned here, unfortunately, we are only able to provide guidance and troubleshooting for issues with the raw Coinbase APIs.

We appreciate your patience and understanding.

2 Likes

look at my github. Not exactly what you are looking for but it should get you started. Best of luck.

Hello @Hawkster, I have an R package at Github. I know that it is not Python, but it may be of interest to you. I believe that you can run R code within Python.

The link is GitHub - Squirrel-hue/rcbatapi: Package with Functions to Support the Advanced Trading API in R.