Extracta.ai
DashboardJoin Discord
  • extracta.ai
    • Introduction
    • Overview
  • API Reference
    • πŸ”“Authentication
    • πŸ“Supported File Types
  • Data Extraction - API
    • πŸ’»API Endpoints - Data Extraction
      • 1. Create extraction
      • 2. View extraction
      • 3. Update extraction
      • 4. Delete extraction
      • 5. Upload Files
      • 6. Get results
    • Extraction Details
      • 🌎Supported Languages
      • βš™οΈOptions
      • πŸ“‹Fields
    • Receiving Batch Results
      • Polling vs Webhook
      • How to use the Webhook
    • πŸ•ΉοΈPostman Integration
  • Document Classification - API
    • πŸ’»API Endpoints - Document Classification
      • 1. Create classification
      • 2. View classification
      • 3. Update classification
      • 4. Delete data
        • 4.1 Delete classification
        • 4.2 Delete batch
        • 4.3 Delete files
      • 5. Upload Files
      • 6. Get results
    • Classification Details
      • πŸ“„Document Types
  • Documents
    • Custom Document
    • Resume / CV
    • Contract
    • Business Card
    • Email
    • Invoice
    • Receipt
    • Bank Statement
  • Support
    • πŸ’Tutorials
    • 🟒API Status
  • Contact
    • πŸ“§Contact Us
    • ❓FAQ
Powered by GitBook
On this page
  • Why Use Extracta.ai for Contract Parsing?
  • Getting Started
  • Body Example for Contract
  • How to Use This Template
  • Code Example
  • Conclusion

Was this helpful?

  1. Documents

Contract

PreviousResume / CVNextBusiness Card

Last updated 1 year ago

Was this helpful?

Maximize the efficiency of contract management with Extracta.ai’s cutting-edge document parsing technology. Our API is designed to automate the extraction of key information from contracts, aiding legal teams, contract managers, and businesses in streamlining contract analysis and compliance checks. This page provides you with a request body template for creating contract extractions, making it easy to integrate our service into your workflow.

Why Use Extracta.ai for Contract Parsing?

  • Streamlined Contract Review: Automate the extraction of key clauses, dates, and obligations.

  • Enhanced Compliance: Easily identify and manage compliance requirements across contracts.

  • Customizable Data Extraction: Focus on the specific details that matter most to your contract management process.

Getting Started

To initiate contract parsing with Extracta.ai, you'll need to perform a POST request to our /createExtraction endpoint using a template tailored for contract documents. This template includes predefined keys that match typical contract elements, facilitating precise data extraction.

Body Example for Contract

JSON Body
{
    "extractionDetails": {
        "name": "Contract - Extraction",
        "language": "English",
        "fields": [
            {
                "key": "contract_details",
                "description": "contract details",
                "type": "object",
                "properties": [
                    {
                        "key": "contract_number",
                        "example": "56-2024",
                        "type": "string"
                    },
                    {
                        "key": "contract_date",
                        "example": "April 20, 2024",
                        "type": "string"
                    }
                ]
            },
            {
                "key": "involved_parties",
                "description": "information about the two parties involved in the contract",
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": [
                        {
                            "key": "name",
                            "type": "string"
                        },
                        {
                            "key": "address",
                            "type": "string"
                        },
                        {
                            "key": "legal_representative",
                            "type": "string"
                        },
                        {
                            "key": "position",
                            "type": "string"
                        }
                    ]
                }
            },
            {
                "key": "contract_object",
                "description": "description of the contract object",
                "type": "string",
                "example": "Design and development of a web application as per the specifications in the attached Project Brief (Document A)"
            },
            {
                "key": "obligations",
                "description": "obligations of the involved parties",
                "type": "object",
                "properties": [
                    {
                        "key": "developer_obligations",
                        "example": "Design and develop a web application, deliver by September 1, 2024, make necessary adjustments within 30 days of delivery",
                        "type": "string"
                    },
                    {
                        "key": "client_obligations",
                        "example": "Pay the total fee in stages, test the application and provide feedback within 30 days of delivery",
                        "type": "string"
                    }
                ]
            },
            {
                "key": "contract_duration",
                "type": "string",
                "example": "12 months"
            },
            {
                "key": "contract_price",
                "type": "string",
                "example": "$200,000"
            }
        ]
    }
}

How to Use This Template

  1. Generate an API Key: If you haven’t already, sign up at and navigate to the /api page to create your API key.

  2. Execute the API Call: Incorporate the JSON template in your POST request to /createExtraction. Remember to authenticate your request by including your API key as a Bearer token in the request header.

  3. Process the Extracted Data: Upon submitting your request, the API will return structured data extracted from the contract, ready to be utilized in your systems or processes.

Code Example

const axios = require('axios');

/**
 * Initiates a new document extraction process with the provided details.
 * 
 * @param {string} token - The authorization token for API access.
 * @param {Object} extractionDetails - The details of the extraction to be created.
 * @returns {Promise<Object>} The promise that resolves to the API response with the new extraction ID.
 */
async function createExtraction(token, extractionDetails) {
    const url = "https://api.extracta.ai/api/v1/createExtraction";

    try {
        const response = await axios.post(url, {
            extractionDetails
        }, {
            headers: {
                'Content-Type': 'application/json',
                'Authorization': `Bearer ${token}`
            }
        });

        // Handling response
        return response.data; // Directly return the parsed JSON response
    } catch (error) {
        // Handling errors
        throw error.response ? error.response.data : new Error('An unknown error occurred');
    }
}

async function main() {
    const token = 'apiKey';
    const extractionDetails = {}; // the json body from the example

    try {
        const response = await createExtraction(token, extractionDetails);
        console.log("New Extraction Created:", response);
    } catch (error) {
        console.error("Failed to create new extraction:", error);
    }
}

main();
import requests


def create_extraction(token, extraction_details):
    url = "https://api.extracta.ai/api/v1/createExtraction"
    headers = {"Content-Type": "application/json", "Authorization": f"Bearer {token}"}

    try:
        response = requests.post(url, json=extraction_details, headers=headers)
        response.raise_for_status()  # Raises an HTTPError if the response status code is 4XX/5XX
        return response.json()  # Returns the parsed JSON response
    except requests.RequestException as e:
        # Handles any requests-related errors
        print(e)
        return None


# Example usage
if __name__ == "__main__":
    token = "apiKey"
    extraction_details = {} # the json body from the example

    response = create_extraction(token, extraction_details)
    print("New Extraction Created:", response)

Conclusion

With Extracta.ai, navigating through the complexities of contract analysis becomes a streamlined, automated process. Our API empowers you to focus on strategic aspects of contract management by handling the tedious task of data extraction.

For further details on integrating our API and making the most out of its capabilities, please refer to our API Endpoints - Data Extraction and 1. Create extraction pages.

https://app.extracta.ai