# API query not working

**URL:** <https://forum.builder.io/t/api-query-not-working/6427>\
**Category:** Technical Questions\
**Tags:** api\
**Created:** [September 21, 2024, 6:46pm UTC](https://forum.builder.io/t/api-query-not-working/6427 "2024-09-21T18:46:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![goldencarrot](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/goldencarrot/32/4189_2.png) [@goldencarrot](https://forum.builder.io/u/goldencarrot)\
**Post date:** [September 21, 2024, 6:46pm UTC](https://forum.builder.io/t/api-query-not-working/6427/1 "2024-09-21T18:46:10Z")

</div>

This is my api call:  
[https://cdn.builder.io/api/v3/content/users?apiKey=b8fd029ade9445d392e2b0476a500a3f](https://cdn.builder.io/api/v3/content/users?apiKey=b8fd029ade9445d392e2b0476a500a3f)  
&enrich=true  
&limit=1  
&fields=id,name,data.offering%5B0%5D.object.value.name  
&includeRefs=true

and this is the response

```auto
{
  "results": [
    {
      "id": "670815d358294f128932ce4143c2368a",
      "name": "Henry",
      "data": {
        "offering": [
          {
            "object": {
              "value": {
                "name": "Sukuna"
              }
            }
          }
        ]
      }
    }
  ]
}

```

I am trying to display results that have names, but when I try to add  
&query.data.offering.object.value.name.$exists=true

I just get an empty response… Why? name clearly exists  
Is this a bug?

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [September 23, 2024, 11:54am UTC](https://forum.builder.io/t/api-query-not-working/6427/2 "2024-09-23T11:54:53Z")

</div>

Hi @goldencarrot,

Welcome to the [builder.io](http://builder.io) forum post.

Currently, the [Builder.io](http://Builder.io) Content API does not support querying deeply nested reference fields directly via the query parameter. The offering → object is a reference field type. Therefore, you can follow this structured approach to retrieve the necessary data:

**Step 1: Fetch Data with References**  
Make an API call to retrieve your data, including the references.

**Step 2: Fetch Reference Details**  
For each reference in the offering array, perform additional API calls to fetch the details of those references.

**Step 3: Filter Client-Side**  
After gathering all the data, filter it based on the name field in the reference data.

For more detailed guidance, you can also visit our documentation here:

> **[Content API - Builder.io](https://www.builder.io/c/docs/content-api)**
>
> Learn how to use Builder's Content API to make requests to retrieve data about any of your models. Write queries with dot notation and MongoDB style operators.

> **[Querying Cheatsheet - Builder.io](https://www.builder.io/c/docs/querying)**
>
> Builder is the only Visual Development Platform that offers an AI-powered design-to-code tool, a visual editor, and an enterprise CMS.

> [@Content API - How to query a list's attributes](https://forum.builder.io/t/content-api-how-to-query-a-lists-attributes/679):
>
> In the Data content models, it’s possible to set up a model that can have a list attribute, that refers to other models. I was wondering how to query for this in the content API? I know I can query for direct attributes of the model, by adding the URL param &query.data.active=true for example. In my example, I have a model that has a List referring to another model, so I assume the query should be something like query.data.meatTypes.[].meatType.value.data.name=Beef, but I’m not sure what oper…

If you have any further questions, feel free to ask!
