Pagination¶
How it works¶
All EventimClient methods return Python iterators. pyventim fetches pages from Eventim lazily — the next page is only requested when the iterator is consumed past the end of the current page.
for product_group in client.product_groups(categories=["Concerts"]):
# Page 1 is fetched when iteration starts.
# Page 2 is fetched only after all items from page 1 are yielded.
# And so on.
process(product_group)
This means you can stop iteration early (e.g. with break) and only the pages you actually consumed will have been fetched.
page_limit¶
The page_limit parameter caps the number of pages that will be fetched:
# Fetch at most 3 pages worth of results
for pg in client.product_groups(categories=["Concerts"], page_limit=3):
...
Without page_limit, pyventim will keep fetching until Eventim returns an empty page, which for popular categories can mean hundreds of requests.
Always set page_limit when exploring
Fetching the full Eventim catalogue for a category like "Concerts" in Germany can result in dozens of HTTP requests. Set page_limit when prototyping or in any automated script that runs frequently.
start_page¶
All methods also accept start_page to begin pagination from a specific page number (1-indexed). This is useful for resuming interrupted runs or for parallel processing:
# Start from page 5
for pg in client.product_groups(categories=["Concerts"], start_page=5, page_limit=2):
...
Page size¶
pyventim does not control the page size — it uses Eventim's default, which varies by endpoint. Page size is not configurable.