---
title: Get list items
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/python)

[Rules Lists](https://developers.cloudflare.com/api/python/resources/rules)

[Lists](https://developers.cloudflare.com/api/python/resources/rules/subresources/lists)

[Items](https://developers.cloudflare.com/api/python/resources/rules/subresources/lists/subresources/items)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Get list items

rules.lists.items.list(strlist\_id, ItemListParams\*\*kwargs) -> SyncCursorPaginationAfter\[[ItemListResponse](<https://developers.cloudflare.com/api/python/resources/rules#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)>)]

GET/accounts/{account\_id}/rules/lists/{list\_id}/items

Fetches all the items in the list.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`Account Filter Lists Edit``Account Filter Lists Read`

##### ParametersExpand Collapse

account\_id: str

The Account ID for this resource.

maxLength32

minLength32

[Link to this property](<#(resource)%20rules.lists.items%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20account_id%20%3E%20(schema)>)

list\_id: str

The unique ID of the list.

maxLength32

minLength32

[Link to this property](<#(resource)%20rules.lists.items%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20list_id%20%3E%20(schema)>)

cursor: Optional\[str]

The pagination cursor. An opaque string token that indicates where to continue when requesting the next/previous set of records. The response provides cursor values under `result_info.cursors`. You should make no assumptions about a cursor’s content or length.

[Link to this property](<#(resource)%20rules.lists.items%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20cursor%20%3E%20(schema)>)

per\_page: Optional\[int]

Amount of results to include in each paginated response. A non-negative 32 bit integer.

maximum500

minimum1

[Link to this property](<#(resource)%20rules.lists.items%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20per_page%20%3E%20(schema)>)

search: Optional\[str]

A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.

[Link to this property](<#(resource)%20rules.lists.items%20%3E%20(method)%20list%20%3E%20(params)%20default%20%3E%20(param)%20search%20%3E%20(schema)>)

##### ReturnsExpand Collapse

<details>

<summary>

<a href="https://developers.cloudflare.com/api/python/resources/rules#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)">ItemListResponse</a>

</summary>

One of the following:

<details>

<summary>

class ListsListItemIPFull: …

</summary>

id: str

Defines the unique ID of the item in the List.

maxLength32

minLength32

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20id">Link to this property</a>

created\_on: str

The RFC 3339 timestamp of when the list was created.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20created_on">Link to this property</a>

ip: str

An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20ip">Link to this property</a>

modified\_on: str

The RFC 3339 timestamp of when the list was last modified.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20modified_on">Link to this property</a>

comment: Optional\[str]

Defines an informative summary of the list item.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20comment">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

class ListsListItemHostnameFull: …

</summary>

id: str

Defines the unique ID of the item in the List.

maxLength32

minLength32

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20id">Link to this property</a>

created\_on: str

The RFC 3339 timestamp of when the list was created.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20created_on">Link to this property</a>

<details>

<summary>

hostname: <a href="https://developers.cloudflare.com/api/python/resources/rules#(resource)%20rules.lists%20%3E%20(model)%20hostname%20%3E%20(schema)">Hostname</a>

Hostnames support ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (\*), and the hyphen (-).

</summary>

url\_hostname: str

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20hostname%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20hostname%20%3E%20(schema)%20%3E%20(property)%20url_hostname">Link to this property</a>

exclude\_exact\_hostname: Optional\[bool]

Only applies to wildcard hostnames (e.g., \*.example.com). When true (default), the rule blocks only subdomains. When false, the rule blocks both the root domain and subdomains.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20hostname%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20hostname%20%3E%20(schema)%20%3E%20(property)%20exclude_exact_hostname">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20hostname">Link to this property</a>

modified\_on: str

The RFC 3339 timestamp of when the list was last modified.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20modified_on">Link to this property</a>

comment: Optional\[str]

Defines an informative summary of the list item.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20comment">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%201">Link to this property</a>

<details>

<summary>

class ListsListItemRedirectFull: …

</summary>

id: str

Defines the unique ID of the item in the List.

maxLength32

minLength32

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20id">Link to this property</a>

created\_on: str

The RFC 3339 timestamp of when the list was created.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20created_on">Link to this property</a>

modified\_on: str

The RFC 3339 timestamp of when the list was last modified.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20modified_on">Link to this property</a>

<details>

<summary>

redirect: <a href="https://developers.cloudflare.com/api/python/resources/rules#(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)">Redirect</a>

The definition of the redirect.

</summary>

source\_url: str

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20source_url">Link to this property</a>

target\_url: str

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20target_url">Link to this property</a>

include\_subdomains: Optional\[bool]

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20include_subdomains">Link to this property</a>

preserve\_path\_suffix: Optional\[bool]

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20preserve_path_suffix">Link to this property</a>

preserve\_query\_string: Optional\[bool]

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20preserve_query_string">Link to this property</a>

<details>

<summary>

status\_code: Optional\[Literal\[301, 302, 307, 308]]

</summary>

One of the following:

301

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20status_code%20%3E%20(member)%200">Link to this property</a>

302

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20status_code%20%3E%20(member)%201">Link to this property</a>

307

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20status_code%20%3E%20(member)%202">Link to this property</a>

308

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20status_code%20%3E%20(member)%203">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20status_code">Link to this property</a>

subpath\_matching: Optional\[bool]

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20subpath_matching">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20redirect">Link to this property</a>

comment: Optional\[str]

Defines an informative summary of the list item.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20comment">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%202">Link to this property</a>

<details>

<summary>

class ListsListItemASNFull: …

</summary>

id: str

Defines the unique ID of the item in the List.

maxLength32

minLength32

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%203%20%3E%20(property)%20id">Link to this property</a>

asn: int

Defines a non-negative 32 bit integer.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%203%20%3E%20(property)%20asn">Link to this property</a>

created\_on: str

The RFC 3339 timestamp of when the list was created.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%203%20%3E%20(property)%20created_on">Link to this property</a>

modified\_on: str

The RFC 3339 timestamp of when the list was last modified.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%203%20%3E%20(property)%20modified_on">Link to this property</a>

comment: Optional\[str]

Defines an informative summary of the list item.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%203%20%3E%20(property)%20comment">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)%20%3E%20(variant)%203">Link to this property</a>

</details>

[Link to this property](<#(resource)%20rules.lists.items%20%3E%20(model)%20item_list_response%20%3E%20(schema)>)

### Get list items

Python

HTTPTypeScriptPythonGoTerraform

```
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.rules.lists.items.list(
    list_id="2c0fc9fa937b11eaa1b71c4d701ab86e",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
page = page.result[0]
print(page)
```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "id": "34b12448945f11eaa1b71c4d701ab86e",
      "created_on": "2020-01-01T08:00:00Z",
      "ip": "10.0.0.1",
      "modified_on": "2020-01-10T14:00:00Z",
      "comment": "Private IP address"
    }
  ],
  "success": true,
  "result_info": {
    "cursors": {
      "after": "yyy",
      "before": "xxx"
    }
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "id": "34b12448945f11eaa1b71c4d701ab86e",
      "created_on": "2020-01-01T08:00:00Z",
      "ip": "10.0.0.1",
      "modified_on": "2020-01-10T14:00:00Z",
      "comment": "Private IP address"
    }
  ],
  "success": true,
  "result_info": {
    "cursors": {
      "after": "yyy",
      "before": "xxx"
    }
  }
}
```