From 9e9c02104736814e0c8cd310c420e2cccf555c4d Mon Sep 17 00:00:00 2001 From: Manabu Niseki Date: Sun, 15 Feb 2026 08:59:01 +0900 Subject: [PATCH 1/2] docs: add recommendation & drop triple arrows --- README.md | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 6b048af..ea8a737 100644 --- a/README.md +++ b/README.md @@ -16,55 +16,70 @@ pip install urlscan-python ## Quickstart -Start by importing `urlscan` module +Start by importing `urlscan` module: ```py ->>> import urlscan +import urlscan ``` Create a client with your API key: ```py ->>> client = urlscan.Client("") +with urlscan.Client("") as client: + ... ``` +!!! NOTE + + The recommended way to use `Client` is as a context manager like the above. This will ensure closing a connection when leaving the with block. + + Alternatively, you can explicitly close the connection pool without block-usage using `._close()`: + + ```py + client = urlscan.Client("") + try: + ... + finally: + client._close() + ``` + Scan a URL: ```py ->>> res = client.scan("", visibility="public") ->>> uuid: str = res["uuid"] +res = client.scan("", visibility="public") +uuid: str = res["uuid"] ``` Wait for a scan result: ```py ->>> client.wait_for_result(uuid) +client.wait_for_result(uuid) ``` Get a scan result: ```py ->>> result = client.get_result(uuid) +result = client.get_result(uuid) ``` Bulk scan: ```py ->>> client.bulk_scan(["", ""], visibility="public") +client.bulk_scan(["", ""], visibility="public") ``` Alternatively, you can use `_and_get_result(s)` suffixed methods to do scan, wait and get at once. ```py ->>> client.scan_and_get_result("", visibility="public") ->>> client.bulk_scan_and_get_results(["", ""], visibility="public") +client.scan_and_get_result("", visibility="public") +client.bulk_scan_and_get_results(["", ""], visibility="public") ``` `urlscan.Client.search()` returns an iterator to iterate search results: ```py ->>> for result in client.search("page.domain:example.com"): ->>> print(result["_id"]) +for result in client.search("page.domain:example.com"): + print(result["_id"]) ``` ### Pro From 703154a93e76b9b9cbca44b36289bf8cac0aa551 Mon Sep 17 00:00:00 2001 From: Manabu Niseki Date: Sun, 15 Feb 2026 09:00:25 +0900 Subject: [PATCH 2/2] fix: use GitHub Markdown syntax --- README.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ea8a737..f031280 100644 --- a/README.md +++ b/README.md @@ -29,19 +29,18 @@ with urlscan.Client("") as client: ... ``` -!!! NOTE - - The recommended way to use `Client` is as a context manager like the above. This will ensure closing a connection when leaving the with block. - - Alternatively, you can explicitly close the connection pool without block-usage using `._close()`: - - ```py - client = urlscan.Client("") - try: - ... - finally: - client._close() - ``` +> [!NOTE] +> The recommended way to use `Client` is as a context manager like the above. This will ensure closing a connection when leaving the with block. +> +> Alternatively, you can explicitly close the connection pool without block-usage using `._close()`: +> +> ```py +> client = urlscan.Client("") +> try: +> ... +> finally: +> client._close() +> ``` Scan a URL: