> For the complete documentation index, see [llms.txt](https://clik-ai.gitbook.io/smart-extract-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://clik-ai.gitbook.io/smart-extract-documentation/smart-extract.js/performing-multiple-extraction.md).

# Performing Multiple Extraction

SmartExtract also supports extracting multiple data sets from a single pdf/xlsx file. There might be cases when your documents may have say multiple operating statements or operating statements and rent rolls in a single file. In such cases you could choose to launch multiple independent SmartExtract sessions to extract multiple data sets or you could launch a single session to let your users extract multiple datasets from single file in one go.

## Using SmartExtract API

With SmartExtract API you could pass the option to start a multi-extraction session while calling the [startSession](/smart-extract-documentation/smart-extract.js/smartextract-api.md#starting-smartextract-session) API

```javascript
smex.startSession(
  // the DOM element on which iframe should be mounted
  // e.g. document.getElementById('iframeWrapper'),
  mountNode,
  // The auth token you obtained after hitting the
  // authentication API,
  sessionAuthToken,
  // options, (optional)
  {
    // optional css classes to be applied to the iframe
    iframeClass: '<css classses to be applied to the iframe>',
    // start a mult-extraction session
    multiple: true,
  }
);
```

## Using SmartExtractSimple API

With SmartExtract API you could pass the option to start a multi-extraction session while calling the [extractDocumentData](/smart-extract-documentation/smart-extract.js/smartextractsimple-api.md#extracting-document-data) API

```javascript
const data = await smex.extractDocumentData({
  session: {
    mountNode: $('#smexWrapper')[0],
    sessionAuthToken: token,
    closeOnComplete: false,
    // start a mult-extraction session
    multiple: true,
  },
  file: fileDataUrl,
  fileName: file.name,
});
```
