---
title: "DataExtraction"
canonical_url: "https://www.nutrient.io/api/csharp/data-extraction/"
md_url: "https://www.nutrient.io/api/csharp/data-extraction.md"
last_updated: "2026-10-08T08:55:57.709Z"
description: "Extracts data from a document with the same operations, the same option names and the same output files as the hosted Nutrient data extraction service, so code and knowledge carry over between the two. Like every SDK operation, each one reads its options from the document's settings: `ParseSettings` and `ExtractSettings`, generated from the hosted service's parameters, and the canonical settings they alias. Options left unset keep the default the pipeline or the SDK-wide settings provide."
---

Extracts data from a document with the same operations, the same option names and the same output files as the hosted Nutrient data extraction service, so code and knowledge carry over between the two. Like every SDK operation, each one reads its options from the document's settings: `ParseSettings` and `ExtractSettings`, generated from the hosted service's parameters, and the canonical settings they alias. Options left unset keep the default the pipeline or the SDK-wide settings provide.

```csharp

using Nutrient;

```

The SDK creates this class through factory methods or other SDK objects.

## Methods

### Extract

```csharp

public ExtractResult Extract()

```

Extracts structured data from the document with an AI model, shaped by the JSON Schema you supply.

**Returns:** [`ExtractResult`](/api/csharp/results/extract-result/) - The artifacts the run produced, under the same names the hosted service uses.

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when this instance has been disposed.

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when the license does not cover a capability this call runs.

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when a setting is rejected as invalid input.

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when the run fails; the message ends with the failure code.

### Parse

```csharp

public ParseResult Parse()

```

Parses the document into structured content (paragraphs, tables, figures, key-value regions and more) and exports it as JSON, Markdown or both.

**Returns:** [`ParseResult`](/api/csharp/results/parse-result/) - The artifacts the run produced, under the same names the hosted service uses.

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when this instance has been disposed.

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when the license does not cover a capability this call runs.

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when a setting is rejected as invalid input.

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when the run fails; the message ends with the failure code.

### Set

```csharp

public static DataExtraction Set(Document document)

```

Creates a DataExtraction instance for the specified document.

**Parameters**

| Name       | Type                                | Description                             |
| ---------- | ----------------------------------- | --------------------------------------- |
| `document` | [`Document`](/api/csharp/document/) | The open document to extract data from. |

**Returns:** [`DataExtraction`](/api/csharp/data-extraction/) - A DataExtraction instance bound to the document.

**Throws:** [`NutrientException`](/api/csharp/exceptions/nutrient-exception/) - Thrown when document is null.

## Resource management

```csharp

public void Dispose()

```

`DataExtraction` implements `IDisposable` and owns native resources. Always call `Dispose()` or use a C# `using` declaration: it is not released automatically.

---

## Related pages

- [Csharp](/api/csharp.md)
- [Document](/api/csharp/document.md)
- [License](/api/csharp/license.md)
- [Query](/api/csharp/query.md)
- [Telemetry](/api/csharp/telemetry.md)
- [Vision](/api/csharp/vision.md)

