> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://reference.flatfile.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://reference.flatfile.com/_mcp/server.

# List calculations

GET https://api.x.flatfile.com/v1/sheets/{sheetId}/calculations

Returns all calculations for a sheet

Reference: https://reference.flatfile.com/api-reference/sheets/get-calculations

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `sheetId` (string, required) — ID of sheet

### Query parameters

- `versionId` (string, optional) — Returns records that were changed in that version and only those records.
- `sinceVersionId` (string, optional, deprecated) — Deprecated, use `sinceCommitId` instead.
- `commitId` (string, optional) — Returns records that were changed in that version in addition to any records from versions after that version.
- `sinceCommitId` (string, optional) — Listing a commit ID here will return all records since the specified commit.
- `filter` (enum, optional) — Options to filter records
  - Allowed values: `valid`, `error`, `all`, `none`
- `filterField` (string, optional) — The field to filter the data on.
- `searchValue` (string, optional) — The value to search for data on.
- `searchField` (string, optional) — The field to search for data on.
- `byField` (boolean, optional) — If true, the counts for each field will also be returned
- `q` (string, optional) — An FFQL query used to filter the result set to be counted

## Response

### 200

- `data` (list of Calculation, required)

## Errors

### 404 Not Found Error

- `errors` (list of Error, required)

## Types

### Calculation

- `id` (string, required) — Unique identifier for the calculation
- `workbookId` (string, required) — ID of the workbook this calculation belongs to
- `sheetId` (string, required) — ID of the sheet this calculation belongs to
- `fieldKey` (string, required) — Field key this calculation is performed on
- `type` (enum, required) — Type of calculation being performed
  - Allowed values: `COUNT_EMPTY`, `COUNT_NON_EMPTY`, `PERCENT_EMPTY`, `PERCENT_NON_EMPTY`, `COUNT_CHANGED`, `PERCENT_CHANGED`, `SUM`, `AVERAGE`, `MIN`, `MAX`
- `value` (double, optional) — Result of the calculation

### Error

- `message` (string, required)
- `key` (string, optional)

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "id",
      "workbookId": "workbookId",
      "sheetId": "sheetId",
      "fieldKey": "fieldKey",
      "type": "COUNT_EMPTY",
      "value": 1.1
    },
    {
      "id": "id",
      "workbookId": "workbookId",
      "sheetId": "sheetId",
      "fieldKey": "fieldKey",
      "type": "COUNT_EMPTY",
      "value": 1.1
    }
  ]
}
```

**SDK Code**

```typescript
import { FlatfileClient } from "@flatfile/api";

const client = new FlatfileClient({ token: "YOUR_TOKEN" });
await client.sheets.getCalculations("sheetId");

```

```python
import requests

url = "https://api.x.flatfile.com/v1/sheets/sheetId/calculations"

headers = {
    "X-Disable-Hooks": "true",
    "Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.json())
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.x.flatfile.com/v1/sheets/sheetId/calculations"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Disable-Hooks", "true")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.x.flatfile.com/v1/sheets/sheetId/calculations")

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

request = Net::HTTP::Get.new(url)
request["X-Disable-Hooks"] = 'true'
request["Authorization"] = 'Bearer <token>'

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.x.flatfile.com/v1/sheets/sheetId/calculations")
  .header("X-Disable-Hooks", "true")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.x.flatfile.com/v1/sheets/sheetId/calculations', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-Disable-Hooks' => 'true',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.x.flatfile.com/v1/sheets/sheetId/calculations");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Disable-Hooks", "true");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Disable-Hooks": "true",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.x.flatfile.com/v1/sheets/sheetId/calculations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```