Table Extraction
Extract structured table data from images and documents, converting tabular content into machine-readable format.
Generalized Table Extraction
POST https://api.aigen.online/aiscript/table-exraction/v1
Request Body
| Name | Type | Description |
|---|---|---|
| image* | String | Input base64 images encoded utf-8 |
- 200: OK Successful response
- 400: Bad Request Bad request
{
"status": "200",
"message": "success",
"response_id": "string",
"error_list": [
{
"code": "string",
"message": "string"
}
],
"result": [
[
{
"cells": [
{
"text": "order",
"confidence": 0.99875,
"row": 1,
"column": 1,
"bbox": [
[
0,
1
],
[
1,
0
],
[
1,
1
],
[
0,
1
]
]
}
],
"n_row": 5,
"n_column": 5
}
]
]
}
{
"status": "200",
"message": "success",
"response_id": "string",
"error_list": [
{
"code": "string",
"message": "string"
}
],
"result": [
[
{
"cells": [
{
"text": "order",
"confidence": 0.99875,
"row": 1,
"column": 1,
"bbox": [
[
0,
1
],
[
1,
0
],
[
1,
1
],
[
0,
1
]
]
}
],
"n_row": 5,
"n_column": 5
}
]
]
}
Example code
- Python
- Nodejs
- PHP
- cURL
import requests
import json
api = "https://api.aigen.online/aiscript/table-exraction/v1"
headers = {"x-aigen-key": "<key>", "content-type": "application/json"}
data = json.dumps({"image": "<base64_string>"})
res = requests.post(api, data=data, headers=headers)
print(res.json())
const axios = require("axios");
const api = "https://api.aigen.online/aiscript/table-exraction/v1";
const headers = {
"x-aigen-key": "<key>",
};
const data = { image: "<base64_string>" };
axios
.post(api, data, { headers: headers })
.then((res) => {
console.log(res.data);
})
.catch((err) => {
console.error(err.response.data);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.aigen.online/aiscript/table-exraction/v1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"image": "<base64_string>"
}',
CURLOPT_HTTPHEADER => array(
'X-AIGEN-KEY: <aigen-key>',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
curl --location 'https://api.aigen.online/aiscript/table-exraction/v1' \
--header 'X-AIGEN-KEY: <aigen-key>' \
--header 'Content-Type: application/json' \
--data '{
"image": "<base64_string>"
}'