Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

client.rules.lists.items.list - Pagination not working

Open
#2,667 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
api

Research direction

Start with the client.rules.lists.items.list() entry point and reproduce the issue using the example with a list larger than one page. Inspect the pagination handling and compare it with the cited SyncCursorPagination change; done means iteration returns all list items without requiring an oversized per_page value.

Written by the indexing model from the issue text.

Description

Confirm this is a Python library issue and not an underlying Cloudflare API issue.
  • This is an issue with the Python library
Describe the bug

Hi there,

It appears as though pagination is not working for client.rules.lists.items.list(). I am only getting the first page back. I've taken a look at the source code and it appears it could be related to the removal of SyncCursorPagination? I'm rusty as a dev so I wouldn't put money on it.

Please check out this PR though (here) which looks to have made a change. For now the list I have is around 480 items so I'm getting around this with client.rules.lists.items.list(account_id=account_id, list_id=rule_id, per_page=500) but this is a stop-gap solution at best.

See "To Reproduce" for a very basic reproduction.

Any help would be greatly appreciated!

To Reproduce
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)

ip_list = []
rule_id = "xxxxx"
account_id = "xxxxx"

for item in client.rules.lists.items.list(list_id=rule_id, account_id=account_id):
    ip_list.append(account)
print(ip_list)
Code snippets

OS

macOS

Python version

3.11.2

Library version

4.3.1

Dominant language
Python
Stars
509
Forks
150
Avg merge
3h 15m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/cloudflare-python

All issues in cloudflare/cloudflare-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.