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

# Export an analysis as a flat table

GET https://api.siftsy.app/analyst/v1/analyses/{analysisId}/export

Requires `analyses:read`, or `analyses:run` for an `an_…` analysis
created by the same key. Flat, joinable tables from a `ready`
analysis — dot-path columns (`scores.sentiment`,
`mix.consensus.negativePercent`), arrays joined with `;`:

- `posts` (default): one row per post — join keys (`postId`, `link`,
  `platform`, `account`, `postedAt`, `collectionIds`, `tags`), stored
  scores and mix bars, and `matchedComments` / `shareOfPostComments`
  for this analysis. On a comparison, `sides` lists the sides a post
  belongs to.
- `sides`: one row per comparison side, with `vsSide1` deltas.
- `timeline`: one row per period (and per side on a comparison).
  Needs `include: ["timeline"]`.
- `languages`: one row per language (and per side). Needs
  `include: ["languages"]`.
- `citations`: the comments cited by `answer`. Needs `comments:read`.

`format=json` returns rows in `data` and the column list in
`meta.columns`. `format=csv` returns `text/csv` as an attachment;
text cells a spreadsheet would read as a formula are prefixed with
`'`. Both count against the daily transfer budget. Nothing is
recomputed. Returns `409 analysis_not_ready` until `ready`.

Rate class `analysis_export` (30 / minute, 500 / day per key).


Reference: https://api.docs.siftsy.com/api-reference/siftsy-analyst-api/export-analysis

## Authentication

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

## Servers

- `https://api.siftsy.app/analyst/v1` (Production, default)
- `http://localhost:3000/analyst/v1` (Local development)

## Request

### Path parameters

- `analysisId` (string, required)

### Query parameters

- `table` (enum, optional, default: posts)
  - Allowed values: `posts`, `sides`, `timeline`, `languages`, `citations`
- `format` (enum, optional, default: json) — `json` (default) or `csv`. CSV is a `text/csv` attachment with dot-path column headers; text cells a spreadsheet would read as a formula are prefixed with `'`.
  - Allowed values: `json`, `csv`

## Response

### 200

Table rows (JSON) or a CSV attachment

- `data` (list of map from string to any, optional) — Flat rows keyed by `meta.columns`.
- `meta` (EnvelopeTableMeta, optional)

## Errors

### 400 Bad Request Error

Invalid request

- `any`

### 403 Forbidden Error

Missing required scope

- `any`

### 404 Not Found Error

Resource not found

- `any`

### 409 Conflict Error

Analysis is not `ready`. `error.message` is `analysis_not_ready` (still `queued` / `running`; honor `Retry-After`) or `analysis_failed`. `error.status` carries the current status.

- `any`

## Types

### EnvelopeTableMeta

- `analysisId` (string, optional)
- `table` (string, optional)
- `columns` (list of string, optional)
- `rowCount` (integer, optional)

## Examples

**Response**

```json
{
  "data": [
    {}
  ],
  "meta": {
    "analysisId": "string",
    "table": "string",
    "columns": [
      "string"
    ],
    "rowCount": 1
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.siftsy.app/analyst/v1/analyses/analysisId/export"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript
const url = 'https://api.siftsy.app/analyst/v1/analyses/analysisId/export';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.siftsy.app/analyst/v1/analyses/analysisId/export"

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

	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.siftsy.app/analyst/v1/analyses/analysisId/export")

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

request = Net::HTTP::Get.new(url)
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.siftsy.app/analyst/v1/analyses/analysisId/export")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.siftsy.app/analyst/v1/analyses/analysisId/export', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.siftsy.app/analyst/v1/analyses/analysisId/export");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.siftsy.app/analyst/v1/analyses/analysisId/export")! 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()
```