urlscan.io Blog


About

The urlscan.io Blog covers announcements, product news, and tutorials.


Contact

You can contact us at info@urlscan.io for general inquiries and at sales@urlscan.io for questions around our commercial products.

If you need technical support contact us at support@urlscan.io.

For matters of security, please see our Security Page.

Updates

For updates and announcements, subscribe to our newsletter.

Follow us on Twitter:

Announcing the official urlscan.io Python library

We are excited to announce the release of our official Python API library:


At urlscan.io we have always made sure that every part of our platform was API-enabled. Over the years, we have seen a large number of urlscan.io integrations in commercial and open source software. In addition to off-the-shelf software, many of our users and customers have created their own bespoke integrations with our platform. For these users, Python is by far the most popular programming languages in use.

Unfortunately we have seen many users struggle with a small set of similar issues, whether it is submitting scans in bulk or making sure to pass the correct authentication credentials. For us this reinforced the need to provide an official library which follows best practices of working with our API. With this release of our official Python library we hope to make this process less error-prone for our users and to clearly communicate best practices.

Features

  • Our official Python API library greatly facilitates integration of urlscan.io into your Python project.
  • You can submit URLs as single scans or bulk scans.
  • You can define common variables such as scan visibility, country of origin, custom user agents, and more.
  • You can search for URLs in historic scan results.
  • You can attach tags to your scans to keep scan results organized.

To find out more details visit our official documentation.

Example

The following command will trigger private scans with the tags suspicious and reported for three different URLs, with the scans being performed from a Japanese IP using a custom HTTP User-Agent and a custom HTTP referer header.

client.bulk_scan(
    urls=["https://www.pypi.org", "https://www.github.com/", "https://urlscan.io/"],
    visibility="private",
    tags=["suspicious", "reported"],
    customagent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36",
    referer="<https://www.example.com/>",
    country="jp"
)

You can find examples of Python scripts in the GitHub repository.

Feedback and support

Our goal with this initial release of our library is to collect feedback on how our users interact with the library and which features might be missing. For any suggestions about improvements or further functionality as well as general support and bug reporting, please reach out to our support team at support@urlscan.io.

Available now

The Python API library is available now. For installation visit the repository on PyPI. Our GitHub page features the codebase as well as an installation guide and examples. If you would like to find out more about specific syntax and comprehensive lists of variables and commands, check out the official documentation.