Search Costs
curl --request POST \
--url https://api.wistx.ai/v1/cost/search \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"providers": {},
"service_categories": {},
"regions": {},
"pricing_categories": {},
"max_price": 123,
"min_price": 123,
"max_results": 123
}
'import requests
url = "https://api.wistx.ai/v1/cost/search"
payload = {
"query": "<string>",
"providers": {},
"service_categories": {},
"regions": {},
"pricing_categories": {},
"max_price": 123,
"min_price": 123,
"max_results": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
providers: {},
service_categories: {},
regions: {},
pricing_categories: {},
max_price: 123,
min_price: 123,
max_results: 123
})
};
fetch('https://api.wistx.ai/v1/cost/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wistx.ai/v1/cost/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>',
'providers' => [
],
'service_categories' => [
],
'regions' => [
],
'pricing_categories' => [
],
'max_price' => 123,
'min_price' => 123,
'max_results' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wistx.ai/v1/cost/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"providers\": {},\n \"service_categories\": {},\n \"regions\": {},\n \"pricing_categories\": {},\n \"max_price\": 123,\n \"min_price\": 123,\n \"max_results\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wistx.ai/v1/cost/search")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"providers\": {},\n \"service_categories\": {},\n \"regions\": {},\n \"pricing_categories\": {},\n \"max_price\": 123,\n \"min_price\": 123,\n \"max_results\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/cost/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"providers\": {},\n \"service_categories\": {},\n \"regions\": {},\n \"pricing_categories\": {},\n \"max_price\": 123,\n \"min_price\": 123,\n \"max_results\": 123\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"provider": "aws",
"service": "EC2",
"instance_type": "t3.micro",
"region": "us-east-1",
"list_unit_price": 0.0104,
"currency": "USD",
"pricing_category": "on-demand",
"service_category": "compute",
"lookup_key": "aws-ec2-t3.micro-us-east-1-on-demand"
}
],
"total": 1,
"query": "EC2 instance pricing in us-east-1",
"filters": {
"providers": ["aws"],
"service_categories": ["compute"],
"regions": ["us-east-1"],
"pricing_categories": null,
"max_price": 100.00,
"min_price": 0.10
}
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": "query is required"
},
"metadata": {
"request_id": "req_abc123",
"timestamp": 1704067200.0
}
}
{
"detail": "Search failed: Failed to generate query embedding"
}
{
"detail": "Pinecone API key not configured"
}
Cost Search
Search Costs
Search cost data using semantic search
POST
/
v1
/
cost
/
search
Search Costs
curl --request POST \
--url https://api.wistx.ai/v1/cost/search \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"providers": {},
"service_categories": {},
"regions": {},
"pricing_categories": {},
"max_price": 123,
"min_price": 123,
"max_results": 123
}
'import requests
url = "https://api.wistx.ai/v1/cost/search"
payload = {
"query": "<string>",
"providers": {},
"service_categories": {},
"regions": {},
"pricing_categories": {},
"max_price": 123,
"min_price": 123,
"max_results": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
providers: {},
service_categories: {},
regions: {},
pricing_categories: {},
max_price: 123,
min_price: 123,
max_results: 123
})
};
fetch('https://api.wistx.ai/v1/cost/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wistx.ai/v1/cost/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '<string>',
'providers' => [
],
'service_categories' => [
],
'regions' => [
],
'pricing_categories' => [
],
'max_price' => 123,
'min_price' => 123,
'max_results' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wistx.ai/v1/cost/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"providers\": {},\n \"service_categories\": {},\n \"regions\": {},\n \"pricing_categories\": {},\n \"max_price\": 123,\n \"min_price\": 123,\n \"max_results\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wistx.ai/v1/cost/search")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"providers\": {},\n \"service_categories\": {},\n \"regions\": {},\n \"pricing_categories\": {},\n \"max_price\": 123,\n \"min_price\": 123,\n \"max_results\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/cost/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"providers\": {},\n \"service_categories\": {},\n \"regions\": {},\n \"pricing_categories\": {},\n \"max_price\": 123,\n \"min_price\": 123,\n \"max_results\": 123\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"provider": "aws",
"service": "EC2",
"instance_type": "t3.micro",
"region": "us-east-1",
"list_unit_price": 0.0104,
"currency": "USD",
"pricing_category": "on-demand",
"service_category": "compute",
"lookup_key": "aws-ec2-t3.micro-us-east-1-on-demand"
}
],
"total": 1,
"query": "EC2 instance pricing in us-east-1",
"filters": {
"providers": ["aws"],
"service_categories": ["compute"],
"regions": ["us-east-1"],
"pricing_categories": null,
"max_price": 100.00,
"min_price": 0.10
}
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": "query is required"
},
"metadata": {
"request_id": "req_abc123",
"timestamp": 1704067200.0
}
}
{
"detail": "Search failed: Failed to generate query embedding"
}
{
"detail": "Pinecone API key not configured"
}
Search cost data using semantic search
curl --request POST \
--url https://api.wistx.ai/v1/cost/search \
--header 'Content-Type: application/json' \
--data '{
"query": "EC2 instance pricing in us-east-1",
"providers": ["aws"],
"service_categories": ["compute"],
"regions": ["us-east-1"],
"max_price": 100.00,
"min_price": 0.10,
"max_results": 20
}'
import requests
url = "https://api.wistx.ai/v1/cost/search"
response = requests.post(
url,
headers={"Content-Type": "application/json"},
json={
"query": "EC2 instance pricing in us-east-1",
"providers": ["aws"],
"service_categories": ["compute"],
"regions": ["us-east-1"],
"max_price": 100.00,
"min_price": 0.10,
"max_results": 20
}
)
data = response.json()
print(f"Found {data['total']} cost results")
const url = "https://api.wistx.ai/v1/cost/search";
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
query: "EC2 instance pricing in us-east-1",
providers: ["aws"],
service_categories: ["compute"],
regions: ["us-east-1"],
max_price: 100.00,
min_price: 0.10,
max_results: 20
})
});
const data = await response.json();
console.log(`Found ${data.total} cost results`);
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.wistx.ai/v1/cost/search"
payload := map[string]interface{}{
"query": "EC2 instance pricing in us-east-1",
"providers": []string{"aws"},
"service_categories": []string{"compute"},
"regions": []string{"us-east-1"},
"max_price": 100.00,
"min_price": 0.10,
"max_results": 20,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("Found %v cost results\n", result["total"])
}
require 'net/http'
require 'json'
require 'uri'
url = URI("https://api.wistx.ai/v1/cost/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = {
query: "EC2 instance pricing in us-east-1",
providers: ["aws"],
service_categories: ["compute"],
regions: ["us-east-1"],
max_price: 100.00,
min_price: 0.10,
max_results: 20
}.to_json
response = http.request(request)
data = JSON.parse(response.body)
puts "Found #{data['total']} cost results"
<?php
$url = "https://api.wistx.ai/v1/cost/search";
$data = [
"query" => "EC2 instance pricing in us-east-1",
"providers" => ["aws"],
"service_categories" => ["compute"],
"regions" => ["us-east-1"],
"max_price" => 100.00,
"min_price" => 0.10,
"max_results" => 20
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo "Found " . $data['total'] . " cost results";
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.OutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
public class SearchCosts {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.wistx.ai/v1/cost/search");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JsonObject payload = new JsonObject();
payload.addProperty("query", "EC2 instance pricing in us-east-1");
payload.addProperty("max_price", 100.00);
payload.addProperty("min_price", 0.10);
payload.addProperty("max_results", 20);
Gson gson = new Gson();
String[] providers = {"aws"};
String[] serviceCategories = {"compute"};
String[] regions = {"us-east-1"};
payload.add("providers", gson.toJsonTree(providers));
payload.add("service_categories", gson.toJsonTree(serviceCategories));
payload.add("regions", gson.toJsonTree(regions));
try (OutputStream os = conn.getOutputStream()) {
byte[] input = gson.toJson(payload).getBytes("utf-8");
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println(response.toString());
}
}
Request Parameters
string
required
Search query describing the cost data you’re looking for.
array[string]
Filter by cloud providers.Options:
aws, gcp, azure, oracle, alibabaarray[string]
Filter by service categories (e.g.,
compute, storage, networking).array[string]
Filter by regions (e.g.,
us-east-1, eu-west-1).array[string]
Filter by pricing categories.
number
Maximum price filter (decimal).
number
Minimum price filter (decimal).
integer
Maximum number of results to return.Minimum: 1
Maximum: 100
Default: 20
Maximum: 100
Default: 20
Response
{
"results": [
{
"provider": "aws",
"service": "EC2",
"instance_type": "t3.micro",
"region": "us-east-1",
"list_unit_price": 0.0104,
"currency": "USD",
"pricing_category": "on-demand",
"service_category": "compute",
"lookup_key": "aws-ec2-t3.micro-us-east-1-on-demand"
}
],
"total": 1,
"query": "EC2 instance pricing in us-east-1",
"filters": {
"providers": ["aws"],
"service_categories": ["compute"],
"regions": ["us-east-1"],
"pricing_categories": null,
"max_price": 100.00,
"min_price": 0.10
}
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": "query is required"
},
"metadata": {
"request_id": "req_abc123",
"timestamp": 1704067200.0
}
}
{
"detail": "Search failed: Failed to generate query embedding"
}
{
"detail": "Pinecone API key not configured"
}
Related Endpoints
- Get Costs by Provider - Get costs by provider
- Compare Costs - Compare costs
- Get Optimization Opportunities - Find optimization opportunities