Python SDK Example
import time from flareio import FlareApiClient api_client = FlareApiClient.from_env() last_from: str | None = None fetched_pages: int = 0 for resp in api_client.scroll( method="GET", url="/firework/v2/me/feed/credentials", params={ "from": last_from, "order_type": "asc", }, ): # Rate limiting. time.sleep(1) resp_data: dict = resp.json() fetched_pages += 1 num_results: int = len(resp_data["items"]) print(f"Fetched page {fetched_pages} with {num_results} results...") # Save the last "next" value. last_from = resp_data.get("next") or last_from for item in resp_data["items"]: print(item) print(f"The next execution could resume using {last_from=}.")
Was this page helpful?