featured article

How to Use the New Prismic API Explorer to Check If a Field Has Content

Nicki Lever
Nicki Lever

3 min read

MacBook Pro with images of computer language codes

We’ve recently been experimenting with the all-new Prismic API Explorer, and it’s a really useful way to query your content without having to set up a client or write code first.

Prismic does a lot of things really well compared to other CMSs. However, one feature it doesn’t provide out of the box is the ability to quickly see if uploaded media files (such as videos in the media library) are actually being used in any documents.

This issue came up for a client project this week when we needed to stop serving videos directly from Prismic and instead embed them via an oEmbed field from an external service (in this case, Vimeo). To do that, we first had to identify which documents were using the featured_video field.

Here’s a step-by-step walkthrough of how we used the Prismic API Explorer to run that query.

Step 1: Open the API Explorer in Your Repository

  1. Go to your Prismic repository.
  2. In the left-hand menu, scroll to the bottom and select Settings (note: if you don’t see this, contact your Prismic admin as you’ll need the right permissions).
  3. From the Configuration menu, select API & Security.
  4. Under the Content API section, click on API Browser. This opens the new API Explorer unique to your repo.

prismic api explorer example

Step 2: Explore the Request Panel

Inside the Explorer, you’ll see two main panels:

  • Request (left) – where you set up the query
  • Response (right) – where your results are displayed
  1. In Request, choose get from the dropdown.
  2. Set Page Size to the maximum of 100. (If you don’t see all your expected documents, you may need to refine your filters, as you can’t increase page size beyond 100).
  3. For multilingual sites, set LANG to your desired locale.
  4. Click Advanced to open Filters and Ordering options.

Step 3: Add Filters

This is where the power comes in. Filters enable you to refine your query using operators such as "has""not""missing""dateAfter""numberInRange", or "geopointNear".

For our use case, we wanted to check if a specific field had content. Here’s how:

  1. Click + Add under Filters.
  2. Select has.
  3. For Path, enter the field you want to query in the format:
my.[documenttype].[fieldname] 
  1. For example:
my.story.featured_video 
  1. (Tip: autocomplete should suggest available fields as you type).

You can also add Ordering refinements, such as:

document.first_publication_date

to sort your results by when they were first published.

Step 4: View Results

As soon as you apply filters, the Response panel on the right will update with results.

At the top-right of the Response panel, you can:

  • Copy the response JSON
  • Open the full response in a browser

This makes it easy to confirm which documents contain data in the featured_video (or any other) field.

Learn More

For a full breakdown of available query options, check the official Prismic documentation: Prismic Query Methods

Why This Matters

If you’re managing a large Prismic repo, the API Explorer is a quick way to:

  • Audit usage of media fields
  • Clean up unused assets in your media library
  • Prepare for migrations (like switching from hosted media to embedded services)
  • Test queries before implementing them in production code

Share

Other articles you may enjoy

We can help

As with everything in life, things pan out better when you work together. So if you are looking for a website support, updating a Shopify Theme, a fresh out of the box site or support with your Digital Strategy, you've come to the right place. We pride ourselves on our flexibility and honesty.

Why not get in touch?