# 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,
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://clik-ai.gitbook.io/smart-extract-documentation/smart-extract.js/performing-multiple-extraction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
