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
|
Per-request timeout, in seconds or as an |
None
|
max_retries
|
int | None
|
How many times to retry a failed request (connection
errors and retryable status codes, honouring |
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 | |
subscriptions
cached
property
¶
subscriptions: SubscriptionsV4
The v4 subscriptions CRUD (list/get/create/update/delete).
subscriptions_email
cached
property
¶
subscriptions_email: Subscriptions
The legacy v3 email subscriptions (moved here from subscriptions).
get
¶
get(path: str, *, params: Mapping[str, Any] | None = None, timeout: float | Timeout | None | NotGiven = not_given) -> Any
GET an arbitrary API path; params become the query string.
Source code in src/vulners/_client.py
post
¶
post(path: str, *, json: Any = None, params: Mapping[str, Any] | None = None, timeout: float | Timeout | None | NotGiven = not_given) -> Any
POST json to an arbitrary API path; params add query args.
Source code in src/vulners/_client.py
put
¶
put(path: str, *, json: Any = None, params: Mapping[str, Any] | None = None, timeout: float | Timeout | None | NotGiven = not_given) -> Any
PUT json to an arbitrary API path; params add query args.
Source code in src/vulners/_client.py
delete
¶
delete(path: str, *, params: Mapping[str, Any] | None = None, timeout: float | Timeout | None | NotGiven = not_given) -> Any
DELETE an arbitrary API path; params become the query string.
Source code in src/vulners/_client.py
with_options
¶
with_options(*, timeout: float | Timeout | None | NotGiven = not_given, max_retries: int | NotGiven = not_given, max_response_bytes: int | None | NotGiven = not_given) -> Vulners
A copy of this client sharing the same connection pool, with overrides.
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
|
Per-request timeout, in seconds or as an |
None
|
max_retries
|
int | None
|
How many times to retry a failed request (connection
errors and retryable status codes, honouring |
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
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 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 | |
subscriptions
cached
property
¶
The v4 subscriptions CRUD (list/get/create/update/delete).
subscriptions_email
cached
property
¶
The legacy v3 email subscriptions (moved here from subscriptions).
get
async
¶
get(path: str, *, params: Mapping[str, Any] | None = None, timeout: float | Timeout | None | NotGiven = not_given) -> Any
GET an arbitrary API path; params become the query string.
Source code in src/vulners/_client.py
post
async
¶
post(path: str, *, json: Any = None, params: Mapping[str, Any] | None = None, timeout: float | Timeout | None | NotGiven = not_given) -> Any
POST json to an arbitrary API path; params add query args.
Source code in src/vulners/_client.py
put
async
¶
put(path: str, *, json: Any = None, params: Mapping[str, Any] | None = None, timeout: float | Timeout | None | NotGiven = not_given) -> Any
PUT json to an arbitrary API path; params add query args.
Source code in src/vulners/_client.py
delete
async
¶
delete(path: str, *, params: Mapping[str, Any] | None = None, timeout: float | Timeout | None | NotGiven = not_given) -> Any
DELETE an arbitrary API path; params become the query string.
Source code in src/vulners/_client.py
with_options
¶
with_options(*, timeout: float | Timeout | None | NotGiven = not_given, max_retries: int | NotGiven = not_given, max_response_bytes: int | None | NotGiven = not_given) -> AsyncVulners
A copy of this client sharing the same connection pool, with overrides.
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.