Skip to main content
Search for offers based on various criteria.

Signature

VastAI.search_offers(
    type: Optional[str] = None,
    no_default: bool = False,
    new: bool = False,
    limit: Optional[int] = None,
    disable_bundling: bool = False,
    storage: Optional[float] = None,
    order: Optional[str] = None,
    query: Optional[str] = None
) -> str

Parameters

type
Optional[str]
Instance type filter: ‘bid’ for interruptible, ‘reserved’ for reserved, ‘on-demand’ for on-demand.
no_default
bool
default:"False"
Disable the default query filters (external=false rentable=true verified=true).
new
bool
default:"False"
Use the new search algorithm (experimental).
limit
Optional[int]
Maximum number of results to return.
disable_bundling
bool
default:"False"
Disable offer bundling (show individual machine slots).
storage
Optional[float]
Amount of storage in GiB to include in pricing calculations.
order
Optional[str]
Comma-separated list of fields to sort on; append ’-’ to sort descending (e.g. “score-”).
query
Optional[str]
Search query string (e.g. “gpu_name=RTX_4090 num_gpus>=2 rentable=True”).

Returns

str — Result from the API call.

Example

from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.search_offers()
print(result)