When I use the filter API to get the total number of tickets, the total count is less than what I see on the view page.
And I can’t see any limitation mentioned in the docs regarding this.
Please refer to the attached video below.
Workspace visibility for the user that you are using to query is insufficient. From the video, there are two tickets in the list that have QUERY instead of INC, which I assume is due to a second workspace having those tickets. Those two tickets would explain why your query comes back with 16 in the code instead of 18 that is expected. Fix the permissions on the user that you are getting the API key from and you’re good to go.
Also, make sure your ticket query also has workspace=0 or it will only return tickets in the primary workspace.