REST API query doesnt seem to properly work

I’m trying to make a REST query to my models so I can implement a site search.

I have a page title:
The dev test page

When I query without a value I get all the pages:
https://cdn.builder.io/api/v3/content/my-model?apiKey=XXX&query.data.title.$regex=

Tried everything to filter, but the results always are empty:
https://cdn.builder.io/api/v3/content/my-model?apiKey=XXX&query.data.title.$regex=/dev/

Hello @chrischris,

Welcome to the builder.io forum.

This works for us
https://cdn.builder.io/api/v3/content/page?apiKey=YOUR-API-KEY&query.data.title.$regex=.*dev.*&limit=1&omit=data.blocks

You may also find help at

Hi @manish-sharma ,

Thanks.
Still empty results, tried both .dev. and the JSON5 approach.

{"results": []}

Hello @chrischris,

Would you be able to help us with your builder Public API Key? You can find instructions for finding it at this link.

@manish-sharma absolutely, there you go:
c62b6400b6304daabf5f25c1107e9986

Thanks for helping with this.

Hello @chrischris,

I’m not able to see any content with the title “dev”, When I try to query the page model for content with the title “Download” it works

https://cdn.builder.io/api/v3/content/page?apiKey=c62b6400b6304daabf5f25c1107e9986&query.data.title.$regex=.*Download%20.*&limit=1&omit=data.blocks

It only works with the page model, doesn’t seem to work with any other models Which is what we’re trying.

We have the model:
pible-page-article

https://cdn.builder.io/api/v3/content/pible-page-article?apiKey=c62b6400b6304daabf5f25c1107e9986&query.data.title.$regex=.*Dev.*&limit=1&omit=data.blocks

Hello @chrischris,

It seems to be working for us, the query is returning the correct results
https://cdn.builder.io/api/v3/content/pible-page-article?apiKey=c62b6400b6304daabf5f25c1107e9986&query.data.title.$regex=.*Dev.*&limit=1&omit=data.blocks


I’ve just realised what the issue was, case sensitive as I was looking for “dev”, instead of “Dev”.

adding this to the query solved it:
&query.data.title.$options=i

Thanks, @manish-sharma, you are a life safer!