Obtaining Open Orders Via REST API is essential

Apparently, it is currently not possible to obtain open orders via the REST API. I understand that instead one would have to open a websocket and wait until information about open orders to be sent.

I think it is essential to be able to access open orders without a websocket, this means via the REST API. Even with the socket it is not clear when all open orders are received (or are all open orders sent with one message in the beginning?).

I don’t know any API that does not support this. For simple trading bots with infrequent polling (once every or every few minutes) it should be fine to request open orders once in a while for syncing the state with the exchange. Even when using websockets it makes sense to once obtain open orders after a connection loss. Cancelling all orders should also be possible. At least I would like to be able to make one request to get the open order ids and then another one for cancelling.

2 Likes

Workaround until fixed

2 Likes

Hello @lex. Welcome to the Coinbase Cloud Developer Forum! I understand that you would like to obtain open orders via the REST API. I also appreciate your request to have an order_id for both open and cancelled orders.

I believe you may utilize the List orders endpoint of Advanced Trade API to be able to get a list of orders. You may opt to filter the responses according to the order_status which are pending, filled, cancelled, expired, failed, and unknown_order_status. Also, you may utilize the Cancel orders endpoint if you want to initiate cancel requests for one or more orders. You will be given an order_id for every order that you initiate. You may check this documentation link for the available Advanced Trade endpoints: REST API Overview

In reference to this forum thread, it seems that the only way to get all the active orders is to call your entire order history and parse it yourself, but this will be unfeasible in the future if you’ve made several orders in your account. On that note, @bredy has a workaround with regard to this matter. You may try that as well. I highly appreciate your help here, @bredy.

Having that said, I recommend that you post any feedback or feature requests that you have in the Feedback Section of the Developer Forum as most new features and improvements to Coinbase come directly from feedback like yours. Additionally, you may engage in the Advanced Trade Feedback thread as I would love to know what you think about the newly launched Advanced Trade API. Thank you!

1 Like

That’s the point being made here. The docs say you SHOULD be able to do this, but when you actually try it, it returns the error: ‘failed to parse Query request does not support querying active status orders’.

1 Like

Hello @Lex and @jmicko ! Thank you for taking an interest in trying out Coinbase APIs. For the details regarding your concern, we will check on this for you with our team. We acknowledge the features that you are querying about. We’d appreciate your patience regarding this matter. We will get back to you once we have more information. Keep in touch!

5 Likes

Hello @lex, we really appreciate your enthusiasm in trying out our Advanced Trading API.

Before continuing, we wish to inform you that although some features of Advanced Trade were already made public, we’d like you to note that the Team is still hard at work building all the remaining APIs and its corresponding documentation. Additionally, please note that the launched Advanced Trade API is in Beta which means that it is still in the stage of development. Therefore, there might still be some bugs or endpoints that are not working as expected.

From your initial post, we understand that you want to query all opening orders at once and cancel all open orders via a single API call. Based on the released documentation and internal communication with our engineers, these are features not supported by the current version of the API. However, this is something our team is aware of and is currently working on. In the meantime, we’d appreciate it if you could log these kinds of features in the Feedback Section of the Developer Forum as most new improvements to Coinbase come directly from feedback like yours.

If you have further questions, feel free to reply to this thread.

4 Likes

Ayyyyy, it works now!

Looks like it returns a max of 1000 orders. Does this mean we can place 1000 orders with the API? Or more? If I recall, we were limited on Pro to like 500 or something. Is that no longer the case?

Thanks!

1 Like

Hello @jmicko ! Thank you for taking an interest in trying out Coinbase APIs. For the details regarding your concern, we will check on this for you with our team. We acknowledge the features that you are querying about. We’d appreciate your patience regarding this matter. We will get back to you once we have more information. Keep in touch!

5 Likes

Hi there @jmicko! The List Orders endpoint does return a max of 1000 orders however, the Create Order has a limit of 500 open/resting orders per product.

We hope we were able to provide clarification with your concern. Thank you!

3 Likes