Fetching data with <ref>


We are evaluating Prismic as a headless CMS for our platform. As far as we understand from the documentation, we have to pass the ref in our API requests. We understand the motivation for this, however in our case we are just interested in latest available content. Is there a solution for that?

We know that we can fetch the latest ref through an api call GET https://<REPOSITORY>.prismic.io/api/v2, however we are not interested in using ref at all and just get the latest content.


Hello Maskin,

Welcome to the Prismic community, and thanks for reaching out to us.

The Master ref has required the latest version of the content.Prismic query performs one query to get your current ref (which is a short token) and then a second query — using that ref — to get your content. This ensures that the content returned is the correct version and up-to-date.

I am curious to know why you are not interested in using the ref despite the API being fast because ref.



Thank you for the quick response.

As I mentioned above, we are not interested in earlier versions. We are only interested in the latest version. And I understand, that we can make one query to get the latest ref and using it in another call. However, this sounds a bit wrong for us to make two requests to get the latest content, instead of simply having one request.

But if there is no other way to get the latest content without using ref -- this is the way it is. And we have to take it into our evaluations.