Skip to content

    iter_items

    Process records across cursor-based pages. For a brand list, each item is a brand dictionary.

    Signature

    iter_items(fetch, /, *args, **kwargs) -> Iterator[Any]

    Parameters

    fetch
    Cursor-based SDK list method. Pass the method without calling it.
    *args, **kwargs
    Arguments for that method, including filters and page size. The helper sends the next cursor and keeps the other arguments fixed.

    Return value

    Yields elements of a list in data, or of an items, rows or findings list inside data. Other response shapes yield no items.

    Errors

    • Catch AeoError for a repeated cursor or a page count above the 10,000-page limit. Errors raised by the list method also reach the caller.

    Python example

    import os
    from aeo_sdk import AeoClient, iter_items
    
    with AeoClient(os.environ["AEO_API_KEY"], base_url=os.environ["AEO_API_BASE_URL"]) as client:
        for brand in iter_items(client.v2_get_brands, limit=25):
            print(brand["id"])

    See Python client setup for the environment variables, response properties and retry settings.