ChatofAI
  • GETTING STARTED
    • πŸ‘‹User Guide
    • πŸš€How to improve your chatbot's Response Quality?
    • πŸ”—Integrations
      • πŸ”—How to integrate your ChatofAI chatbot with Telegram?
      • πŸ”—How to add your ChatofAI chatbot to your Wix website?
      • πŸ”—How to integrate your ChatofAI chatbot with Slack?
    • πŸ“₯Leads capture and notification
    • ✍️Re-train Your Chatbot
  • FAQs
    • ❓General
    • πŸ’°Pricing
  • API Reference
    • πŸ‘‰Introduction
    • β˜ƒοΈEndpoints
      • 1. Get Leads
      • 2. Chat with the Chatbot
  • Parsing API
    • πŸ“™Readable Parser
  • Change Log
    • 😍2024-05-11
    • πŸ˜ƒ2024-03-05
    • 😁2024-01-19
    • πŸ˜†2024-01-04
    • 🀩2023-11-24
    • 😁2023-11-16
    • πŸ₯³2023-11-03
    • 😝2023-10-25
  • LEGAL
    • πŸ“–Terms of Service
    • πŸ“–Privacy Policy
Powered by GitBook
On this page
  • 1. Introduction
  • 2. Auth Token
  • 3. API
  • 3.1 Request Parsing
  • 3.2 Check Parsing Status
  • 3.3 Fetch Parsed Result
  • 4. Limits
  1. Parsing API

Readable Parser

Convert your documents to Markdown [For FreeπŸ”₯]

Previous2. Chat with the ChatbotNext2024-05-11

Last updated 11 months ago

v1.0.0

AI is the big thing right now, developers everywhere are tapping into its power to build all sorts of productsβ€”think Customer Service Chatbot, Document Helper, FAQ Assistant, and Data Analyst. But there’s a hitch: why aren’t these AI responses as accurate as we’d like?

Let's dig into this issue. We give the AI a question and some documents it found through a search. The AI then tries to answer based on those snippets. Sure, having a well-crafted question is important, but the real key is how relevant those documents are. Matching accuracy and logical precision in the text of these similar documents are key.

So, we need a document parser that can help us convert a variety of documents (PDFs, Docs, HTML, Excel, CSV, etc.) into more readable text (like Markdown). This transformation enables AI to produce better answers.

1. Introduction

We provide the following Free APIs to help you convert various documents into markdown format text.

Document
Supported

PDF

βœ…

Docx

βœ…

HTML

βœ…

Excel

βœ…

CSV

βœ…

2. Auth Token

Remember that your API key is a secret! Do not share it with others or expose it in any client-side code (browsers, apps). Production requests must be routed through your backend server where your API key can be securely loaded from an environment variable or key management service.

All API requests should include your API key in an Authorization HTTP header as follows:

Authorization: Bearer CHATOFAI_API_KEY

Example curl command:

curl https://chatof.ai/path\
  -H "Authorization: Bearer $CHATOFAI_API_KEY"

Example with python

import requests
url = "https://chatof.ai/path"
headers = {
    "Authorization": f"Bearer {CHATOFAI_API_KEY}"
}
resp = requests.get(url, headers=headers)

3. API

Base URL

3.1 Request Parsing

POST /api-parser/file/async/parser

Request Parameters

Name
Position
Type
Required
Description

Authorization

header

string

yes

body

body

object

no

Β» file

body

string(binary)

no

File, required when type is pdf, docx, csv, excel

Β» url

body

string

no

URL, required when type is html

Β» type

body

string

yes

parser type, options: pdf, docx, html, excel, csv

Β» options

body

string

no

JSON string, see the documentation for supported options

Response

{
  "code": 0,
  "msg": "success",
  "data": {
    "task_id": "avhwk001"
  }
}

Response Data Structure

Status Code 200

Name
Type
Description

Β» code

integer

Β» msg

string

Β» data

object

»» task_id

string

3.2 Check Parsing Status

GET /api-parser/file/async/parser/status

Request Parameters

Name
Position
Type
Required
Description

task_id

query

string

yes

Task ID

Authorization

header

string

yes

Response

{
  "code": 0,
  "msg": "success",
  "data": {
    "status": "success",
    "err_msg": ""
  }
}

Response Data Structure

Name
Type
Description

Β» code

integer

Β» msg

string

Β» data

object

»» status

string

pending

processing

success

failed

»» error_msg

string

3.3 Fetch Parsed Result

GET /api-parser/file/async/parser/download

Request Parameters

Name
Position
Type
Required
Description

task_id

query

string

yes

Authorization

header

string

yes

Response

{
  "code": 0,
  "msg": "success",
  "data": {
    "markdown": "### Title\n\nContent"
  }
}

Response Data Structure

Name
Type
Description

Β» code

integer

Β» msg

string

Β» data

object

»» markdown

string

Parsed Markdown Text

4. Limits

There are restrictions on the request frequency to prevent abuse of the interface. You are limited to making 1 request per second and 100 requests per day. If you exceed this limit, your API calls will be restricted. Please note that the rate limit is applied at the user level, rather than the interface level. This means you are not allowed to make more than two simultaneous requests to the interface. If you have higher frequency requirements for your requests, please get in touch with us support@chatof.ai

: You can use this API to parse your file or URL. The parsing process is asynchronous. After successful submission, you will receive a unique task_id that can be used to query the parsing status and fetch the parsed result.

: With this API, you can check the parsing status of the document with the task_id.

: After the parsing task is completed, you can fetch the markdown result through this API with the task_id.

For detailed usage of the API, please refer to the section below.

You can obtain an API Key on the page.

Production Environment:

Token, check for details

For and

From

πŸ“™
Account
https://chatof.ai
Request Parsing
Check Parsing Status
Fetch Parsed Result
API
Auth Token
Check Parsing Status
Fetch Parsed Result
Request Parsing
extract tables from document
Create Your ChatofAI API Key