Skip to main content

Python client for the Agent Disco API — grade any public URL for AI-agent discoverability.

Project description

agentdisco — Python client for Agent Disco

PyPI version Python versions MIT License CI

Grade any public URL for AI-agent discoverability. Thin Python wrapper over the REST API at https://agentdisco.io/api/v1.

Install

pip install agentdisco

Requires Python 3.9+.

Quick start

Submit a scan (anonymous, 10 scans/day/IP)

from agentdisco import AgentDisco

with AgentDisco() as client:
    scan = client.submit_scan("https://example.com")
    print(scan.id, scan.status)

Poll until complete

import time

with AgentDisco() as client:
    scan = client.submit_scan("https://example.com")
    while scan.status not in {"completed", "failed"}:
        time.sleep(5)
        scan = client.get_scan(scan.id)

    print(f"grade: {scan.grade} ({scan.score}/100)")

Mint a key (raises your quota to 100 scans/day)

from agentdisco import AgentDisco

# Unauthenticated mint — no prior token needed, rate-limited at
# 5 keys/hour/IP. Token is shown ONCE; store it.
key = AgentDisco().mint_key()
print(key.token)  # ak_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

authed = AgentDisco(token=key.token)
authed.submit_scan("https://your-site.example")

Get summary for a previously-scanned host

with AgentDisco() as client:
    site = client.get_website("example.com")
    print(site.latest_grade, site.latest_score, site.scan_count)

Higher rate limits

Authenticated-tier keys (500 scans/day/key) need a signed-in account. Sign up at https://agentdisco.io/register, then mint via the web form at https://agentdisco.io/developers.

Tier Rate limit How to get
Anonymous (no key) 10 scans / day / IP default
Anonymous key 100 scans / day / key mint_key() above
Authenticated key 500 scans / day / key sign in, mint at /developers

Error handling

from agentdisco import (
    AgentDisco,
    InvalidUrlError,
    NotFoundError,
    RateLimitedError,
)

try:
    scan = AgentDisco().submit_scan("https://example.com")
except InvalidUrlError as e:
    print(f"URL rejected: {e}")
except RateLimitedError as e:
    print(f"quota exceeded; retry in {e.retry_after_seconds}s")
except NotFoundError as e:
    print(f"not found: {e}")

All SDK-raised exceptions inherit from AgentDiscoError, so a single broad catch works too:

from agentdisco import AgentDiscoError
try:
    ...
except AgentDiscoError as e:
    log.warning("agentdisco failure: %s", e)

Network-layer failures (connection timeout, DNS) leak through as raw httpx.HTTPError — they're platform issues, not API errors.

Custom base URL

For self-hosted deployments or local testing:

AgentDisco(base_url="http://localhost:1977")

Links

Licence

MIT. See LICENSE. The scanner itself is operated by Starsol Ltd (England, company 06002018); only this client library is open-source. Issues + pull requests welcome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentdisco-0.1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentdisco-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file agentdisco-0.1.0.tar.gz.

File metadata

  • Download URL: agentdisco-0.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for agentdisco-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dc216131e614583dd44277a8a8caae807df47522f6da72d5b6b42b47d1f4b90e
MD5 6d70f57305bbed03ff1b1d9807f37b38
BLAKE2b-256 270bfa141bfb60a58553043c66ad48eaa7a0c7bf2d14a8319f670f86d0a96cc1

See more details on using hashes here.

File details

Details for the file agentdisco-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agentdisco-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for agentdisco-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e8197b0246aec89d331884759d9bc9169b45041598a314d6d4263b53df5e405
MD5 63a902c449062eabbab6e0b6dbdfd9c7
BLAKE2b-256 f198940aabbeb135b16ca6a43d20c9ae4e9eeb50823b4c5c6ae4b9082203953a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page