urlDNA is a powerful tool for comprehensive URL analysis, advanced brand monitoring, phishing detection, and custom query capabilities. This Python package allows users to interact with the urlDNA API seamlessly through Python.
- Create Scan: Initiate a new scan for a given URL.
- Search: Perform a search query to find relevant data.
- Get Scan: Retrieve the results of a all scans.
- Viewports: All available viewports by device.
- User Agents: All available user agents.
To install the urlDNA Python package, use pip:
pip install urldna
First, import the package and initialize the client with your API key:
from urldna import UrlDNA
# Initialize the client with your API key
api_key = 'YOUR_API_KEY'
client = UrlDNA(api_key)
Initiate a new scan for a given URL to analyze its content and metadata.
# Create a scan for a URL
url = 'https://example.com'
scan_result = client.create_scan(url)
print(f'Scan ID: {scan_result.scan.id}')
Perform a search query using Custom Query Language to find relevant data.
# Perform a search query
query = 'domain LIKE google.com'
search_results = client.search(query)
print(search_results)
Retrieve the results of a previously initiated scan using its scan ID.
# Get scan results
scan_id = 'your_scan_id'
scan_result = client.get_scan(scan_id)
print(scan_result)
List of all available viewports (device, height, width)
viewports = client.viewports()
print(viewports)
List of all available user agents (browser, device, user_agent)
user_agents = client.user_agents()
print(user_agents)
for all API details, please viti the API Documentation page.
UrlDNA(api_key)
- Initializes the client with the provided API key. Copy your API key from Profile page.
create_scan(url, device='DESKTOP', width=1920, height=1080, user_agent=None, waiting_time=5, private_scan=False)
: Initiates a scan for the given URL and returns a scan ID.search(query)
: Performs a search based on the given query and returns the results.get_scan(scan_id)
: Retrieves the results of the scan identified by the given scan ID.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any issues or questions, please contact [email protected].
Thank you for using urlDNA! We hope our tool helps you gain valuable insights into your URLs and online presence.