> [!NOTE]
> **Note:** See the [Search](https://developers.google.com/search-ads/reporting/api/reference/rest/examples#search) section of the accompanying examples for more complete examples.

The Search Ads 360 Reporting API has a unified [attribute retrieval and metrics reporting
mechanism](https://developers.google.com/search-ads/reporting/concepts/search-reports)
that lets you create queries using the [Search Ads 360 Query
Language](https://developers.google.com/search-ads/reporting/query/query-language).
This enables complex queries that can return large quantities of data about
individual Search Ads 360 accounts.

You can create queries using either of the `Search` or `SearchStream` methods.
Both methods support the same queries and return equivalent results. The
`Search` method returns data in customizable page sizes, enabling you to iterate
over a result set using pagination. This could be advantageous in low bandwidth
or unreliable network conditions, for example, to segment a large result set
into smaller responses that can be re-fetched if a connection is lost. The
`SearchStream` method, on the other hand, streams the entire result set back in
a single response, which can be more efficient for bulk data retrieval.

Both `Search` and `SearchStream` use the same base URL:

```html
    https://searchAds360.googleapis.com/v0/customers/CUSTOMER_ID/searchAds360
```

The page-based search method takes an optional `pageSize` parameter which limits
how many results are returned in a single API response.

> [!NOTE]
> **Note:** The `pageSize` parameter is optional and will default to 10,000 if not explicitly set.

```
POST /v0/customers/CUSTOMER_ID/searchAds360:search HTTP/1.1
Host: searchAds360.googleapis.com
Content-Type: application/json
Authorization: Bearer ACCESS_TOKEN

{
"pageSize": 10000,
"query": "SELECT ad_group_criterion.keyword.text, ad_group_criterion.status FROM ad_group_criterion WHERE ad_group_criterion.type = 'KEYWORD' AND ad_group_criterion.status = 'ENABLED'"
}
```

If there are more rows in the results than `pageSize`, a `nextPageToken` is
returned in the response:

```javascript
{
  "results": [
    // ...
    // ...
    // ...
  ],
  "nextPageToken": "CPii5aS87vfFTBAKGJvk36qpLiIWUW5SZk8xa1JPaXJVdXdIR05JUUpxZyoCVjMwADjUBkD___________8B",
  "fieldMask": "adGroupCriterion.keyword.text,adGroupCriterion.status"
}
```

Repeating the same query with a `pageToken` added with the value above fetches
the next page of results:

```
POST /v0/customers/CUSTOMER_ID/searchAds360:search HTTP/1.1
Host: searchads360.googleapis.com
Content-Type: application/json
Authorization: Bearer ACCESS_TOKEN


{
"pageSize": 10000,
"query": "SELECT ad_group_criterion.keyword.text, ad_group_criterion.status FROM ad_group_criterion WHERE ad_group_criterion.type = 'KEYWORD' AND ad_group_criterion.status = 'ENABLED'",
"pageToken": "CPii5aS87vfFTBAKGJvk36qpLiIWUW5SZk8xa1JPaXJVdXdIR05JUUpxZyoCVjMwADjUBkD___________8B"
}
```

> [!NOTE]
> **Note:** The provided client libraries handle pagination automatically, eliminating the need to repeatedly query to return each subsequent page. See an [example of using pagination in the client libraries](https://developers.google.com/search-ads/reporting/concepts/pagination#pagination_example).

To use the `SearchStream` method, which returns all results in a single streamed
response, simply change the service method in the URL to `searchStream`
(`pageSize` and `pageToken` are not required by `SearchStream`):

```
POST /v0/customers/CUSTOMER_ID/searchAds360:searchStream HTTP/1.1
Host: searchads360.googleapis.com
Content-Type: application/json
Authorization: Bearer ACCESS_TOKEN

{
    "query": "SELECT ad_group_criterion.keyword.text, ad_group_criterion.status FROM ad_group_criterion WHERE ad_group_criterion.type = 'KEYWORD' AND ad_group_criterion.status = 'ENABLED'"
}
```

> [!NOTE]
> **Note:** The results of a `SearchStream` API call are wrapped in a JSON array, whereas most other API calls return a single JSON object as the response message. See the [JSON mappings](https://developers.google.com/search-ads/reporting/api/reference/rest/json-mappings) section for more info.