Getting Started 🚦
Visit the live app at CloudCents to start comparing cloud prices, generating reports, and forecasting costs with ease.
Python 🐍
import requests
API_URL = "https://cloudcents.ai/api"
API_KEY = "your_api_key_here"
response = requests.get(f"{API_URL}/get_cloud_prices",
params={"service": "vm"},
headers={"Authorization": f"Bearer {API_KEY}"}
)
if response.status_code == 200:
prices = response.json()
print("Cloud VM Prices:", prices)
else:
print(f"Error: {response.status_code} - {response.text}")
Go 🐹
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
apiUrl := "https://cloudcents.ai/api/get_cloud_prices"
apiKey := "your_api_key_here"
req, err := http.NewRequest("GET", apiUrl, nil)
if err != nil {
fmt.Println("Error creating request:", err)
return
}
// Add query parameters
q := req.URL.Query()
q.Add("service", "vm")
req.URL.RawQuery = q.Encode()
// Add headers
req.Header.Add("Authorization", "Bearer " + apiKey)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error making request:", err)
return
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusOK {
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
fmt.Println("Cloud VM Prices:", string(body))
} else {
fmt.Printf("Error: %d - %s\n", resp.StatusCode, http.StatusText(resp.StatusCode))
}
}