# getFreeBusy (https://www.cal-sdk.com/docs/reference/get-free-busy)

Use `getFreeBusy` when you need to know when someone is busy, not what their events are.

```ts
import { getFreeBusy } from '@cal-sdk/core';

const { calendars } = await getFreeBusy({
  calendar,
  calendarIds: ['primary', 'team@example.com'],
  timeMin: new Date(),
  timeMax: new Date(Date.now() + 7 * 86_400_000),
});
```

Google answers from its free/busy endpoint. Other providers are read from their events instead, with a `compatibility` warning: [Find free time](/docs/guides/free-time) covers how the busy times are worked out.

## Options [#options]

<TypeTable
  type={{
    timeMin: { type: 'Date | string', required: true },
    timeMax: { type: 'Date | string', required: true },
    calendarIds: { type: 'string[]', default: "['primary']" },
  }}
/>

Plus the [common options](/docs/reference#common-options).

## Result [#result]

<TypeTable
  type={{
    calendars: { type: 'Record<string, { busy: BusyBlock[]; error?: string }>', description: 'Keyed by requested calendar id. busy is merged, sorted and clipped to the window. error is set when that calendar could not be read.', required: true },
    warnings: { type: 'Warning[]', required: true },
  }}
/>

A `BusyBlock` is `{ start: string; end: string }`, ISO 8601 instants with `end` exclusive.
