# Expand

Use `$expand` to request optional aggregate information in a Catalog API response.

The current Catalog API supports `$expand=Variants` on the endpoints that document this query parameter. When used, it includes the Variants count in the result.

`$expand` does not return the full `Variant` resources or embed the Variants collection in the response.

`$expand` is not documented in the current DAM OpenAPI specification.

## When to use `$expand`

Use `$expand=Variants` when an integration needs to know how many variants are associated with each returned resource and the endpoint supports this option.

If the integration needs the actual variant records, request them from the Filter Product Variants endpoint instead of relying on `$expand`.

## Syntax

```text
$expand=Variants
```

Example:

```http
GET https://api2.saleslayer.com/catalog/Products?$select=prod_ref,prod_title&$expand=Variants
```

## Get product variants

`$expand=Variants` is useful to know that variants exist and how many are associated with a product, but it does not return the variant records.

To retrieve the variants associated with a specific product, use the Filter Product Variants endpoint:

```http
GET https://api2.saleslayer.com/catalog/Products({productIdentifier})/Variants?$select=frmt_ref&$top=20
```

Replace `{productIdentifier}` with the product identifier. You can use the supported query parameters on that endpoint, such as `$select`, `$filter`, `$orderby`, `$top`, `$skip`, and `$skipToken`, to shape and paginate the returned Variant collection.

## Supported expansions

Supported expansions depend on the resource and endpoint. Check the OpenAPI reference for each operation before using `$expand`.

Currently, the documented value is `Variants`, which indicates that the response should include the Variants count when supported.

## Notes

* `Variants` is optional. If `$expand=Variants` is omitted, the Variants count is not requested.
* `$expand=Variants` requests the count only. It does not include the full Variants collection.
* Combine `$expand` with `$select` and pagination where appropriate.


## Related pages

* [Pagination and filtering](/guides/pagination-and-filtering)
* [Select](/guides/select)
* [Filter](/guides/filter)
* [Catalog REST API overview](/apis/catalog)