---
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.md)
> 
> * [SearchApiResult Apex class](https://docs.coveo.com/en/3119.md)

The following attributes are available on a `SearchApiResponse`:

* `Map<String,Object> untyped`: The raw response, untyped.

* [`totalCount` (integer)](https://docs.coveo.com/en/13.md#operation/searchUsingPost-response-totalCount): The total count of the number of results.

* [`duration` (integer)](https://docs.coveo.com/en/13.md#operation/searchUsingPost-response-duration): The query duration in `ms`.

* [`searchUid` (string)](https://docs.coveo.com/en/13.md#operation/searchUsingPost-response-searchUid): The UID to identify the query.

* `List<Object> rawResults`: The results in raw format.

* `List<SearchApiResult> results`: The list of the `SearchApiResults` (search results).

* [`error` (string)](https://docs.coveo.com/en/13.md#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<String,Object>{
        'q' => 'my query text'
    },
    'Bearer ' + token);
System.debug(response);
```