> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# exportRecords

***

# Function: exportRecords()

```ts theme={null}
function exportRecords(
  options: Omit<
    {
      columnIds?: string[];
      experimentId?: null | string;
      exportFormat?: "csv" | "jsonl";
      filters?: object[] | object[] | object[] | object[] | object[] | object[];
      logStreamId?: null | string;
      metricsTestingId?: null | string;
      redact?: boolean;
      rootType: "trace" | "session" | "span";
      sort?: {
        ascending?: boolean;
        columnId: string;
        sortType?: "column";
      };
    },
    "filters" | "exportFormat"
  > &
    object &
    object,
): Promise<AsyncIterable<string | Record<string, unknown>, any, any>>;
```

Defined in: [src/utils/export.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/export.ts)

Exports records from a Galileo project.

Defaults to the first log stream available if `logStreamId` and `experimentId` are not provided.

## Parameters

### options

`Omit`\<\{
`columnIds?`: `string`\[];
`experimentId?`: `null` | `string`;
`exportFormat?`: `"csv"` | `"jsonl"`;
`filters?`: `object`\[] | `object`\[] | `object`\[] | `object`\[] | `object`\[] | `object`\[];
`logStreamId?`: `null` | `string`;
`metricsTestingId?`: `null` | `string`;
`redact?`: `boolean`;
`rootType`: `"trace"` | `"session"` | `"span"`;
`sort?`: \{
`ascending?`: `boolean`;
`columnId`: `string`;
`sortType?`: `"column"`;
};
}, `"filters"` | `"exportFormat"`> & `object` & `object`

Export parameters

## Returns

`Promise`\<`AsyncIterable`\<`string` | `Record`\<`string`, `unknown`>, `any`, `any`>>

A Promise that resolves to an AsyncIterable that yields records based on the export format.

* For JSONL format: Each record is a `string` containing a complete JSONL line (JSON object as string with trailing newline)
* For JSON format: Each record is a `Record<string, unknown>` (parsed JSON object)
* For CSV format: Each record is a `string` containing a complete CSV line (with trailing newline)
