In Shopify, you can use the Storefront Ajax API to get the "checkout" for a user, aka. the cart.
Is there something similar for getting the cart serverside?
As far as I can tell from reading the documentation, you can only access "checkouts" once the user has entered their address etc - not while they are still putting stuff in the basket...
As Vladimir said in a comment - there is no way to get cart content via a serverside API.