Skip to main content

urlquery-api-python

PyPI License: MIT

The Python client for the urlquery v2 API. urlquery analyzes URLs in an isolated browser and records what they do: redirects, HTTP traffic, scripts, downloads, detections and a screenshot.

With this package you can submit URLs and wait for the reports, read and compare reports, search a year of reports, look up reputation, explore Host Profile, and manage YARA rules, watchlists and page monitors. Results are typed pydantic models.

Documentation: https://docs.urlquery.net/docs/libraries/python

Install

pip install urlquery-api

It needs Python 3.10 or later, and an API key from your urlquery.net account.

Example

from urlquery_api import Client

with Client() as client:  # the API key from URLQUERY_APIKEY
    # Analyze a URL as a restricted report and wait for it.
    s = client.submit("https://example.com/login", access="restricted", wait=True)

    # The full report: every HTTP transaction, script and artifact.
    report = client.report(s.report_id)
    for t in report.http:
        print(t.response.status_code, t.url.addr)

    # Every other report that loaded the same scripts.
    for script in report.javascript.script:
        for hit in client.iter_search_results(f"javascript.script.sha256:{script.sha256}"):
            print(script.sha256[:12], hit.report_id, hit.url.addr)

How it behaves

  • Typed results. The models in urlquery_api.models are generated from the API's OpenAPI description, so every field of every response, down to the report's transactions, scripts and artifacts, is typed.
  • Paging. Each list method returns one page; its iter_… method yields every item, following cursors for you.
  • Rate limits and retries. A call waits out a rate limit for its Retry-After, and a GET is retried after a server error or a network failure; max_retry_wait bounds the waiting. Submissions are never retried once they may have been queued.
  • Waiting for an analysis. submit(..., wait=True) and wait_for_submission poll until the analysis is done or has failed; on a timeout, WaitTimeoutError.submission is the last state, with the queue and report IDs.
  • Errors. API errors raise APIError with the API's error code, such as NOT_FOUND or RATE_LIMIT_EXCEEDED.
  • Hostile content. Report content comes from the analyzed sites: treat titles, scripts and downloads as untrusted data.

Contributing

Report bugs and ask for features in the issues. Pull requests are welcome: this repository is published from urlquery's main repository, so an accepted change is applied there and arrives here with the next release. src/urlquery_api/models.py is generated from the API description; don't edit it by hand. For other questions, write to contact@urlquery.net.

pip install -e '.[test]'
pytest

License

MIT © urlquery.net, see LICENSE.

Metadata

Release files for urlquery-api 0.8.0

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

Source distribution (sdist)

Source distribution for urlquery-api 0.8.0
File Size Uploaded Provenance Actions
urlquery_api-0.8.0.tar.gz 25.0 kB With provenance Details for urlquery_api-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for urlquery-api 0.8.0
File Interpreter ABI Platform Actions
urlquery_api-0.8.0-py3-none-any.whl Python 3 none any Details for urlquery_api-0.8.0-py3-none-any.whl

Total release size: 49.4 kB

Release files / urlquery_api-0.8.0.tar.gz

Download URL urlquery_api-0.8.0.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fd560e248922c502da1418989e21f8bd3cfaa5d692e0371960c3d29f30cfeb82
BLAKE2b-256 checksum
How to use checksums
814844cda4f9e19024632b89de233a40a11f938c4faadccacb2d97e3c0d390eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / urlquery_api-0.8.0-py3-none-any.whl

Download URL urlquery_api-0.8.0-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f64b1c43af51ba5362656a75a0d0bc55c8cc6d2e72ca5ca452e569b6aab6fd0d
BLAKE2b-256 checksum
How to use checksums
f6b3b26e28fa8705a1b6b1a824620b401082ff7feda4ff0a5225d0a470964f96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for urlquery-api 0.8.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for urlquery_api-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files Full provenance

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