--- title: SearchApiResponse Apex class slug: '3117' canonical_url: https://docs.coveo.com/en/3117/ collection: coveo-for-salesforce source_format: adoc --- # SearchApiResponse Apex class This Apex class represents a Coveo Search API search response. > **Note** > > You should also consult the: > > * [SearchApiClient Apex class](https://docs.coveo.com/en/2988/) > > * [SearchApiResult Apex class](https://docs.coveo.com/en/3119/) The following attributes are available on a `SearchApiResponse`: * `Map untyped`: The raw response, untyped. * [`totalCount` (integer)](https://docs.coveo.com/en/13#operation/searchUsingPost-response-totalCount): The total count of the number of results. * [`duration` (integer)](https://docs.coveo.com/en/13#operation/searchUsingPost-response-duration): The query duration in `ms`. * [`searchUid` (string)](https://docs.coveo.com/en/13#operation/searchUsingPost-response-searchUid): The UID to identify the query. * `List rawResults`: The results in raw format. * `List results`: The list of the `SearchApiResults` (search results). * [`error` (string)](https://docs.coveo.com/en/13#operation/searchUsingPost-response-errors): The error, if any. * `statusCode (integer)`: The HTTP status code of the request. ```apex String token = CoveoV2.Globals.generateSearchToken(); CoveoV2.SearchApiResponse response = CoveoV2.SearchApiClient.executeQuery( new Map{ 'q' => 'my query text' }, 'Bearer ' + token); System.debug(response); ```