unfret-client
A minimal Python client for Unfret: before an AI agent buys, ask whether the store or product page shows signs of a scam, dropshipped generic goods, fake reviews or pressure tricks, and get back what to do. MIT licensed.
pip install unfret-client
The first release on PyPI comes with Unfret's next release; until it's there, install it from the source:
pip install "unfret-client @ git+https://git.kroshtan.com/kroshtan/unfret_backend.git#subdirectory=clients/python".
For other languages, see unfret.net/developers/http.
from unfret_client import Unfret
unfret = Unfret(pass_="ufk_…") # or set UNFRET_PASS
decision = unfret.check("https://shop.example/p/42")
decision.action # "allow", "warn" (ask your human first) or "block"
decision.label # "Looks fine", "Worth a look", "Think twice" or "Serious concerns"
decision.reasons # the evidence, one line per flag
It needs an Unfret pass (ufk_…). A deep check (the default: everything, including an AI read of the listing,
its reviews and photos) uses one of the pass's checks; tier="quick" (rules on the page itself) is free. Get a
developer pass with 20 free deep checks at unfret.net/developers, or in code:
issued = Unfret().new_developer_pass() # solves a short proof of work; keep issued["key"] and issued["recovery_code"]
Buy more checks for a pass at unfret.net/checkout. (Agents with a Solana wallet can also pay per check over x402 without a pass; see unfret.net/developers.)
From verdict to action
The action comes from the verdict a shopper would see:
Verdict (band) |
Default action |
|---|---|
Looks fine (reliable) |
allow |
Worth a look (concerns) |
warn |
Think twice (careful) |
block |
Serious concerns (junk_or_scam) |
block |
Change it with policy, e.g. Unfret(policy={"careful": "warn"}). A page Unfret couldn't assess (not a store or
product page) is warn (unassessed= to change). decision.verdict has Unfret's whole answer, including
risk_score, confidence, its own action and what the pass has left (free_checks_left, balance_usd_micros).
Options and errors
check(url, tier="deep" | "quick", page_content=None): send page_content (the page's HTML) for marketplaces such as
Amazon, which refuse server-side visits. checks_left() returns what the pass has left. AsyncUnfret is the same
for asyncio. The server is https://unfret.net (base_url=, or UNFRET_API_URL; https://dev.unfret.net is the
test server).
A refused call raises an UnfretError and is never charged: InvalidPassError (401), NoChecksLeftError (402: buy
checks, or use quick), RateLimitedError (429; retry_after in seconds, also when free deep checks are paused
until 00:00 UTC) and PageUnreadableError (send page_content). Each has status, code and detail.
Source: git.kroshtan.com/kroshtan/unfret_backend (mirror on GitHub).
Metadata
Release files for unfret-client 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| unfret_client-0.1.0.tar.gz | 8.0 kB | Without provenance | Details for unfret_client-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| unfret_client-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for unfret_client-0.1.0-py3-none-any.whl |
Total release size: 17.0 kB
Release files / unfret_client-0.1.0.tar.gz
| Download URL | unfret_client-0.1.0.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78fb1296a81f35ad11a96cb3eff72a4bcb9123a0e9d84c24faeac5c4ff9f2478
|
|
BLAKE2b-256 checksum How to use checksums |
aa7a2317642f2ad9fd46c23a0f2d0b8d014f15ce2b509dc81b44226588e2586a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / unfret_client-0.1.0-py3-none-any.whl
| Download URL | unfret_client-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e34f5857316eeac6a9960f83cd12f9aa3de621ce993f6aec8c227922671cab9c
|
|
BLAKE2b-256 checksum How to use checksums |
a7f9fcbc2deae390dc4736263d3e8ff2767f85da386a846d4c9cb0e86e1198eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for unfret-client 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.