Pro
urlscan.Pro
¶
Bases: BaseClient
urlscan.io Pro API client.
Source code in src/urlscan/pro/__init__.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
brand
cached
property
¶
channel
cached
property
¶
Channel API client instance.
Returns:
| Name | Type | Description |
|---|---|---|
Channel |
Channel
|
Channel API client instance. |
datadump
cached
property
¶
Data dump API client instance.
Returns:
| Name | Type | Description |
|---|---|---|
DataDump |
DataDump
|
Data dump API client instance. |
incident
cached
property
¶
Incident API client instance.
Returns:
| Name | Type | Description |
|---|---|---|
Incident |
Incident
|
Incident API client instance. |
livescan
cached
property
¶
Live scan API client instance.
Returns:
| Name | Type | Description |
|---|---|---|
LiveScan |
LiveScan
|
Live scan API client instance. |
saved_search
cached
property
¶
Saved Search API client instance.
Returns:
| Name | Type | Description |
|---|---|---|
SavedSearch |
SavedSearch
|
Saved Search API client instance. |
subscription
cached
property
¶
Subscription API client instance.
Returns:
| Name | Type | Description |
|---|---|---|
Subscription |
Subscription
|
Subscription API client instance. |
download_file(file_hash, *, file, password=None, filename=None)
¶
Download a file by its hash.
Examples:
>>> from urlscan import Pro
>>> with Pro("<your_api_key>") as pro, open("downloaded_file.zip", "wb") as f:
... pro.download_file(
... file_hash="<file_hash>",
... file=f,
... )
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_hash
|
str
|
The hash of the file to download. |
required |
file
|
BinaryIO
|
File object to write to. |
required |
password
|
str | None
|
The password to use to encrypt the ZIP file. The default password is "urlscan!" if it's not provided. Defaults to None. |
None
|
filename
|
str | None
|
Specify the name of the ZIP file that should be downloaded. This does not change the name of files within the ZIP archive. The default filename is {file_hash}.zip if it's not provided. Defaults to None. |
None
|
Source code in src/urlscan/pro/__init__.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
get_user()
¶
Get information about the current user or API key making the request.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
User information. |
Source code in src/urlscan/pro/__init__.py
248 249 250 251 252 253 254 255 256 257 258 | |
hostname(hostname, *, size=1000, limit=None, page_state=None)
¶
Get the historical observations for a specific hostname.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hostname
|
str
|
The hostname to query. |
required |
page_state
|
str | None
|
Page state for pagination. Defaults to None. |
None
|
size
|
int
|
Number of results returned in a search. Defaults to 1000. |
1000
|
limit
|
int | None
|
Maximum number of results that will be returned by the iterator. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
HostnameIterator |
HostnameIterator
|
Hostname iterator. |
Source code in src/urlscan/pro/__init__.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
structure_search(scan_id, *, q=None, size=100, search_after=None, limit=None)
¶
Get results structurally similar to a specific scan.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scan_id
|
str
|
The original scan to compare to. |
required |
q
|
str | None
|
Additional query filter. |
None
|
size
|
int
|
Maximum results per call. Defaults to 100. |
100
|
search_after
|
str | None
|
Parameter to iterate over older results. Defaults to None. |
None
|
limit
|
int | None
|
Maximum number of results that will be returned by the iterator. Defaults to None. |
None
|
Source code in src/urlscan/pro/__init__.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
urlscan.pro.Brand
¶
Bases: BaseClient
Brand API client.
Source code in src/urlscan/pro/brand.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
get_available_brands()
¶
Get a list of brands that are tracked as part of urlscan's brand detection.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Response containing a list of brand objects. |
Source code in src/urlscan/pro/brand.py
9 10 11 12 13 14 15 16 17 18 19 | |
get_brands()
¶
Get a list of brands that we are able to detect phishing pages with the total number of detected pages and the latest hit for each brand.
This is slower than the get_available method.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Response containing a list of brand object with detection statistics. |
Source code in src/urlscan/pro/brand.py
21 22 23 24 25 26 27 28 29 30 31 32 33 | |
urlscan.pro.Channel
¶
Bases: BaseClient
Client API client.
Source code in src/urlscan/pro/channel.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
create(*, channel_type, name, webhook_url=None, frequency=None, email_addresses=None, utc_time=None, is_active=None, is_default=None, ignore_time=None, week_days=None, permissions=None, **kwargs)
¶
Create a new channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel_type
|
ChannelTypeType
|
Type of channel ("webhook" or "email"). |
required |
name
|
str
|
Name of the channel. |
required |
webhook_url
|
str | None
|
Webhook URL receiving notifications (required when channel_type is "webhook"). Defaults to None. |
None
|
frequency
|
FrequencyType | None
|
Frequency of notifications ("live", "hourly", or "daily"). Defaults to None. |
None
|
email_addresses
|
list[str] | None
|
Email addresses receiving the notifications (required when channel_type is "email"). Defaults to None. |
None
|
utc_time
|
str | None
|
24 hour UTC time that daily emails are sent (e.g. 09:00). Defaults to None. |
None
|
is_active
|
bool | None
|
Whether the channel is active. Defaults to None. |
None
|
is_default
|
bool | None
|
Whether the channel is the default. Defaults to None. |
None
|
ignore_time
|
bool | None
|
Whether to ignore time constraints. Defaults to None. |
None
|
week_days
|
list[WeekDaysType] | None
|
Days of the week alerts will be generated (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday). Defaults to None. |
None
|
permissions
|
list[ChannelPermissionType] | None
|
Permissions associated with this channel (team:read, team:write). Defaults to None. |
None
|
**kwargs
|
Any
|
Additional parameters to include in the request payload. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Object containing the created channel. |
Source code in src/urlscan/pro/channel.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
get(channel_id)
¶
Get the search results for a specific notification channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel_id
|
str
|
Channel ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Object containing the channel. |
Source code in src/urlscan/pro/channel.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
get_channels()
¶
Get a list of notification channels for the current user.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Object containing an array of channels. |
Source code in src/urlscan/pro/channel.py
18 19 20 21 22 23 24 25 26 27 28 | |
update(channel_id, *, channel_type, name, webhook_url=None, frequency=None, email_addresses=None, utc_time=None, is_active=None, is_default=None, ignore_time=None, week_days=None, permissions=None, **kwargs)
¶
Update an existing channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel_id
|
str
|
Channel ID. |
required |
channel_type
|
ChannelTypeType
|
Type of channel ("webhook" or "email"). |
required |
name
|
str
|
Name of the channel. |
required |
webhook_url
|
str | None
|
Webhook URL receiving notifications (required when channel_type is "webhook"). Defaults to None. |
None
|
frequency
|
FrequencyType | None
|
Frequency of notifications ("live", "hourly", or "daily"). Defaults to None. |
None
|
email_addresses
|
list[str] | None
|
Email addresses receiving the notifications (required when channel_type is "email"). Defaults to None. |
None
|
utc_time
|
str | None
|
24 hour UTC time that daily emails are sent (e.g. 09:00). Defaults to None. |
None
|
is_active
|
bool | None
|
Whether the channel is active. Defaults to None. |
None
|
is_default
|
bool | None
|
Whether the channel is the default. Defaults to None. |
None
|
ignore_time
|
bool | None
|
Whether to ignore time constraints. Defaults to None. |
None
|
week_days
|
list[WeekDaysType] | None
|
Days of the week alerts will be generated (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday). Defaults to None. |
None
|
permissions
|
list[ChannelPermissionType] | None
|
Permissions associated with this channel (team:read, team:write). Defaults to None. |
None
|
**kwargs
|
Any
|
Additional parameters to include in the request payload. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Object containing the updated channel. |
Source code in src/urlscan/pro/channel.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
urlscan.pro.DataDump
¶
Bases: BaseClient
Data dump API client.
Source code in src/urlscan/pro/datadump.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
download_file(path, file)
¶
Download the datadump file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to API endpoint. |
required |
file
|
BinaryIO
|
File object to write to. |
required |
Source code in src/urlscan/pro/datadump.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
get_list(path)
¶
List available data dump files for a specific time window, file type, and date.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The data dump path. Format is /{time_window}/{file_type}/{date}/. - time_window: days, hours, minutes. - file_type: api, search, screenshots, dom. - date: date of the data dump in YYYYMMDD format. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The list of data dump files. |
Examples:
>>> from urlscan import Pro
>>> with Pro("<your_api_key>") as client:
... result = client.datadump.get_list("days/api/20260101")
Source code in src/urlscan/pro/datadump.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
Note: you can use extract function in the utils module to extract a downloaded data dump file.
import os
from urlscan import Pro
from urlscan.utils import extract
with Pro("<your_api_key>") as pro:
# get a list of hourly API data dump files
res = pro.datadump.get_list("hours/api/20260101/")
# download & extract them one by one
for f in res["files"]
path: str = f["path"]
basename = os.path.basename(path)
with open(basename, "wb") as file:
pro.datadump.download_file(path, file=file)
extract(basename, "/tmp")
urlscan.pro.HostnameIterator
¶
Bases: BaseIterator
Hostname iterator.
Examples:
>>> from urlscan import Pro
>>> with Pro("<your_api_key>") as client:
>>> for result in client.hostname("example.com"):
>>> print(result["sub_id"], result["data"])
Source code in src/urlscan/pro/hostname.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
__init__(client, *, hostname, page_state=None, size=1000, limit=None)
¶
Initialize the hostname iterator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
Client
|
Client. |
required |
hostname
|
str
|
Hostname to query. |
required |
page_state
|
str | None
|
Page state for pagination. Defaults to None. |
None
|
size
|
int
|
Number of results returned in a search. Defaults to 1000. |
1000
|
limit
|
int | None
|
Maximum number of results that will be returned by the iterator. Defaults to None. |
None
|
Source code in src/urlscan/pro/hostname.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
__next__()
¶
Return the next hostname observation result.
Source code in src/urlscan/pro/hostname.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
urlscan.pro.Incident
¶
Bases: BaseClient
Incident API client.
Source code in src/urlscan/pro/incident.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
close(*, incident_id)
¶
Close (stop) the incident.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
incident_id
|
str
|
ID of incident. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Response confirming closure. |
Source code in src/urlscan/pro/incident.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |
copy(incident_id)
¶
Copy an incident without its history.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
incident_id
|
str
|
ID of incident. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Incident body. |
Source code in src/urlscan/pro/incident.py
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
create(*, observable, visibility, channels, scan_interval=None, scan_interval_mode=None, watched_attributes=None, user_agents=None, user_agents_per_interval=None, countries=None, countries_per_interval=None, stop_delay_suspended=None, stop_delay_inactive=None, stop_delay_malicious=None, scan_interval_after_suspended=None, scan_interval_after_malicious=None, incident_profile=None, expire_after=None, **kwargs)
¶
Create an incident with specific options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
observable
|
str
|
Hostname, domain, IP, or URL to observe. |
required |
visibility
|
IncidentVisibilityType
|
Scan visibility ("unlisted" or "private"). |
required |
channels
|
list[str]
|
Channels subscribed to this incident. |
required |
scan_interval
|
int | None
|
Interval (seconds) between triggering full website scans. Defaults to None. |
None
|
scan_interval_mode
|
ScanIntervalModeType | None
|
If this is set to manual then scan_interval_after_suspended and scan_interval_after_malicious will not have an effect ("manual" or "automatic"). Defaults to None. |
None
|
watched_attributes
|
list[WatchedAttributeType] | None
|
Determine which items will be monitored for (detections, tls, dns, labels, page, meta, ip). Defaults to None. |
None
|
user_agents
|
list[str] | None
|
Browser User-Agents to use during scanning. Defaults to None. |
None
|
user_agents_per_interval
|
int | None
|
How many userAgents to use per scanInterval. Defaults to None. |
None
|
countries
|
list[str] | None
|
List of countries to scan from as ISO-3166-1 country codes. Defaults to None. |
None
|
countries_per_interval
|
int | None
|
How many countries to use per scan interval. Defaults to None. |
None
|
stop_delay_suspended
|
int | None
|
When to automatically close the incident after the observable was suspended. Defaults to None. |
None
|
stop_delay_inactive
|
int | None
|
When to automatically close the incident after the observable became inactive. Defaults to None. |
None
|
stop_delay_malicious
|
int | None
|
When to automatically close the incident after the observable became malicious. Defaults to None. |
None
|
scan_interval_after_suspended
|
int | None
|
How to change the scan interval after the observable was suspended. Defaults to None. |
None
|
scan_interval_after_malicious
|
int | None
|
How to change the scan interval after the observable became malicious. Defaults to None. |
None
|
incident_profile
|
str | None
|
ID of the incident profile to use when creating this incident. Defaults to None. |
None
|
expire_after
|
int | None
|
Seconds until the incident will automatically be closed. Defaults to None. |
None
|
**kwargs
|
Any
|
Additional parameters to include in the request payload. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Incident body. |
Source code in src/urlscan/pro/incident.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
fork(incident_id)
¶
Copy an incident along with its history (incident states).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
incident_id
|
str
|
ID of incident. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Incident body. |
Source code in src/urlscan/pro/incident.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
get(incident_id)
¶
Get details for a specific incident.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
incident_id
|
str
|
ID of incident. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Incident body. |
Source code in src/urlscan/pro/incident.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
get_states(incident_id)
¶
Retrieve individual incident states of an incident.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
incident_id
|
str
|
ID of incident. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Incident states. |
Source code in src/urlscan/pro/incident.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
get_watchable_attributes()
¶
Get the list of attributes which can be supplied to the watchedAttributes property of the incident.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
List of watchable attributes. |
Source code in src/urlscan/pro/incident.py
260 261 262 263 264 265 266 267 268 269 270 | |
restart(incident_id)
¶
Restart a closed incident.
Automatically extends the incident expireAt. Starts with new incident states.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
incident_id
|
str
|
ID of incident. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Response confirming restart. |
Source code in src/urlscan/pro/incident.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | |
update(incident_id, *, observable, visibility, channels, scan_interval=None, scan_interval_mode=None, watched_attributes=None, user_agents=None, user_agents_per_interval=None, countries=None, countries_per_interval=None, stop_delay_suspended=None, stop_delay_inactive=None, stop_delay_malicious=None, scan_interval_after_suspended=None, scan_interval_after_malicious=None, incident_profile=None, expire_after=None, **kwargs)
¶
Update specific runtime options of the incident.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
incident_id
|
str
|
ID of incident. |
required |
observable
|
str
|
Hostname, domain, IP, or URL to observe. |
required |
visibility
|
IncidentVisibilityType
|
Scan visibility ("unlisted" or "private"). |
required |
channels
|
list[str]
|
Channels subscribed to this incident. |
required |
scan_interval
|
int | None
|
Interval (seconds) between triggering full website scans. Defaults to None. |
None
|
scan_interval_mode
|
ScanIntervalModeType | None
|
If this is set to manual then scan_interval_after_suspended and scan_interval_after_malicious will not have an effect ("manual" or "automatic"). Defaults to None. |
None
|
watched_attributes
|
list[WatchedAttributeType] | None
|
Determine which items will be monitored for (detections, tls, dns, labels, page, meta, ip). Defaults to None. |
None
|
user_agents
|
list[str] | None
|
Browser User-Agents to use during scanning. Defaults to None. |
None
|
user_agents_per_interval
|
int | None
|
How many userAgents to use per scanInterval. Defaults to None. |
None
|
countries
|
list[str] | None
|
List of countries to scan from as ISO-3166-1 country codes. Defaults to None. |
None
|
countries_per_interval
|
int | None
|
How many countries to use per scan interval. Defaults to None. |
None
|
stop_delay_suspended
|
int | None
|
When to automatically close the incident after the observable was suspended. Defaults to None. |
None
|
stop_delay_inactive
|
int | None
|
When to automatically close the incident after the observable became inactive. Defaults to None. |
None
|
stop_delay_malicious
|
int | None
|
When to automatically close the incident after the observable became malicious. Defaults to None. |
None
|
scan_interval_after_suspended
|
int | None
|
How to change the scan interval after the observable was suspended. Defaults to None. |
None
|
scan_interval_after_malicious
|
int | None
|
How to change the scan interval after the observable became malicious. Defaults to None. |
None
|
incident_profile
|
str | None
|
ID of the incident profile to use when creating this incident. Defaults to None. |
None
|
expire_after
|
int | None
|
Seconds until the incident will automatically be closed. Defaults to None. |
None
|
**kwargs
|
Any
|
Additional parameters to include in the request payload. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Incident body. |
Source code in src/urlscan/pro/incident.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
urlscan.pro.LiveScan
¶
Bases: BaseClient
Live scanning API client.
Source code in src/urlscan/pro/livescan.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
get_resource(*, scanner_id, resource_type, resource_id)
¶
Retrieve the resource for a particular scan ID or SHA256 from this live scanner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scanner_id
|
str
|
Scanner ID (e.g., "de01" for Germany). |
required |
resource_type
|
LiveScanResourceType
|
Type of resource ("result", "screenshot", "dom", "response", or "download"). |
required |
resource_id
|
str
|
Resource ID. For result/screenshot/dom: UUID of the scan. For response/download: SHA256 of the resource. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
Resource content. Returns dict for "result", str for "dom", bytes for binary resources. |
Source code in src/urlscan/pro/livescan.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | |
get_scanners()
¶
Get a list of available Live Scanning nodes along with their current metadata.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
List of available scanners with metadata. |
Source code in src/urlscan/pro/livescan.py
13 14 15 16 17 18 19 20 21 22 23 | |
purge(*, scanner_id, scan_id)
¶
Purge temporary scan from scanner immediately. Scans will be automatically purged after 60 minutes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scanner_id
|
str
|
Scanner ID (e.g., "de01" for Germany). |
required |
scan_id
|
str
|
Scan UUID. |
required |
Source code in src/urlscan/pro/livescan.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
scan(url, *, scanner_id, visibility=None, page_timeout=None, capture_delay=None, extra_headers=None, enable_features=None, disable_features=None, **kwargs)
¶
Task a URL to be scanned. The HTTP request will block until the scan has finished.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
URL to scan. |
required |
scanner_id
|
str
|
Scanner ID (e.g., "de01" for Germany). |
required |
visibility
|
VisibilityType | None
|
Visibility of the scan. Defaults to None. |
None
|
page_timeout
|
int | None
|
Time to wait for the whole scan process (in ms). Defaults to None. |
None
|
capture_delay
|
int | None
|
Delay after page load before capturing (in ms). Defaults to None. |
None
|
extra_headers
|
dict[str, str] | None
|
Extra HTTP headers. Defaults to None. |
None
|
enable_features
|
list[str] | None
|
Features to enable. Defaults to None. |
None
|
disable_features
|
list[str] | None
|
Features to disable. Defaults to None. |
None
|
**kwargs
|
Any
|
Additional parameters to include in the request payload. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Response containing the scan UUID. |
Source code in src/urlscan/pro/livescan.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
store(*, scanner_id, scan_id, visibility)
¶
Store the temporary scan as a permanent snapshot on urlscan.io.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scanner_id
|
str
|
Scanner ID (e.g., "de01" for Germany). |
required |
scan_id
|
str
|
Scan UUID. |
required |
visibility
|
VisibilityType
|
Visibility for the stored scan ("public", "private", or "unlisted"). |
required |
Source code in src/urlscan/pro/livescan.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | |
task(url, *, scanner_id, visibility=None, page_timeout=None, capture_delay=None, extra_headers=None, enable_features=None, disable_features=None, **kwargs)
¶
Task a URL to be scanned.
The HTTP request will return with the scan UUID immediately and then it is your responsibility to poll the result resource type until the scan has finished.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
URL to scan. |
required |
scanner_id
|
str
|
Scanner ID (e.g., "de01" for Germany). |
required |
visibility
|
VisibilityType | None
|
Visibility of the scan. Defaults to None. |
None
|
page_timeout
|
int | None
|
Time to wait for the whole scan process (in ms). Defaults to None. |
None
|
capture_delay
|
int | None
|
Delay after page load before capturing (in ms). Defaults to None. |
None
|
extra_headers
|
dict[str, str] | None
|
Extra HTTP headers. Defaults to None. |
None
|
enable_features
|
list[str] | None
|
Features to enable. Defaults to None. |
None
|
disable_features
|
list[str] | None
|
Features to disable. Defaults to None. |
None
|
**kwargs
|
Any
|
Additional parameters to include in the request payload. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Response containing the scan UUID. |
Source code in src/urlscan/pro/livescan.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
urlscan.pro.SavedSearch
¶
Bases: BaseClient
Saved Search API client.
Source code in src/urlscan/pro/saved_search.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
create(*, datasource, query, name, description=None, long_description=None, tlp=None, user_tags=None, permissions=None, **kwargs)
¶
Create a Saved Search.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
datasource
|
SavedSearchDataSource
|
Which data this Saved Search operates on ("hostnames" or "scans"). |
required |
query
|
str
|
Search API query string. |
required |
name
|
str
|
User-facing short name for the saved search. |
required |
description
|
str | None
|
Short description. Defaults to None. |
None
|
long_description
|
str | None
|
Long description. Defaults to None. |
None
|
tlp
|
TLPType | None
|
TLP (Traffic Light Protocol) indicator for other users on the urlscan Pro platform. Valid values: "red", "amber+strict", "amber", "green", "clear". Defaults to None. |
None
|
user_tags
|
list[str] | None
|
User-supplied tags to be applied to
matching items. Apply the following prefixes to tags to define their
visibility scope: |
None
|
permissions
|
list[PermissionType] | None
|
Determine whether only other users on the same team or everyone on urlscan Pro can see the search. Valid values: "public:read", "team:read", "team:write". Defaults to None. |
None
|
**kwargs
|
Any
|
Additional parameters to include in the request payload. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Created Saved Search object containing the search properties and unique _id. |
Source code in src/urlscan/pro/saved_search.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
get_list()
¶
Get a list of Saved Searches for the current user.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Response containing an array of Saved Search objects with their properties. |
Source code in src/urlscan/pro/saved_search.py
13 14 15 16 17 18 19 20 21 22 23 | |
get_results(search_id)
¶
Get the search results for a specific Saved Search.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
search_id
|
str
|
Unique ID of the saved search. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Search results matching the saved query. The structure depends on the datasource (hostnames or scans) specified in the saved search. |
Source code in src/urlscan/pro/saved_search.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
remove(search_id)
¶
Delete a Saved Search.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
search_id
|
str
|
Unique ID of the saved search to delete. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Empty JSON object on success. |
Source code in src/urlscan/pro/saved_search.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
update(search_id, *, datasource, query, name, description=None, long_description=None, tlp=None, user_tags=None, permissions=None, **kwargs)
¶
Update a Saved Search.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
search_id
|
str
|
Unique ID of the saved search to update. |
required |
datasource
|
SavedSearchDataSource
|
Which data this Saved Search operates on ("hostnames" or "scans"). |
required |
query
|
str
|
Search API query string. |
required |
name
|
str
|
User-facing short name for the saved search. |
required |
description
|
str | None
|
Short description. Defaults to None. |
None
|
long_description
|
str | None
|
Long description. Defaults to None. |
None
|
tlp
|
TLPType | None
|
TLP (Traffic Light Protocol) indicator for other users on the urlscan Pro platform. Valid values: "red", "amber+strict", "amber", "green", "clear". Defaults to None. |
None
|
user_tags
|
list[str] | None
|
User-supplied tags to be applied to
matching items. Apply the following prefixes to tags to define their
visibility scope: |
None
|
permissions
|
list[PermissionType] | None
|
Determine whether only other users on the same team or everyone on urlscan Pro can see the search. Valid values: "public:read", "team:read", "team:write". Defaults to None. |
None
|
**kwargs
|
Any
|
Additional parameters to include in the request payload. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Updated Saved Search object containing the search properties and unique _id. |
Source code in src/urlscan/pro/saved_search.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
urlscan.pro.Subscription
¶
Bases: BaseClient
Subscription API client.
Source code in src/urlscan/pro/subscription.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
create(*, search_ids, frequency, email_addresses, name, is_active, ignore_time, description=None, week_days=None, permissions=None, channel_ids=None, incident_channel_ids=None, incident_profile_id=None, incident_visibility=None, incident_creation_mode=None, incident_watch_keys=None, **kwargs)
¶
Create a new subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
search_ids
|
list[str]
|
Array of search IDs associated with this subscription. |
required |
frequency
|
FrequencyType
|
Frequency of notifications ("live", "hourly", or "daily"). |
required |
email_addresses
|
list[str]
|
Email addresses receiving the notifications. |
required |
name
|
str
|
Name of the subscription. |
required |
is_active
|
bool
|
Whether the subscription is active. |
required |
ignore_time
|
bool
|
Whether to ignore time constraints. |
required |
description
|
str | None
|
Description of the subscription. Defaults to None. |
None
|
week_days
|
list[WeekDaysType] | None
|
Days of the week alerts will be generated (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday). Defaults to None. |
None
|
permissions
|
list[SubscriptionPermissionType] | None
|
Permissions associated with this subscription (team:read, team:write). Defaults to None. |
None
|
channel_ids
|
list[str] | None
|
Array of channel IDs associated with this subscription. Defaults to None. |
None
|
incident_channel_ids
|
list[str] | None
|
Array of incident channel IDs associated with this subscription. Defaults to None. |
None
|
incident_profile_id
|
str | None
|
Incident Profile ID associated with this subscription. Defaults to None. |
None
|
incident_visibility
|
IncidentVisibilityType | None
|
Incident visibility for this subscription ("unlisted" or "private"). Defaults to None. |
None
|
incident_creation_mode
|
IncidentCreationModeType | None
|
Incident creation rule for this subscription ("none", "default", "always", or "ignore-if-exists"). Defaults to None. |
None
|
incident_watch_keys
|
IncidentWatchKeyType | None
|
Source/key to watch in the incident (scans/page.url, scans/page.domain, scans/page.ip, scans/page.apexDomain, hostnames/hostname, hostnames/ip, hostnames/domain). Defaults to None. |
None
|
**kwargs
|
Any
|
Additional parameters to include in the request payload. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Response containing the created subscription with an '_id' field. |
Source code in src/urlscan/pro/subscription.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | |
delete_subscription(*, subscription_id)
¶
Delete a subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
str
|
Subscription ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Empty response object confirming deletion. |
Source code in src/urlscan/pro/subscription.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
get_results(*, subscription_id, datasource)
¶
Get the search results for a specific subscription and datasource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
str
|
Subscription ID. |
required |
datasource
|
str
|
Datasource (e.g., "scans"). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Search results. |
Source code in src/urlscan/pro/subscription.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
get_subscriptions()
¶
Get a list of Subscriptions for the current user.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
List of subscriptions. |
Source code in src/urlscan/pro/subscription.py
20 21 22 23 24 25 26 27 28 29 30 | |
update(*, subscription_id, search_ids, frequency, email_addresses, name, is_active, ignore_time, description=None, week_days=None, permissions=None, channel_ids=None, incident_channel_ids=None, incident_profile_id=None, incident_visibility=None, incident_creation_mode=None, incident_watch_keys=None, **kwargs)
¶
Update the settings for a subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
str
|
Subscription ID. |
required |
search_ids
|
list[str]
|
Array of search IDs associated with this subscription. |
required |
frequency
|
FrequencyType
|
Frequency of notifications ("live", "hourly", or "daily"). |
required |
email_addresses
|
list[str]
|
Email addresses receiving the notifications. |
required |
name
|
str
|
Name of the subscription. |
required |
is_active
|
bool
|
Whether the subscription is active. |
required |
ignore_time
|
bool
|
Whether to ignore time constraints. |
required |
description
|
str | None
|
Description of the subscription. Defaults to None. |
None
|
week_days
|
list[WeekDaysType] | None
|
Days of the week alerts will be generated (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday). Defaults to None. |
None
|
permissions
|
list[SubscriptionPermissionType] | None
|
Permissions associated with this subscription (team:read, team:write). Defaults to None. |
None
|
channel_ids
|
list[str] | None
|
Array of channel IDs associated with this subscription. Defaults to None. |
None
|
incident_channel_ids
|
list[str] | None
|
Array of incident channel IDs associated with this subscription. Defaults to None. |
None
|
incident_profile_id
|
str | None
|
Incident Profile ID associated with this subscription. Defaults to None. |
None
|
incident_visibility
|
IncidentVisibilityType | None
|
Incident visibility for this subscription ("unlisted" or "private"). Defaults to None. |
None
|
incident_creation_mode
|
IncidentCreationModeType | None
|
Incident creation rule for this subscription ("none", "default", "always", or "ignore-if-exists"). Defaults to None. |
None
|
incident_watch_keys
|
IncidentWatchKeyType | None
|
Source/key to watch in the incident (scans/page.url, scans/page.domain, scans/page.ip, scans/page.apexDomain, hostnames/hostname, hostnames/ip, hostnames/domain). Defaults to None. |
None
|
**kwargs
|
Any
|
Additional parameters to include in the request payload. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Response containing the updated subscription with an '_id' field. |
Source code in src/urlscan/pro/subscription.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |