Vast.ai API
Network Volumes
search network volumes
1 min
code examples curl location 'https //console vast ai/api/v0/network volumes/search/' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{"body" {"q" {"verified" {},"reliability2" {},"inet down" {},"inet up" {},"geolocation" {},"disk bw" {},"duration" {},"storage cost" {}}}}'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "body" { "q" { "verified" {}, "reliability2" {}, "inet down" {}, "inet up" {}, "geolocation" {}, "disk bw" {}, "duration" {}, "storage cost" {} } } }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //console vast ai/api/v0/network volumes/search/", 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/network volumes/search/") 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" request body = json dump({ "body" { "q" { "verified" {}, "reliability2" {}, "inet down" {}, "inet up" {}, "geolocation" {}, "disk bw" {}, "duration" {}, "storage cost" {} } } }) response = https request(request) puts response read body import requests import json url = "https //console vast ai/api/v0/network volumes/search/" payload = json dumps({ "body" { "q" { "verified" {}, "reliability2" {}, "inet down" {}, "inet up" {}, "geolocation" {}, "disk bw" {}, "duration" {}, "storage cost" {} } } }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful search response { "success" true, "offers" \[ { "ask contract id" 0, "disk space" 0, "inet up" 0, "inet down" 0, "reliability2" 0, "verified" false, "geolocation" "", "nw disk avg bw" 0, "nw disk max bw" 0, "nw disk min bw" 0, "start date" 0, "end date" 0, "storage cost" 0, "storage cost total" 0 } ] }// bad request invalid query parameters { "success" false, "error" "", "msg" "" }// unauthorized invalid or missing api key { "success" false, "error" "", "msg" "" }// too many requests { "success" false, "error" "", "msg" "" }