SDKs overview
Spyse offers programmatic access to its cybersecurity data and threat intelligence platform primarily through a RESTful API. To facilitate integration and streamline development, Spyse provides official Software Development Kits (SDKs) for specific programming languages. These SDKs abstract the underlying HTTP requests, authentication mechanisms, and data parsing, allowing developers to interact with the Spyse API using native language constructs rather than direct API calls. The primary official SDK supports Python, a widely used language in cybersecurity, data science, and automation.
The Python SDK is designed to simplify common tasks such as querying domains, IP addresses, SSL certificates, and vulnerabilities. It handles API key management, request throttling, and response serialization, enabling developers to focus on data utilization rather than API mechanics. While the official SDK provides a robust foundation, the broader developer community may also contribute open-source libraries that extend Spyse's capabilities or offer integrations with other tools. This approach aligns with common API integration patterns, where official SDKs serve as the primary conduit for a streamlined developer experience, as outlined in general API design principles by organizations like the World Wide Web Consortium on API design.
Developers can utilize these SDKs for various applications, including automating threat intelligence gathering, building custom security tools, integrating Spyse data into SIEM (Security Information and Event Management) systems, or performing large-scale data analysis for research purposes. The official Spyse API documentation provides comprehensive details on available endpoints and data structures, which the SDKs encapsulate.
Official SDKs by language
Spyse currently maintains an official SDK for Python. This SDK is developed and supported by Spyse to ensure full compatibility with the latest API versions and features. It is the recommended method for Python developers to interact with the Spyse API, offering a stable and well-documented interface.
The Python SDK provides methods corresponding to various API endpoints, allowing developers to query different types of cybersecurity data. This includes functions for searching domains, IPs, autonomous systems (ASNs), SSL/TLS certificates, and vulnerabilities. The SDK aims to provide a consistent and idiomatic Python interface for all available API functionalities. Details on specific methods and their parameters are available within the SDK's documentation, which typically mirrors the structure of the Spyse API reference.
| Language | Package Name | Installation Command | Maturity |
|---|---|---|---|
| Python | spyse |
pip install spyse |
Stable, Actively Maintained |
Installation
Installing the official Spyse Python SDK is performed using pip, the standard package installer for Python. Ensure you have Python 3.6 or newer installed on your system. It is also recommended to use a virtual environment to manage dependencies for your project, preventing conflicts with other Python projects.
Prerequisites
- Python 3.6+
pip(usually included with Python)
Steps for Installation
-
Create a virtual environment (recommended):
python3 -m venv spyse_env source spyse_env/bin/activate # On Windows, use `spyse_env\Scripts\activate` -
Install the Spyse SDK:
pip install spyse -
Verify installation:
You can quickly check if the package was installed correctly by trying to import it in a Python interpreter:
python >>> import spyse >>> print(spyse.__version__)If no errors occur and a version number is displayed, the SDK is successfully installed. For more detailed installation instructions, refer to the official Spyse documentation.
Quickstart example
This quickstart example demonstrates how to use the Spyse Python SDK to retrieve information about a domain. Before running this code, you will need a Spyse API key. You can obtain an API key by registering for an account on the Spyse website and navigating to your profile settings. Remember to replace 'YOUR_API_KEY' with your actual API key.
This example queries the domain example.com to fetch its associated IP addresses and then prints them. The SDK handles the API request, authentication, and parsing of the JSON response into Python objects, simplifying data access.
import spyse
import os
# It's recommended to load your API key from environment variables
# For demonstration, we'll use a placeholder. Replace with your actual key.
# Alternatively: spyse.api_key = os.environ.get('SPYSE_API_KEY')
spyse.api_key = 'YOUR_API_KEY'
try:
# Initialize the Spyse API client
api = spyse.API()
# Query for domain information
domain_name = "example.com"
print(f"Fetching information for domain: {domain_name}")
# Use the domains API to get details for a specific domain
# The SDK abstracts the endpoint call and response parsing
domain_info = api.domains.get(domain_name)
if domain_info:
print(f"Domain: {domain_info.name}")
print(f"Registrar: {domain_info.registrar}")
print(f"Creation Date: {domain_info.created_at}")
# Accessing associated IPs
if domain_info.ips:
print("Associated IPs:")
for ip in domain_info.ips:
print(f" - {ip}")
else:
print("No associated IPs found.")
# Accessing DNS records (example for A records)
if domain_info.dns_records and 'A' in domain_info.dns_records:
print("A Records:")
for record in domain_info.dns_records['A']:
print(f" - {record.value}")
else:
print(f"No information found for domain: {domain_name}")
except spyse.SpyseAPIError as e:
print(f"Spyse API Error: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
This example demonstrates basic domain querying. The SDK also supports advanced search queries, filtering, and access to other data types like IP addresses, certificates, and vulnerabilities. For more complex use cases and available methods, refer to the Spyse API documentation and the SDK's specific method references.
Community libraries
While Spyse provides an official Python SDK, the open-source community may develop and maintain additional libraries or integrations. These community-contributed tools can offer various benefits, such as:
- Integrations with other security tools: Community libraries might provide connectors or wrappers to use Spyse data directly within popular security frameworks, SIEM systems, or threat intelligence platforms that are not officially supported.
- Specialized functionalities: Developers might create libraries focused on niche use cases, such as specific types of data analysis, visualization tools, or automated reporting scripts that leverage Spyse's API.
- Alternative language support: Although Spyse officially supports Python, community members might develop unofficial SDKs for other programming languages like Go, Node.js, or Ruby, catering to different development ecosystems.
- Educational resources and examples: Community projects often come with extensive examples and tutorials, which can be valuable for new users learning to interact with the Spyse API.
It is important to note that community libraries are typically not officially endorsed or supported by Spyse. Their maintenance, security, and compatibility with future API changes depend on the individual contributors. Developers considering using community-driven solutions should evaluate their reliability, active maintenance, and adherence to security best practices. Resources like GitHub and other public code repositories are common places to discover such projects, often found by searching for spyse api or spyse sdk in conjunction with the desired programming language or tool. For example, open-source project hosting sites provide extensive resources for discovering various community-driven developer tools.
Before integrating any community library, review its documentation, check for recent updates, and assess the activity level of its maintainers. The official Spyse documentation remains the authoritative source for API specifications and best practices, even when using third-party integrations.