---
title: "Stack"
description: "Stack"
url: "https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/python/reference/stack"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-13"
---

# Stack

## Stack

Retrieves stack

## live_preview_query

live\_preview\_query accepts key-value pair objects to the query

```
import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);
response = stack.live_preview_query(**kwargs)
print(response)
```

## image_transform

Image Delivery API covers the parameters that you can add to the URL to retrieve, manipulate (or convert) image files and display it to your web or mobile properties.

```
import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);
response = stack.image_transform("image_url", **kwargs)
print(response)
```

## sync_token

You can use the sync token (that you receive after the initial sync)to get the updated content next time. The sync token fetchesonly the content that was addedafter your last sync and the details of the content that was deleted or updated.

```
import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);
response = stack.sync_token("sync_token")
print(response)
```

## pagination

If the result of the initial sync (or subsequent sync)contains more than 100 records, the response would bepaginated. It provides a pagination token in the response.However, you do not have to use the pagination tokenmanually to get the next batch.

```
import contentstack
stack = contentstack.Stack(api_key = 'api_key', access_token = 'access_token', environment = 'environment')
result = stack.pagination('pagination_token')
if result is not None:
   logger.info(result)
        # result.items: Contains sync data
        # result.paginationToken: For fetching the next batch of entries using pagination token
        # result.syncToken: For performing subsequent sync after initial sync
else:
    logger.error(result)
```

## asset_query

initial sync of the stack

```
import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);
response = stack.sync_init(content_type_uid="Your contenttype uid", start_from="date", locale="en-us", publish_type=PublishType.entry_published)
print(response)
```

## asset_query

assets of the stack

```
import contentstack;
stack = contentstack.Stack(api_key, delivery_token, environment);
assets = stack.asset_query()
print()
```

## asset

asset of the stack

```
import contentstack;

stack = contentstack.Stack('api_key', 'delivery_token', 'environment');
asset = stack.asset("uid")
print(asset)
```

## get_live_preview

live\_previewfor the stack

```
import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);
result = stack.get_live_preview
print(result)
```

## get_headers

headers for the stack

```
import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);
result = stack.get_headers
print(result)
```

## get_branch

branch for the stack

```
import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);
result = stack.get_branch
print(result)
```

## get_environment

environment for the stack

```
import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);
result = stack.get_environment
print(result)
```

## get_delivery_token

Delivery Token for the stack

```
import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment);
result = stack.get_delivery_token
print(result)
```

## get_api_key

api\_key for the stack

```
import contentstack;

stack = contentstack.Stack(api_key, delivery_token, environment)          
result = stack.get_api_key
print(result)
```

## early_access

Array of header strings for early access features.

```
import contentstack;
stack = contentstack.Stack(api_key, delivery_token, environment, early_access=["early_access_1", "early_access_2"]);
```

Optional array of header strings for early access features.

DB region for your stack. You can choose from seven regions namely, AWS NA, AWS EU, AWS AU, Azure NA, Azure EU, GCP NA, and GCP EU

## Stack | Python Delivery SDK | Contentstack

The Stack class in the Python Delivery SDK retrieves a stack instance, serving as the main interface for accessing content from your Contentstack stack.