# Method: services.searchRange

- [HTTP request](https://docs.cloud.google.com/service-infrastructure/docs/service-networking/reference/rest/v1/services/searchRange#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/service-infrastructure/docs/service-networking/reference/rest/v1/services/searchRange#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/service-infrastructure/docs/service-networking/reference/rest/v1/services/searchRange#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/service-infrastructure/docs/service-networking/reference/rest/v1/services/searchRange#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/service-infrastructure/docs/service-networking/reference/rest/v1/services/searchRange#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/service-infrastructure/docs/service-networking/reference/rest/v1/services/searchRange#body.aspect)
- [Try it!](https://docs.cloud.google.com/service-infrastructure/docs/service-networking/reference/rest/v1/services/searchRange#try-it)

Service producers can use this method to find a currently unused range within consumer allocated ranges. This returned range is not reserved, and not guaranteed to remain unused. It will validate previously provided allocated ranges, find non-conflicting sub-range of requested size (expressed in number of leading bits of ipv4 network mask, as in CIDR range notation).

### HTTP request

`POST https://servicenetworking.googleapis.com/v1/{parent=services/*}:searchRange`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. This is in a form services/{service}. {service} the name of the private access management service, for example 'service-peering.example.com'. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `parent`: - `servicenetworking.services.get` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "network": string, "ipPrefixLength": integer } ``` |

| Fields ||
|---|---|
| `network` | `string` Required. Network name in the consumer project. This network must have been already peered with a producer VPC network using CreateConnection method. Must be in a form 'projects/{project}/global/networks/{network}'. {project} is a project number, as in '12345' {network} is network name. |
| `ipPrefixLength` | `integer` Required. The prefix length of the IP range. Use usual CIDR range notation. For example, '30' to find unused x.x.x.x/30 CIDR range. Actual range will be determined using allocated range for the consumer peered network and returned in the result. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/service-infrastructure/docs/service-networking/reference/rest/v1/operations#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/service.management`
- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).