> ## Documentation Index
> Fetch the complete documentation index at: https://docs.landing.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Code Examples

> Browse runnable Python and TypeScript scripts that parse folders of documents, draw block boxes, extract fields, and ground them on the page.

Use these scripts as starting points for common tasks with the [Parse](./parse), [Extract](./extract), and [Ground](./ground) APIs. Each script has a Python and a TypeScript version and reads the response the way these APIs return it: the document as Markdown, a `structure` tree of pages and blocks, and a `grounding` object on every block with its page number and bounding box.

If you are moving code from ADE Gen1, these scripts replace the Gen1 samples. Gen1 scripts read `chunks` and a top-level `grounding` map keyed by chunk ID, and neither exists in these responses. See the [Migration Guide](./migration-guide).

> [!NOTE]
>
> These examples require the [Python](./ade-python) or [TypeScript](./ade-typescript) client library. Before running a script, set your API key and install the library and any required dependencies.

## Parse Documents

> **[Parse a Directory of Documents](./parse-directory-sample)**
>
> Submit every file in a folder as a Parse Job on the `standard` tier and save the Markdown and the full response.

> **[Parse Documents Concurrently](./parse-async-sample)**
>
> Submit and poll many Parse Jobs at once with the async Python client or `Promise.allSettled()`.

> **[Visualize Parsed Blocks](./parse-visualize-sample)**
>
> Draw a labeled, color-coded box around every block and table cell on each page.

> **[Save Parsed Blocks as Images](./parse-save-blocks-images-sample)**
>
> Crop each block on each page and save it as a separate PNG named by its block ID.

## Extract and Ground Fields

> **[Parse & Extract](./parse-extract-sample)**
>
> Parse a document, extract fields with a JSON schema, and save both responses.

> **[Link Extracted Data to Document Locations](./extract-grounding-sample)**
>
> Ground each extracted field with the Ground API, then save a crop and the page and box of each value.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.