How to get accurate pricing information?

I’m looking to get an up-to-date ‘BTC-GBP’ price.
Running these API calls at the same time I get:
From the Prices Endpoint https://api.coinbase.com/v2/prices/:currency_pair/buy£14333.36
From the Buys Endpoint https://api.coinbase.com/v2/accounts/:account_id/buys£14334.02
They are within ~£1 of each other, an understandable discrepancy.

However at the same time these API calls are being run the UI on coinbase.com is showing the price as £14270.19 a difference of ~£63 which is 0.45% lower.

I’ve measured this a few times and the difference varies between 0.4% and 0.7%

Why is there a difference? Surely all these prices should be exclusive of fees?
And how can I get an accurate price (which matches the UI) from the API?

Hi @dwkns! Thanks for posting your concern here in the developer forum. We appreciate it.

You can see quite a huge difference in price when comparing the /buys and /prices endpoint to the price in the website as these endpoints add a 1% Coinbase fee on the current market price. The 1% Coinbase fee is stated here in the /prices endpoint documentation.

If you want to check the price without the Coinbase fee that matches the price shown in the website, you may use the /spot price endpoint. We hope this helps. Should you have further questions, feel free to ask and we will gladly help. Have a great day!

1 Like