# Filter GET contacts call on custom fields

**URL:** <https://integration.keap.com/t/filter-get-contacts-call-on-custom-fields/85184>\
**Category:** API Q&A\
**Tags:** api\
**Created:** [October 6, 2021, 11:20am UTC](https://integration.keap.com/t/filter-get-contacts-call-on-custom-fields/85184 "2021-10-06T11:20:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brooklyn\_Pedley](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@Brooklyn\_Pedley](https://integration.keap.com/u/Brooklyn_Pedley)\
**Post date:** [October 6, 2021, 11:20am UTC](https://integration.keap.com/t/filter-get-contacts-call-on-custom-fields/85184/1 "2021-10-06T11:20:02Z")

</div>

I want to filter the contacts i get back from the API based on what the value of a custom field is.  
I have seen some other posts from a couple years back saying it wasn’t implemented yet but was wondering if it is possible now?

I am trying to use  
`this.http.get(this.baseURL + '/contacts?optional_properties=custom_fields&filter={"where":{"custom_fields":{"elemMatch":{"id":34,"content":"foobar"}}}}'`  
or

```auto
this.http.get(this.baseURL + '/contacts?optional_properties=custom_fields&custom_fields={"id":34,"content":"foobar"}'

```

But neither work. I only want contacts where the custom field is set to “foobar”

---

<div class="post-metadata">

**Author:** ![TomScott](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/tomscott/32/67_2.png) [@TomScott](https://integration.keap.com/u/TomScott)\
**Post date:** [October 6, 2021, 9:54pm UTC](https://integration.keap.com/t/filter-get-contacts-call-on-custom-fields/85184/2 "2021-10-06T21:54:15Z")

</div>

We do not support arbitrary queries on custom fields through the API due to indexing constraints.

---

<div class="post-metadata">

**Author:** ![John\_Borelli](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/john_borelli/32/11880_2.png) [@John\_Borelli](https://integration.keap.com/u/John_Borelli)\
**Post date:** [October 7, 2021, 7:45pm UTC](https://integration.keap.com/t/filter-get-contacts-call-on-custom-fields/85184/3 "2021-10-07T19:45:25Z")

</div>

There are ways to do it but it’s not going to be anything native to Keap in your app. I don’t even think you could do it with zapier without custom coding your own zap so it might as well be code you own. Anytime a contact is updated, code could check if a custom field differs from a comparison field. If it does then set a tag or whatever is needed and then copy the field value to the comparison field. If it doesn’t then do nothing. But to do that it would require custom coding.
