Clients¶
The two entry points to the v4 API. Both take the same arguments and expose the same resource
namespaces (search, documents, audit, archive, misc, report, stix,
subscriptions, subscriptions_email, webhooks, vscanner); the only difference is that
AsyncVulners methods are coroutines.
Vulners¶
vulners.Vulners
¶
Vulners(api_key: str | SecretStr | None = None, *, base_url: str | URL | None = None, timeout: float | Timeout | None = None, max_retries: int | None = None, max_response_bytes: int | None = None, http2: bool = True, proxy: str | Proxy | None = None, verify: bool | str | SSLContext = True, trust_env: bool = True, before_request: Hook | Sequence[Hook] | None = None, after_response: Hook | Sequence[Hook] | None = None, on_error: Hook | Sequence[Hook] | None = None, http_client: Client | None = None)
Synchronous Vulners API client.
Create a synchronous Vulners API client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api_key
|
str | SecretStr | None
|
Your Vulners API key, as a |
None
|
base_url
|
str | URL | None
|
Override the API base URL. If omitted, falls back to the
|
None
|
timeout
|
float | Timeout | None
|
Default per-request timeout. A float is seconds applied to
every phase; pass an |
None
|
max_retries
|
int | None
|
How many times to retry a failed request — connection
errors, timeouts, and retryable statuses (408/429, and 5xx on
idempotent calls) — with exponential backoff and |
None
|
max_response_bytes
|
int | None
|
Optional cap on the decoded/decompressed response
size, in bytes. |
None
|
http2
|
bool
|
Negotiate HTTP/2 on the SDK-owned transport (default |
True
|
proxy
|
str | Proxy | None
|
Route all SDK traffic through this proxy (URL string or
|
None
|
verify
|
bool | str | SSLContext
|
TLS verification for the SDK-owned transport: |
True
|
trust_env
|
bool
|
Whether the SDK-owned client trusts environment settings —
TLS ( |
True
|
before_request
|
Hook | Sequence[Hook] | None
|
Callable (or sequence of callables) invoked with the
|
None
|
after_response
|
Hook | Sequence[Hook] | None
|
Callable (or sequence of callables) invoked with the
|
None
|
on_error
|
Hook | Sequence[Hook] | None
|
Callable (or sequence of callables) invoked with the final error when a request fails for good (after retries). Exceptions raised by a hook propagate to the caller. |
None
|
http_client
|
Client | None
|
Bring your own |
None
|
Source code in src/vulners/_client.py
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 | |
audit
cached
property
¶
audit: Audit
Audit software inventories and identifiers against Vulners intelligence.
subscriptions
cached
property
¶
subscriptions: SubscriptionsV4
The v4 subscriptions CRUD (list/get/create/update/delete).
subscriptions_v4
property
¶
subscriptions_v4: SubscriptionsV4
Deprecated alias of :attr:subscriptions, kept for the pre-release window.
subscriptions_email
cached
property
¶
subscriptions_email: Subscriptions
The legacy v3 email subscriptions (moved here from subscriptions).
vscanner
cached
property
¶
vscanner: Vscanner
The VScanner product namespace (tasks, results and licenses).
get
¶
get(path: str, *, params: Mapping[str, Any] | None = None, timeout: float | Timeout | NotGiven | None = not_given) -> Any
GET an arbitrary API path and return the parsed response body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
API path to request, relative to the client's base URL. |
required |
params
|
Mapping[str, Any] | None
|
Query-string parameters to send with the request. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The parsed response body. |
Source code in src/vulners/_client.py
post
¶
post(path: str, *, json: Any = None, params: Mapping[str, Any] | None = None, timeout: float | Timeout | NotGiven | None = not_given) -> Any
POST json to an arbitrary API path and return the parsed response body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
API path to request, relative to the client's base URL. |
required |
json
|
Any
|
Request body, serialized as JSON. |
None
|
params
|
Mapping[str, Any] | None
|
Additional query-string parameters to send with the request. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The parsed response body. |
Source code in src/vulners/_client.py
put
¶
put(path: str, *, json: Any = None, params: Mapping[str, Any] | None = None, timeout: float | Timeout | NotGiven | None = not_given) -> Any
PUT json to an arbitrary API path and return the parsed response body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
API path to request, relative to the client's base URL. |
required |
json
|
Any
|
Request body, serialized as JSON. |
None
|
params
|
Mapping[str, Any] | None
|
Additional query-string parameters to send with the request. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The parsed response body. |
Source code in src/vulners/_client.py
delete
¶
delete(path: str, *, params: Mapping[str, Any] | None = None, timeout: float | Timeout | NotGiven | None = not_given) -> Any
DELETE an arbitrary API path and return the parsed response body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
API path to request, relative to the client's base URL. |
required |
params
|
Mapping[str, Any] | None
|
Query-string parameters to send with the request. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The parsed response body. |
Source code in src/vulners/_client.py
with_options
¶
with_options(*, timeout: float | Timeout | NotGiven | None = not_given, max_retries: int | NotGiven = not_given, max_response_bytes: int | NotGiven | None = not_given) -> Vulners
Return a copy of this client that shares the same connection pool, with overrides.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
float | Timeout | NotGiven | None
|
Override the default per-request timeout (float seconds or an
|
not_given
|
max_retries
|
int | NotGiven
|
Override how many times a failed request is retried. |
not_given
|
max_response_bytes
|
int | NotGiven | None
|
Override the cap on decoded response size, in bytes. |
not_given
|
Returns:
| Type | Description |
|---|---|
Vulners
|
A new :class: |
Vulners
|
rate-limit pacing; closing any client that shares the pool closes it |
Vulners
|
for all. |
Source code in src/vulners/_client.py
close
¶
Close the underlying connection pool.
A no-op for an http_client you passed in; prefer the with context
manager. A with_options() clone shares one httpx client with its owner
(and any sibling clones), so closing any of them closes that shared pool for
all — use separate clients if you need independent lifetimes.
Source code in src/vulners/_client.py
AsyncVulners¶
vulners.AsyncVulners
¶
AsyncVulners(api_key: str | SecretStr | None = None, *, base_url: str | URL | None = None, timeout: float | Timeout | None = None, max_retries: int | None = None, max_response_bytes: int | None = None, http2: bool = True, proxy: str | Proxy | None = None, verify: bool | str | SSLContext = True, trust_env: bool = True, before_request: Hook | Sequence[Hook] | None = None, after_response: Hook | Sequence[Hook] | None = None, on_error: Hook | Sequence[Hook] | None = None, http_client: AsyncClient | None = None)
Asynchronous Vulners API client.
Create an asynchronous Vulners API client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api_key
|
str | SecretStr | None
|
Your Vulners API key, as a |
None
|
base_url
|
str | URL | None
|
Override the API base URL. If omitted, falls back to the
|
None
|
timeout
|
float | Timeout | None
|
Default per-request timeout. A float is seconds applied to
every phase; pass an |
None
|
max_retries
|
int | None
|
How many times to retry a failed request — connection
errors, timeouts, and retryable statuses (408/429, and 5xx on
idempotent calls) — with exponential backoff and |
None
|
max_response_bytes
|
int | None
|
Optional cap on the decoded/decompressed response
size, in bytes. |
None
|
http2
|
bool
|
Negotiate HTTP/2 on the SDK-owned transport (default |
True
|
proxy
|
str | Proxy | None
|
Route all SDK traffic through this proxy (URL string or
|
None
|
verify
|
bool | str | SSLContext
|
TLS verification for the SDK-owned transport: |
True
|
trust_env
|
bool
|
Whether the SDK-owned client trusts environment settings —
TLS ( |
True
|
before_request
|
Hook | Sequence[Hook] | None
|
Callable (or sequence of callables) invoked with the
|
None
|
after_response
|
Hook | Sequence[Hook] | None
|
Callable (or sequence of callables) invoked with the
|
None
|
on_error
|
Hook | Sequence[Hook] | None
|
Callable (or sequence of callables) invoked with the final error when a request fails for good (after retries). Sync or async callables; exceptions raised by a hook propagate. |
None
|
http_client
|
AsyncClient | None
|
Bring your own |
None
|
Source code in src/vulners/_client.py
494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 | |
audit
cached
property
¶
Audit software inventories and identifiers against Vulners intelligence.
subscriptions
cached
property
¶
The v4 subscriptions CRUD (list/get/create/update/delete).
subscriptions_v4
property
¶
Deprecated alias of :attr:subscriptions, kept for the pre-release window.
subscriptions_email
cached
property
¶
The legacy v3 email subscriptions (moved here from subscriptions).
vscanner
cached
property
¶
The VScanner product namespace (tasks, results and licenses).
get
async
¶
get(path: str, *, params: Mapping[str, Any] | None = None, timeout: float | Timeout | NotGiven | None = not_given) -> Any
GET an arbitrary API path and return the parsed response body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
API path to request, relative to the client's base URL. |
required |
params
|
Mapping[str, Any] | None
|
Query-string parameters to send with the request. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The parsed response body. |
Source code in src/vulners/_client.py
post
async
¶
post(path: str, *, json: Any = None, params: Mapping[str, Any] | None = None, timeout: float | Timeout | NotGiven | None = not_given) -> Any
POST json to an arbitrary API path and return the parsed response body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
API path to request, relative to the client's base URL. |
required |
json
|
Any
|
Request body, serialized as JSON. |
None
|
params
|
Mapping[str, Any] | None
|
Additional query-string parameters to send with the request. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The parsed response body. |
Source code in src/vulners/_client.py
put
async
¶
put(path: str, *, json: Any = None, params: Mapping[str, Any] | None = None, timeout: float | Timeout | NotGiven | None = not_given) -> Any
PUT json to an arbitrary API path and return the parsed response body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
API path to request, relative to the client's base URL. |
required |
json
|
Any
|
Request body, serialized as JSON. |
None
|
params
|
Mapping[str, Any] | None
|
Additional query-string parameters to send with the request. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The parsed response body. |
Source code in src/vulners/_client.py
delete
async
¶
delete(path: str, *, params: Mapping[str, Any] | None = None, timeout: float | Timeout | NotGiven | None = not_given) -> Any
DELETE an arbitrary API path and return the parsed response body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
API path to request, relative to the client's base URL. |
required |
params
|
Mapping[str, Any] | None
|
Query-string parameters to send with the request. |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
The parsed response body. |
Source code in src/vulners/_client.py
with_options
¶
with_options(*, timeout: float | Timeout | NotGiven | None = not_given, max_retries: int | NotGiven = not_given, max_response_bytes: int | NotGiven | None = not_given) -> AsyncVulners
Return a copy of this client that shares the same connection pool, with overrides.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
float | Timeout | NotGiven | None
|
Override the default per-request timeout (float seconds or an
|
not_given
|
max_retries
|
int | NotGiven
|
Override how many times a failed request is retried. |
not_given
|
max_response_bytes
|
int | NotGiven | None
|
Override the cap on decoded response size, in bytes. |
not_given
|
Returns:
| Type | Description |
|---|---|
AsyncVulners
|
A new :class: |
AsyncVulners
|
rate-limit pacing; closing any client that shares the pool closes it |
AsyncVulners
|
for all. |
Source code in src/vulners/_client.py
aclose
async
¶
Close the underlying connection pool.
A no-op for an http_client you passed in; prefer the async with
context manager. A with_options() clone shares one httpx client with its
owner (and any sibling clones), so closing any of them closes that shared
pool for all — use separate clients if you need independent lifetimes.