Vast.ai API
Volumes
search volumes
1 min
code examples curl location globoff request post 'https //console vast ai/api/v0/volumes/search/?q={%22limit%22%3a0}' \\ \ header 'accept application/json' \\ \ header 'content type application/json'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var requestoptions = { method 'post', headers myheaders, redirect 'follow' }; fetch("https //console vast ai/api/v0/volumes/search/?q={\\"limit\\" 0}", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //console vast ai/api/v0/volumes/search/?q={\\"limit\\" 0}") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" response = https request(request) puts response read body import requests import json url = "https //console vast ai/api/v0/volumes/search/?q={\\"limit\\" 0}" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // success response { "offers" \[ { "ask contract id" 0, "bundle id" 0, "cpu arch" "amd64", "cpu ghz" 0, "cpu name" "amd epyc 7k62 48 core processor", "cuda max good" 12 8, "disk bw" 0, "disk name" "fikwot fn955 4tb", "disk space" 10, "driver vers" "", "driver version" "570 124 04", "duration" 0, "end date" 0, "external" false, "geolocation" "", "geolocode" "", "gpu arch" "", "host id" 166946, "id" 0, "inet down" 654 6, "inet up" 78 9, "machine id" 36683, "mobo name" "rome2d32gm 2t", "reliability" 0, "reliability2" 0 9649497, "reliability mult" 0, "start date" 1747341046 4320989, "static ip" true, "storage cost" 0, "storage total cost" 0 0005555555555555557, "vericode" "", "verification" "verified", "vms enabled" false } ] }// bad request { "success" false, "error" "", "msg" "invalid query {query}, must be dict of conditions" }// too many requests { "detail" "api requests too frequent endpoint threshold=5 5" }