---
title: "Retrieve Data from the Cache"
url: https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/cache/retrieve-data-from-cache/
description: "This page describes the method to retrieve data from the cache in your Python application with sample code snippets."
last_updated: 2025-11-19T15:07:41Z
service: Cloud Scale
type: general
related_links:
- name: "Retrieve Data from the Cache - API"
url: /en/api/code-reference/cloud-scale/cache/get-cache-value/#GetCacheValue
- name: "Cache Help"
url: /en/cloud-scale/help/cache/introduction
- name: "SDK Scopes"
url: /en/sdk/python/v1/sdk-scopes
---
# Retrieve data from the cache
### Get Cache Value
[Catalyst Cloud Scale Cache](https://docs.catalyst.zoho.com/en/cloud-scale/help/cache/introduction) is divided into partitions or cache units called segments. Each segment stores cache items in the form of key-value pairs. Both keys and values are of type String.
You can retrieve the value of a cache item from a segment in the cache using the `get_value()` method. You must pass the key name as the argument and the value corresponding to that key will be returned as a response.
To know more about the [component instance](https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/cache/get-component-instance/) `cache_service` and the [segment_service](en/sdk/python/v1/cloud-scale/cache/get-segment-instance/) `segment_service` used below, please refer to their respective help sections.
**Parameters Used**
| Parameter Name |
Data Type |
Definition |
| `Key` |
String |
A **Mandatory** parameter. Will hold the key for retrieving the cache value. |
```python
#Get cache value
cache_service = app.cache()
segment_service = cache_service.segment()
data = segment_service.get_value('key')
```
A sample response is shown below :
```json
{
"cache_name": "Name",
"cache_value": "Amelia Burrows",
"expires_in": "Mar 09, 2023 06:20 PM",
"expiry_in_hours": "48",
"project_details": {
"id": "2648000001343001",
"project_name": "appEngine",
"project_type": "Live",
},
"segment_details": {"id": "2648000001343037", "segment_name": "Default"},
"ttl_in_milliseconds": "172800000",
}
```
### Get Cache Object
You can retrieve the details of the cache where the key-value pair is of type dictionary. The key object is retrieved using the `get()` method, where the key name is passed as an argument.
To know more about the [component instance](https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/cache/get-component-instance/) `cache_service` and the [segment instance](en/sdk/python/v1/cloud-scale/cache/get-segment-instance/) `segment_service` used below, please refer to their respective help sections.
**Parameters Used**
| Parameter Name |
Data Type |
Definition |
| `cache_name` |
String |
A **Mandatory** parameter. Will hold the key for retrieving the cache object. |
```python
cache_service = app.cache()
segment_service = cache_service.segment()
data = segment_service.get('key')
```
A sample response is shown below :
```json
{
cache_name: "Name",
cache_value: "Amelia Burrows",
project_details: {
project_name: "AlienCity",
id: "2136000000007733"
},
segment_details: {
segment_name: "Location",
id: "2136000000008572"
},
expires_in: "Aug 18, 2021 06:39 PM",
expiry_in_hours: "47",
ttl_in_milliseconds: "172727000"
}
```
> **Info :** Refer to the [SDK Scopes table](https://docs.catalyst.zoho.com/en/sdk/python/v1/sdk-scopes) to determine the required permission level for performing the above operation.