BestParse API Documentation

The BestParse API is a powerful tool for extracting structured data from unstructured and messy text. It leverages AI to identify and extract key information from text, such as product names, prices, and descriptions. The tool can handle malformed data, html markup, misspellings, erroneous/unrelated data and other common issues.

The API works by accepting a configuration object that includes the text to be parsed and a list of properties to extract. We respond to the initial request immediately with a request identifier and then process the extraction in the background. Once the extraction is complete, we send the extracted data to the provided webhook.

The API is designed to be simple to use and easy to integrate into your existing workflows.

POST » /api/extract

Initiates an extraction request. Accepts a JSON object in the body.

Parameters

key

Your private API key (do not expose this publicly).

context

The source and format of the content being parsed.

content

The raw text content that will be the basis of the extraction.

description

The general description of the type of data we are trying to extract.

properties[]

The properties that we are trying to extract from the content. Each property consists of a key and a description.

key

The key used to represent this property in the response. Must be a valid JSON key.

description

The brief, human-readable description of the property and any special instructions.

webhook

The URL to which the extracted data will be sent via webhook once the operation is complete.

Response Format

The response will be a JSON object and will only include a request identifier and status. Note: Extraction may take some time to complete and no data will be returned in the initial response.

200 Success

Request was properly formatted and was accepted for processing.

40X Error

Not accepted due to an error in the request.

Example Request

POST https://bestparse.com/api/extract

Request Body

{
    "key": "your-api-key",
    "context": "raw text content of a website without tags or element",
    "description": "business listings",
    "properties": [
        { "key": "business_name", "description": "The name of the business" },
        { "key": "address", "description": "The address of the Business directory listings" },
        { "key": "address2", "description": "The second address line of the Business, ie: suite number" },
        { "key": "state", "description": "The 2-character state of the Business" },
        ...
    ],
    "webhook": "https://your-webhook-url.com",
    "content": "..."
}

Example Responses

200 OK 
                    
{
    "id": "abcd1234abcd1234abcd1234abcd1234",
    "status": "accepted"
}
400 Bad Request
              
{
    "id": "abcd1234abcd1234abcd1234abcd1234",
    "status": "rejected",
    "error": "missing content"
}

Webhook Payload

Once the extraction is complete, the extracted data will be sent to the provided webhook URL in the form of a POST request with a JSON payload. The payload will include the request identifier and the extracted data.

Example Success

{
    "id": "abcd1234abcd1234abcd1234abcd1234",
    "status": "complete",
    "warnings": [],
    "data": [
        {
            "business_name": "US Storage Centers",
            "address": "7102 Bakers Bridge Avenue",
            "address_2": "",
            "city": "Brentwood",
            "state": "TN",
            "zip": "37027",
            "phone": "(615) 697-0799",
            "email": ""
        },
        {
            "business_name": "Two Men And A Truck",
            "address": "1715 Columbia Ave",
            "address_2": "Suite 330",
            "city": "Franklin",
            "state": "TN",
            "zip": "37064",
            "phone": "(615) 595-5929",
            "email": ""
        },
        {
            "business_name": "Security Central Storage",
            "address": "1105 Cannon Drive",
            "address_2": "",
            "city": "",
            "state": "",
            "zip": "37069",
            "phone": "(615) 791-4177",
            "email": ""
        },
        {
            "business_name": "Armstrong Relocation",
            "address": "100 Armstrong Court",
            "address_2": "",
            "city": "LaVergne",
            "state": "TN",
            "zip": "37086",
            "phone": "(615) 793-1166",
            "email": ""
        }
    ]
}