Zendesk Search API and Search Export API often return very different results | Community
Skip to main content

Zendesk Search API and Search Export API often return very different results

  • July 20, 2021
  • 5 replies
  • 0 views

Hi there

I have noticed that the Search API and the Search Export API can return very different results for the same search query parameters.

I know that the Search API limits results to 1000, but the results in question are way below 1000 and so I would expect the count to be the same, and for the count of the Search Export API to match the 'count' field that the Search API returns, for the same query params.

It is also the case that neither of these endpoints, nor either of the incremental endpoints, match the numbers displayed by running a query to create a dashboard inside the Zendesk app itself, which is also confusing. 

Is there a good reason why this should be the case?

Thank you

Devon

5 replies

  • Author
  • July 27, 2021

Hi there - would it be possible to get some assistance with this question? 


Edgar13
  • July 28, 2021

Hi Devon Edwards Joseph,

Edgar here from Zendesk Support.

Could you provide me with an example of each query you're working with?
I will be checking why the discrepancies are present accordingly.


  • Author
  • August 2, 2021

Hi, @Edgar Comper - Thanks for your help.

Here are the two queries i'm using.

Search API:

https://DOMAIN.zendesk.com/api/v2/search.json?query=type:ticket updated>=%sT00:00:00Z updated<=%sT23:59:59Z

Search Export API:

https://DOMAIN.zendesk.com/api/v2/search/export.json?query=updated>=%sT00:00:00Z updated<=%sT23:59:59Z&page[size]=1000&filter[type]=ticket&page[after]=

(I am appending the cursor to the end of this url for subsequent pages - hence the "page[after]=" - also the "%s" is interpolated with a date in the format YYYY-MM-DD)

If I make these requests, for example for the date 2021-07-13 - the Search API's count field will be "count":718, but the number of results actually exported via the Search Export API is 308 for the same date.

Is there something I have misunderstood about how these work?

Thank you for your help, once again.

 

 

 

  • Author
  • August 2, 2021

I have plotted the Search API's 'count' field ('expected', in green) against the actual count returned by the Export API ('actual', in red) on this chart, just to give a sense of when and by how much they are 'off' - in case this helps your investigation at all, Edgar.

I am assuming that you can get the domain my account is associated with by yourself, but if not, let me know.


Edgar13
  • August 3, 2021

Hi Devon Edwards Joseph,

Thanks for providing me with the additional details.
I'm going to register a ticket so we can discuss the discrepancies in relation to this query.