Skip to content

    aiter_items

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

    Signature

    aiter_items(fetch, /, *args, **kwargs) -> AsyncIterator[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 asyncio
    import os
    from aeo_sdk import AsyncAeoClient, aiter_items
    
    async def main():
        async with AsyncAeoClient(os.environ["AEO_API_KEY"], base_url=os.environ["AEO_API_BASE_URL"]) as client:
            async for brand in aiter_items(client.v2_get_brands, limit=25):
                print(brand["id"])
    
    asyncio.run(main())

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