---
title: Budgets
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > Cloudcraft (Standalone) > Cloudcraft API Reference > Budgets
---

# Budgets
.openapi-spec-content img{max-width:100%}.openapi-spec-content h1 a:hover,.openapi-spec-content h2 a:hover{color:#000;border-bottom:1px solid #000}Export budget for a blueprintGET  /blueprint/{blueprint_id}/budget/{format}Overview
Export the budget for a blueprint in CSV or XLSX format.

### Path Parameters{% #path-parameters %}

- **blueprint\_id**: *UUID*. Blueprint ID
- **format**: *String*. One of "csv" or "xlsx".

### Optional query parameters{% #optional-query-parameters %}

- **currency**: *String*. Currency in ISO_4217 format. Should be one of "USD", "AUD", "CHF", "CKK", "EUR", "GBP", "HKD", "JPY", "NOK", "NZD", "SEK", or "ZAR". Defaults to "USD".
- **period**: *String*. Period for budget. Should be one of "h" (hourly), "d" (daily), "w" (weekly), "m" (monthly), or "y" (yearly). Defaults to "m".
- **rate**: *String*. Should be one of "effective" (includes upfront fees) or "stated" (excludes upfront fees). Defaults to "effective".
Response200401403404
{% tab title="200" %}
OK
{% /tab %}

{% tab title="401" %}
Unauthorized
{% /tab %}

{% tab title="403" %}
Forbidden, insufficient privileges
{% /tab %}

{% tab title="404" %}
Blueprint not found
{% /tab %}
Code Example.chroma{max-height:350px;overflow:hidden;overflow-y:scroll}
```bash
curl --location 'https://api.cloudcraft.co/blueprint/{blueprint_id}/budget/{format}'
```

```golang
package main

import (
	"context"
	"log"
	"os"

	"github.com/DataDog/cloudcraft-go"
)

func main() {
	// Get the API key from the environment.
	key, ok := os.LookupEnv("CLOUDCRAFT_API_KEY")
	if !ok {
		log.Fatal("missing env var: CLOUDCRAFT_API_KEY")
	}

	// Check if the command line arguments are correct.
	if len(os.Args) != 2 {
		log.Fatalf("usage: %s <blueprint-id>", os.Args[0])
	}

	// Create new Config to initialize a Client.
	cfg := cloudcraft.NewConfig(key)

	// Create a new Client instance with the given Config.
	client, err := cloudcraft.NewClient(cfg)
	if err != nil {
		log.Fatal(err)
	}

	// Export the blueprint's budget with the given blueprint-id coming from a
	// command line argument.
	budget, _, err := client.Blueprint.ExportBudget(
		context.Background(),
		os.Args[1],
		"csv",
		&cloudcraft.BudgetExportParams{
			Currency: "USD",
			Period:   "month",
			Rate:     "monthly",
		},
	)
	if err != nil {
		log.Fatal(err)
	}

	// Save the budget to a file.
	if err := os.WriteFile("blueprint.csv", budget, 0o600); err != nil {
		log.Fatal(err)
	}
}
```

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("https://api.cloudcraft.co/blueprint/{blueprint_id}/budget/{format}")
  .method("GET", body)
  .build();
Response response = client.newCall(request).execute();
```

```python
from cloudcraftco import Cloudcraft

cloudcraft = Cloudcraft()

blueprint_id = 1234
bp_format = "csv"
export = cloudcraft.export_blueprint_budget(blueprint_id, bp_format)
with open(f'export.{bp_format}', "wb") as binary_file:
    binary_file.write(export)
```

```ruby
require "uri"
require "net/http"

url = URI("https://api.cloudcraft.co/blueprint/{blueprint_id}/budget/{format}")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)

response = https.request(request)
puts response.read_body
```

```javascript
var requestOptions = {
  method: 'GET',
  redirect: 'follow'
};

fetch("https://api.cloudcraft.co/blueprint/{blueprint_id}/budget/{format}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```
