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 Extracta.ai for Contract Parsing?
  • Getting Started
  • Body Example for Business Card
  • Code Example
  • Conclusion

Was this helpful?

  1. Documents

Business Card

PreviousContractNextEmail

Last updated 1 year ago

Was this helpful?

Transform your contract management process with Extracta.ai’s cutting-edge document parsing capabilities. Our API facilitates the extraction of key information from contracts, empowering legal teams, procurement departments, and businesses to automate data extraction, thereby enhancing contract analysis and management efficiency. This page offers a specialized request body template for contract parsing, designed to streamline your integration with our service.

Why Extracta.ai for Contract Parsing?

  • Efficient Data Extraction: Automate the extraction of critical contract elements, such as parties involved, terms, conditions, and obligations.

  • High Accuracy and Intelligence: Utilize Extracta.ai’s advanced algorithms for high-precision data extraction.

  • Customizable and Scalable: Adapt the data extraction to suit specific business needs, scalable for organizations of any size.

Getting Started

Initiate the process of parsing contracts through Extracta.ai by making a POST request to our /createExtraction endpoint. Below, we provide a request body template tailored for contract parsing. This template is preconfigured with keys for standard contract elements, streamlining the extraction process.

Body Example for Business Card

JSON Body
{
    "extractionDetails": {
        "name": "Business Card - Extraction",
        "language": "English",
        "fields": [
            {
                "key": "name",
                "description": "Name of the person in the business card",
                "example": "Bardahan Alexandru"
            },
            {
                "key": "job_title",
                "description": "Job title of the person",
                "example": "CEO"
            },
            {
                "key": "company_name",
                "description": "Extract company name from card; if absent, deduce from email, website, or social domains.",
                "example": "Fastapp Development"
            },
            {
                "key": "address",
                "description": "Address of the company",
                "example": "Bucharest, Romania"
            },
            {
                "key": "phone_numbers",
                "type": "array",
                "items": {
                    "type": "string",
                    "example": "+40 755 852 411"
                }
            },
            {
                "key": "email_addresses",
                "type": "array",
                "items": {
                    "type": "string",
                    "example": "office@fastappgroup.com"
                }
            },
            {
                "key": "website_url",
                "description": "Website url of the company",
                "example": "https://fastappgroup.com"
            },
            {
                "key": "social_media_handles",
                "description": "Social media handles of the company",
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": [
                        {
                            "key": "type",
                            "description": "Type of the social media handle",
                            "example": "facebook"
                        },
                        {
                            "key": "username",
                            "description": "Username of the social media handle",
                            "example": "fastappgroup"
                        }
                    ]
                }
            }
        ]
    }
}

How to Use This Template

  1. Generate an API Key: Sign up at and visit the /api page to create your API key.

  2. Execute the API Call: Employ the JSON template in a POST request to /createExtraction, incorporating your API key in the request header as a Bearer token for authentication.

  3. Process the Extracted Data: The API will respond with structured data extracted from the contract, ready for integration into your systems or workflows.

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

Leverage Extracta.ai to elevate your contract management processes, from faster data retrieval to more informed decision-making. Our API not only simplifies the extraction of crucial contract details but also integrates seamlessly into various CRM platforms like Zoho, Salesforce, and HubSpot, enhancing your workflow automation.

For comprehensive instructions on integrating our API and leveraging its full capabilities, please refer to our API Endpoints - Data Extraction and 1. Create extraction pages.

https://app.extracta.ai