# String Comparison in Search API

**URL:** <https://community.hubspot.com/t/string-comparison-in-search-api/128355>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [March 20, 2025, 4:53pm UTC](https://community.hubspot.com/t/string-comparison-in-search-api/128355 "2025-03-20T16:53:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![06018](https://avatars.discourse-cdn.com/v4/letter/0/4bbf92/32.png) [@06018](https://community.hubspot.com/u/06018)\
**Post date:** [March 20, 2025, 4:53pm UTC](https://community.hubspot.com/t/string-comparison-in-search-api/128355/1 "2025-03-20T16:53:18Z")

</div>

Consider the following POST to /crm/v3/objects/companies/search

data = {

“filterGroups”: [

{

“filters”: [

{

“propertyName”: “sync\_id”,

“operator”: “LT”,

“value”: “1TVj11”

}

},

]

}

You would imagine that “1TVfTD” would be returned since lexographically 1TVfTD \< 1TVj11. However, this has proven to not be the case. Could someone provide some insight on how strings are compared in the Hubspot API? An extension question would be if lowercase characters are considered lesser or greater than uppercase characters.  
Edit: I will add, “1TVfTD” is returned when compared against “2”, but not against “1Z”. What gives?

---

<div class="post-metadata">

**Author:** ![SteveHTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stevehtm/32/22074_2.png) [@SteveHTM](https://community.hubspot.com/u/SteveHTM)\
**Post date:** [March 20, 2025, 5:59pm UTC](https://community.hubspot.com/t/string-comparison-in-search-api/128355/2 "2025-03-20T17:59:27Z")

</div>

@06018 - Although you may find this unsatisfactory, I feel you may be reaching into an arena of undefined or at least underdocumented behaviour. For my part, I only use GT, LT type comparisons on numeric properties. And limit string operations to EQ, NEQ or CONTAINS\_TOKEN, etc.

Good luck!

Steve

---

<div class="post-metadata">

**Author:** ![06018](https://avatars.discourse-cdn.com/v4/letter/0/4bbf92/32.png) [@06018](https://community.hubspot.com/u/06018)\
**Post date:** [March 20, 2025, 6:04pm UTC](https://community.hubspot.com/t/string-comparison-in-search-api/128355/3 "2025-03-20T18:04:23Z")

</div>

I see. The strings I am trying to compare are base62 representations of Unit time (seconds since Jan 01 1970). I suppose I could use integers for this, but this should be documented somewhere

---

<div class="post-metadata">

**Author:** ![SteveHTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stevehtm/32/22074_2.png) [@SteveHTM](https://community.hubspot.com/u/SteveHTM)\
**Post date:** [March 20, 2025, 6:19pm UTC](https://community.hubspot.com/t/string-comparison-in-search-api/128355/4 "2025-03-20T18:19:56Z")

</div>

Given this information, I think you may be better off formatting the property as a date or datetime (where the underlying property values in HS are actually millisecond UNIX epoc counters) Then you have a lot more flexibility for comparison or range selection in a search.

Steve
