File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,7 @@ Ready-to-run examples are available in `examples/`:
261261- ` examples/async_extract.py `
262262- ` examples/sync_web_search.py `
263263- ` examples/async_web_search.py `
264+ - ` examples/sync_session_list.py `
264265
265266## License
266267
Original file line number Diff line number Diff line change 1+ """
2+ Example: list sessions synchronously with the Hyperbrowser SDK.
3+
4+ Run:
5+ export HYPERBROWSER_API_KEY="your_api_key"
6+ python3 examples/sync_session_list.py
7+ """
8+
9+ from hyperbrowser import Hyperbrowser
10+ from hyperbrowser .models import SessionListParams
11+
12+
13+ def main () -> None :
14+ with Hyperbrowser () as client :
15+ response = client .sessions .list (
16+ SessionListParams (
17+ page = 1 ,
18+ limit = 5 ,
19+ )
20+ )
21+
22+ print (f"Success: { response .success } " )
23+ print (f"Returned sessions: { len (response .data )} " )
24+ for session in response .data :
25+ print (f"- { session .id } ({ session .status } )" )
26+
27+
28+ if __name__ == "__main__" :
29+ main ()
You can’t perform that action at this time.
0 commit comments