## List a Namespace's Keys `kv.namespaces.keys.list(strnamespace_id, KeyListParams**kwargs) -> SyncCursorLimitPagination[Key]` **get** `/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/keys` Lists a namespace's keys. ### Parameters - `account_id: str` Identifier. - `namespace_id: str` Namespace identifier tag. - `cursor: Optional[str]` Opaque token indicating the position from which to continue when requesting the next set of records if the amount of list results was limited by the limit parameter. A valid value for the cursor can be obtained from the `cursors` object in the `result_info` structure. - `limit: Optional[float]` Limits the number of keys returned in the response. The cursor attribute may be used to iterate over the next batch of keys if there are more than the limit. - `prefix: Optional[str]` Filters returned keys by a name prefix. Exact matches and any key names that begin with the prefix will be returned. ### Returns - `class Key: …` A name for a value. A value stored under a given key may be retrieved via the same key. - `name: str` A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL. - `expiration: Optional[float]` The time, measured in number of seconds since the UNIX epoch, at which the key will expire. This property is omitted for keys that will not expire. - `metadata: Optional[object]` Arbitrary JSON that is associated with a key. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.kv.namespaces.keys.list( namespace_id="0f2ac74b498b48028cb68387c421e279", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.name) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "name": "My-Key", "expiration": 1577836800, "metadata": {} } ], "result_info": { "count": 1, "cursor": "6Ck1la0VxJ0djhidm1MdX2FyDGxLKVeeHZZmORS_8XeSuhz9SjIJRaSa2lnsF01tQOHrfTGAP3R5X1Kv5iVUuMbNKhWNAXHOl6ePB0TUL8nw" } } ```