Skip to main content

apiverify

Status: 0.1.1 fixes the wrong answers an independent evaluation found in 0.1.0, but has not been re-tested independently yet. 0.1.0 could return not_found for names that exist at runtime (members inherited from object, members generated by class decorators, members attached after the class body, names made via globals()/exec) and verified for conditional names (TYPE_CHECKING-only, del-ed, version-gated). 0.1.1 now answers cannot_verify for those, limits unpacking (only .py/.pyi, 100 MB total, 8 MB per file) and validates inputs. Expect many cannot_verify answers (the evaluation saw 46% abstention on lazily loaded or re-exporting libraries such as pydantic 2). Monkeypatching from a different module cannot be seen. Do not treat this as proven reliable.

Does this Python API exist in this exact package version? apiverify answers from the published source of that version, not from docs or model memory.

Three answers only:

  • verified: found. Returns file, line, signature, and deprecation signals.
  • not_found: every lookup path was followed and the name is absent.
  • cannot_verify: the answer depends on something static analysis cannot settle (module-level __getattr__, a base class or re-export from outside the package, a file that will not parse). The agent should not assume either way.

It downloads the release from PyPI, checks the sha256 PyPI lists for it, unpacks it safely, and reads it with ast. It never imports or runs package code. No dependencies.

Use

python -m apiverify.cli requests.Session.get --version 2.31.0
python -m apiverify.cli requests.exceptions.JSONDecodeError -v 2.26.0   # not_found
python -m apiverify.cli requests.exceptions.JSONDecodeError -v 2.27.0   # verified
python -m apiverify.cli PIL.Image.open -v 10.0.0 --package pillow -k mode

Exit code: 0 verified, 1 not_found, 2 cannot_verify.

Install

pip install apiverify        # or: uvx apiverify-mcp   (MCP server)

As an MCP server (stdio)

Tool: verify_python_api with symbol, version, optional package, kwargs.

{ "mcpServers": { "apiverify": { "command": "uvx", "args": ["--from", "apiverify", "apiverify-mcp"] } } }

(From a clone you can also use python -m apiverify.mcp_server.)

Suggested line for an agent's instructions file (AGENTS.md / CLAUDE.md): "Before calling a library API you are not certain exists in the project's pinned version, call verify_python_api. Treat cannot_verify as unknown, not as yes."

Tested scope (see eval/)

Unit tests: python -m unittest discover -s tests (offline fixtures, 14 tests).

Runtime comparison: python eval/run_eval.py installs exact versions of requests (4), click (3) and flask (3), asks Python itself whether each candidate symbol exists, and compares. This is the author's own run on the cases the tool was built against, so it does not show reliability (see the warning above). Result in eval/last_run.txt: 2,411 correct, 0 false positives, 0 false negatives, 442 abstentions (all flask, mostly names re-exported from werkzeug/jinja2, which live outside the flask artifact), 2 instance attributes not scored.

Limits

  • Python on PyPI only. No JavaScript, Rust or Go yet.
  • Static analysis. Names created at runtime are reported as cannot_verify, not guessed.
  • Not scored in the eval: keyword-argument checks, deprecation signals, and instance attribute results.
  • The eval's candidates mostly come from names that exist in some version, with only a few decoys per library, so it measures version differences well and hallucinated names weakly. It is three libraries, not a benchmark.
  • It has not been compared against Context7 or any retrieval tool. That comparison needs an agent harness and model spend, and is not done.
  • No evidence yet that developers would pay for it or that agents call it unprompted.
  • Needs network access to pypi.org and files.pythonhosted.org. Artifacts are cached in $APIVERIFY_CACHE.

Reaching agents

See DISTRIBUTION.md.

Metadata

Release files for apiverify 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apiverify 0.1.1
File Size Uploaded Provenance Actions
apiverify-0.1.1.tar.gz 18.8 kB Without provenance Details for apiverify-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apiverify 0.1.1
File Interpreter ABI Platform Actions
apiverify-0.1.1-py3-none-any.whl Python 3 none any Details for apiverify-0.1.1-py3-none-any.whl

Total release size: 34.7 kB

Release files / apiverify-0.1.1.tar.gz

Download URL apiverify-0.1.1.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5a2fbabed7edd22f4fb0924a3961f5ce106250c9873a6fa3af42946a6e6d6467
BLAKE2b-256 checksum
How to use checksums
8cf7b8281ade156c1eaeeb0b7df61db03d758144fe6d9331f6fbba4052ddd8ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / apiverify-0.1.1-py3-none-any.whl

Download URL apiverify-0.1.1-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53fcf23fa7c8402f33c4956375d2f74ccda47fa7d76cf6aa6a6c9f553f40ff10
BLAKE2b-256 checksum
How to use checksums
57da6e754246a59f9146bcf3e0d2d41b97290ba3ceccc9a8252a314e35749e87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Security for apiverify 0.1.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page