> ## 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.

# getExperiment

***

# Function: getExperiment()

```ts theme={null}
function getExperiment(
  options: object,
): Promise<undefined | ExperimentResponseType>;
```

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

Gets an experiment by id or name.
At least one of id or name must be provided.

## Parameters

### options

The options for getting an experiment.

#### id?

`string`

(Optional) The id of the experiment.

#### name?

`string`

(Optional) The name of the experiment.

#### projectName

`string`

The name of the project.

## Returns

`Promise`\<
\| `undefined`
\| [`ExperimentResponseType`](/sdk-api/typescript/reference/types/type-aliases/ExperimentResponseType)>

A promise that resolves to the experiment, or undefined if not found.
