How long does Authorization last for?

Hello,
I’m currently trying to adapt my python trading program for use on the new advanced trade api.
At the moment on the Pro api, I get a price feed, then when it spots a trade the program authenticates me so it can place an order.

For the new api we have to authenticate first to get the price feed. The program might not trade for days at a time, so will the initial authentification still be valid, or will it have to authenticate again for the trade order to go through?

Sorry, I meant Authorization, not authentication.

Hope I’ve explained it properly.
Thanks
Garry

Hi @garry! Welcome to the Coinbase Developer Forum! We understand that you are currently trying to adapt your python trading program for use on the new Advanced Trade, but in order to ensure that we are on the same page with you, we would like you to provide us first with the following information:

  • “For the new api we have to authenticate first to get the price feed. The program might not trade for days at a time, so will the initial authentication still be valid?”

    • To better understand your scenario, can you elaborate further on what you meant with price feed? Are you utilizing an endpoint for this use case?
  • For your statement “will it have to authenticate again for the trade order to go through? Sorry, I meant Authorization, not authentication.?”

    • Can you specify the authentication method you are using for your API calls, if you are using API keys or OAuth2?
    • Please note that this is essential so that we could address your concern more accurately for you.
  • Since you stated that you are currently trying to adapt your python trading program, is it a third-party platform? Otherwise, please provide further details.

In the meantime, we would like you to refer to this documentation link to learn more about the new Advanced Trade: https://docs.cloud.coinbase.com/advanced-trade-api/docs/welcome

And once you reply back to us for the requested information above, we’ll work to quickly address your concerns. We appreciate your understanding. Have a great day ahead!

Hello KatKat.
By price feed I meant using websocket to suscribe to channels-ticker.
I’m authorizing API calls using my API keys.

My program is self written in python. I’m not an expert; I can write the trading part myself, but for the websocket feed and authentication parts I had to get the code from the internet as I couldn’t work that part out.

Currently on Pro my program:

  1. gets the public channels ticker
  2. keeps looking at the ticker until the right price comes up
  3. when the right price comes goes to authorization
  4. places a buy or sell order
  5. checks for the order to fill
  6. back to the start

On advanced trade api, would authorizing to get the ticker feed also authorize me to trade later on or would I still have to authorize again to place a trade order?

Thanks for your answer, hope I’ve cleared it up a bit for you.

Hi @garry! Thank you for providing the information we need. With regard to your question "On advanced trade api, would authorizing to get the ticker feed also authorize me to trade later on or would I still have to authorize again to place a trade order, " please note that the answer to this is yes, you still have to authorize again to place a trade order.

Unlike the Websocket Feed in CB Pro, the Websocket Feed of Advanced Trade requires authentication in order to subscribe to its channels. You can learn more about this in the documentation. Please note that this authentication is only for the Websocket and is not the same for authenticating API calls. Hence, in order to successfully place an order, you have to authenticate the API call by following the steps provided in this documentation about Authenticating Messages and you also have to ensure that the required permission (scope) related to this /order endpoint has been granted. You can learn more on which permissions (scopes) are required to access each endpoint in this Rest API overview.

We hope this clarifies your concerns. Please let us know if you still have more questions or clarifications. Thank you!

1 Like

Thanks for your answer Katkat and the links, I’ll keep on having a go at it!

3 Likes