Skip to main content
Parse a document with the Parse API, then pull specific fields from the parsed Markdown with the Extract API. Extract takes Markdown and a JSON schema, so every extraction starts with a parse. The tutorial uses the ade-python library and ade-typescript library to:
  • Parse this PDF: Wire Transfer Form
  • Extract these fields: Bank Name and Total Invoice Amount
  • Save the parse response and the extract response as JSON files
These examples require the Python or TypeScript client library. Before running a script, set your API key and install the library and any required dependencies.
The scripts parse with a synchronous request, which consumes credits at the full rate. To parse many documents, submit them as Parse Jobs on the standard tier, which consume half the credits. See Parse a Directory of Documents.

1. Download the Document to Process

Download the Wire Transfer Form and save it to a local directory.

2. Create the Script

Copy the script for your language and save it as parse-extract.py or parse-extract.ts in the same directory as the PDF.

3. Run the Script

Run the script from the same directory:

4. View the Output

The script prints the extracted values and saves two files to an output folder in the same directory: The extract response has these top-level fields: A run on the wire transfer form saved this wire-transfer_extract_output.json, shown with the IDs and most of the Markdown shortened. Your ranges and metadata can differ, because they depend on your parse and the model version:
wire-transfer_extract_output.json

Next Steps

Now that you have a working script, you can:
  • Replace wire-transfer.pdf with any document you want to parse and extract from.
  • Modify the schema to extract different fields. For guidance, see Extraction Schema (JSON).
  • Find each extracted value on the page: pass extraction_metadata and the parse’s structure to the Ground API. See Link Extracted Data to Document Locations.