Hospital Invoice

Response Definition

HTTP Status
Code
Message
Description

200

-

-

OCR success.

206

partial_content

Can not extract data from some page

Can not extract data from some page.

400

bad_request

Can not extract data from any page

Can not extract data from any page.

500

1000

Internal server error

some error occurred in server side

Extract water meter information

POST https://apis.aigen.online/aiscript/hospital-invoice/v2

Request Body

Name
Type
Description

image*

String

Base64 image encoded string

{'data': [{'admissionNumber': {'bboxes': [[[1251, 257],
                                           [1380, 257],
                                           [1380, 280],
                                           [1251, 280]]],
                               'bboxes_norm': [[[0.7568058076225045,
                                                 0.10987601539119282],
                                                [0.8348457350272233,
                                                 0.10987601539119282],
                                                [0.8348457350272233,
                                                 0.11970927746900385],
                                                [0.7568058076225045,
                                                 0.11970927746900385]]],
                               'confidence': 0.9949,
                               'datetime_iso': None,
                               'value': '1555/65'},
           'clientName': {'bboxes': [[[130, 236],
                                      [386, 236],
                                      [386, 276],
                                      [130, 276]]],
                          'bboxes_norm': [[[0.07864488808227466,
                                            0.10089781958101753],
                                           [0.2335148215366001,
                                            0.10089781958101753],
                                           [0.2335148215366001,
                                            0.11799914493373237],
                                           [0.07864488808227466,
                                            0.11799914493373237]]],
                          'confidence': 0.9798,
                          'datetime_iso': None,
                          'value': 'สมศักดิ์ วิบูลย์วีรรัตน์'},
           'clientNumber': {},
           'date_of_admission': {'bboxes': [[[132, 325],
                                             [381, 325],
                                             [381, 343],
                                             [132, 343]]],
                                 'bboxes_norm': [[[0.07985480943738657,
                                                   0.13894826849080805],
                                                  [0.23049001814882034,
                                                   0.13894826849080805],
                                                  [0.23049001814882034,
                                                   0.1466438648995297],
                                                  [0.07985480943738657,
                                                   0.1466438648995297]]],
                                 'confidence': 0.9638,
                                 'datetime_iso': '2022-01-25T00:00:00+07:00',
                                 'value': '25-01-2565'},
           'date_of_discharge': {'bboxes': [[[661, 327],
                                             [915, 327],
                                             [915, 346],
                                             [661, 346]]],
                                 'bboxes_norm': [[[0.3998790078644888,
                                                   0.13980333475844378],
                                                  [0.5535390199637024,
                                                   0.13980333475844378],
                                                  [0.5535390199637024,
                                                   0.14792646430098333],
                                                  [0.3998790078644888,
                                                   0.14792646430098333]]],
                                 'confidence': 0.9565,
                                 'datetime_iso': '2022-01-29T00:00:00+07:00',
                                 'value': '29-01-2565'},
           'discount': {},
           'grand_total': {'bboxes': [[[1190, 1015],
                                       [1264, 1015],
                                       [1264, 1036],
                                       [1190, 1036]]],
                           'bboxes_norm': [[[0.719903206291591,
                                             0.43394613082513894],
                                            [0.764670296430732,
                                             0.43394613082513894],
                                            [0.764670296430732,
                                             0.4429243266353142],
                                            [0.719903206291591,
                                             0.4429243266353142]]],
                           'confidence': 0.9991,
                           'datetime_iso': None,
                           'value': '3,089.96'},
           'hospitalName': {'bboxes': [[[662, 135],
                                        [925, 135],
                                        [925, 177],
                                        [662, 177]]],
                            'bboxes_norm': [[[0.40048396854204477,
                                              0.05771697306541257],
                                             [0.5595886267392619,
                                              0.05771697306541257],
                                             [0.5595886267392619,
                                              0.07567336468576315],
                                             [0.40048396854204477,
                                              0.07567336468576315]]],
                            'confidence': 0.9802,
                            'datetime_iso': None,
                            'value': 'โรงพยาบาลรามคำแหง'},
           'net_total': {},
           'table_data': [[{'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'DATETIME',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'CODE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[456, 528],
                                        [682, 530],
                                        [682, 549],
                                        [456, 547]]],
                            'bboxes_norm': [[[0.27586206896551724,
                                              0.22573749465583584],
                                             [0.41258318209316397,
                                              0.22659256092347158],
                                             [0.41258318209316397,
                                              0.23471569046601112],
                                             [0.27586206896551724,
                                              0.23386062419837536]]],
                            'column': 'NAME',
                            'confidence': 0.97900390625,
                            'datetime_iso': None,
                            'value': '1.1.1(2) HOME MEDICATION'},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'QUANTITY',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'PRICE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'AMOUNT',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''}],
                          [{'bboxes': [[[159, 557],
                                        [303, 558],
                                        [303, 577],
                                        [159, 576]]],
                            'bboxes_norm': [[[0.09618874773139746,
                                              0.2381359555365541],
                                             [0.18330308529945555,
                                              0.23856348867037194],
                                             [0.18330308529945555,
                                              0.2466866182129115],
                                             [0.09618874773139746,
                                              0.24625908507909364]]],
                            'column': 'DATETIME',
                            'confidence': 0.99658203125,
                            'datetime_iso': None,
                            'value': '29-01-2565 14:15'},
                           {'bboxes': [[[322, 557],
                                        [418, 558],
                                        [418, 578],
                                        [322, 577]]],
                            'bboxes_norm': [[[0.19479733817301875,
                                              0.2381359555365541],
                                             [0.25287356321839083,
                                              0.23856348867037194],
                                             [0.25287356321839083,
                                              0.24711415134672937],
                                             [0.19479733817301875,
                                              0.2466866182129115]]],
                            'column': 'CODE',
                            'confidence': 0.99658203125,
                            'datetime_iso': None,
                            'value': 'B0101045'},
                           {'bboxes': [[[449, 557],
                                        [807, 557],
                                        [807, 580],
                                        [449, 580]]],
                            'bboxes_norm': [[[0.2716273442226255,
                                              0.2381359555365541],
                                             [0.4882032667876588,
                                              0.2381359555365541],
                                             [0.4882032667876588,
                                              0.2479692176143651],
                                             [0.2716273442226255,
                                              0.2479692176143651]]],
                            'column': 'NAME',
                            'confidence': 0.9833984375,
                            'datetime_iso': None,
                            'value': 'LASIX [O]40 MG TABLET (*) (FUROSEMIDE)'},
                           {'bboxes': [[[959, 561],
                                        [973, 561],
                                        [973, 579],
                                        [959, 579]]],
                            'bboxes_norm': [[[0.5801572897761645,
                                              0.23984608807182556],
                                             [0.588626739261948,
                                              0.23984608807182556],
                                             [0.588626739261948,
                                              0.24754168448054725],
                                             [0.5801572897761645,
                                              0.24754168448054725]]],
                            'column': 'QUANTITY',
                            'confidence': 0.9990234375,
                            'datetime_iso': None,
                            'value': '30'},
                           {'bboxes': [[[1089, 561],
                                        [1117, 561],
                                        [1117, 580],
                                        [1089, 580]]],
                            'bboxes_norm': [[[0.6588021778584392,
                                              0.23984608807182556],
                                             [0.6757410768300061,
                                              0.23984608807182556],
                                             [0.6757410768300061,
                                              0.2479692176143651],
                                             [0.6588021778584392,
                                              0.2479692176143651]]],
                            'column': 'PRICE',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '9.00'},
                           {'bboxes': [[[1213, 560],
                                        [1263, 561],
                                        [1263, 581],
                                        [1213, 580]]],
                            'bboxes_norm': [[[0.7338173018753781,
                                              0.2394185549380077],
                                             [0.764065335753176,
                                              0.23984608807182556],
                                             [0.764065335753176,
                                              0.248396750748183],
                                             [0.7338173018753781,
                                              0.2479692176143651]]],
                            'column': 'AMOUNT',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '270.00'}],
                          [{'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'DATETIME',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'CODE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[455, 589],
                                        [858, 591],
                                        [858, 610],
                                        [455, 609]]],
                            'bboxes_norm': [[[0.2752571082879613,
                                              0.25181701581872595],
                                             [0.5190562613430127,
                                              0.2526720820863617],
                                             [0.5190562613430127,
                                              0.26079521162890124],
                                             [0.2752571082879613,
                                              0.26036767849508335]]],
                            'column': 'NAME',
                            'confidence': 0.95458984375,
                            'datetime_iso': None,
                            'value': 'รับประทานครั้งละ 1 เม็ด วันละ 2 ครั้ง '
                                     'หลังอาหาร (เช้า) (กล'},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'QUANTITY',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'PRICE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'AMOUNT',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''}],
                          [{'bboxes': [[[160, 617],
                                        [302, 618],
                                        [302, 638],
                                        [160, 637]]],
                            'bboxes_norm': [[[0.09679370840895342,
                                              0.26378794356562635],
                                             [0.18269812462189958,
                                              0.26421547669944423],
                                             [0.18269812462189958,
                                              0.27276613937580163],
                                             [0.09679370840895342,
                                              0.27233860624198375]]],
                            'column': 'DATETIME',
                            'confidence': 0.99462890625,
                            'datetime_iso': None,
                            'value': '29-01-2565 14:15'},
                           {'bboxes': [[[332, 617],
                                        [416, 618],
                                        [416, 639],
                                        [332, 638]]],
                            'bboxes_norm': [[[0.20084694494857835,
                                              0.26378794356562635],
                                             [0.2516636418632789,
                                              0.26421547669944423],
                                             [0.2516636418632789,
                                              0.2731936725096195],
                                             [0.20084694494857835,
                                              0.27276613937580163]]],
                            'column': 'CODE',
                            'confidence': 0.9990234375,
                            'datetime_iso': None,
                            'value': 'B0102068'},
                           {'bboxes': [[[451, 616],
                                        [862, 619],
                                        [862, 642],
                                        [451, 639]]],
                            'bboxes_norm': [[[0.27283726557773746,
                                              0.26336041043180847],
                                             [0.5214761040532365,
                                              0.26464300983326206],
                                             [0.5214761040532365,
                                              0.2744762719110731],
                                             [0.27283726557773746,
                                              0.2731936725096195]]],
                            'column': 'NAME',
                            'confidence': 0.982421875,
                            'datetime_iso': None,
                            'value': 'METOPROLOL STADA 100 MG TABLET (METOPRO'},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'QUANTITY',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[1078, 622],
                                        [1122, 622],
                                        [1122, 640],
                                        [1078, 639]]],
                            'bboxes_norm': [[[0.6521476104053237,
                                              0.2659256092347157],
                                             [0.6787658802177858,
                                              0.2659256092347157],
                                             [0.6787658802177858,
                                              0.2736212056434374],
                                             [0.6521476104053237,
                                              0.2731936725096195]]],
                            'column': 'PRICE',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '13.37'},
                           {'bboxes': [[[1214, 619],
                                        [1262, 619],
                                        [1262, 641],
                                        [1214, 640]]],
                            'bboxes_norm': [[[0.7344222625529341,
                                              0.26464300983326206],
                                             [0.76346037507562,
                                              0.26464300983326206],
                                             [0.76346037507562,
                                              0.2740487387772552],
                                             [0.7344222625529341,
                                              0.2736212056434374]]],
                            'column': 'AMOUNT',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '106.96'}],
                          [{'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'DATETIME',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'CODE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[452, 651],
                                        [853, 652],
                                        [853, 671],
                                        [452, 670]]],
                            'bboxes_norm': [[[0.2734422262552934,
                                              0.2783240701154339],
                                             [0.5160314579552329,
                                              0.2787516032492518],
                                             [0.5160314579552329,
                                              0.2868747327917914],
                                             [0.2734422262552934,
                                              0.2864471996579735]]],
                            'column': 'NAME',
                            'confidence': 0.95703125,
                            'datetime_iso': None,
                            'value': 'รับประทานครั้งละ 1 / 4 เม็ด วัและ 2 '
                                     'ครั้ง หลังอาหาร (เข้า)'},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'QUANTITY',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'PRICE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'AMOUNT',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''}],
                          [{'bboxes': [[[159, 678],
                                        [301, 679],
                                        [301, 699],
                                        [159, 698]]],
                            'bboxes_norm': [[[0.09618874773139746,
                                              0.28986746472851643],
                                             [0.1820931639443436,
                                              0.2902949978623343],
                                             [0.1820931639443436,
                                              0.29884566053869177],
                                             [0.09618874773139746,
                                              0.2984181274048739]]],
                            'column': 'DATETIME',
                            'confidence': 0.99609375,
                            'datetime_iso': None,
                            'value': '29-01-2565 14:15'},
                           {'bboxes': [[[333, 678],
                                        [415, 679],
                                        [415, 699],
                                        [333, 698]]],
                            'bboxes_norm': [[[0.2014519056261343,
                                              0.28986746472851643],
                                             [0.25105868118572294,
                                              0.2902949978623343],
                                             [0.25105868118572294,
                                              0.29884566053869177],
                                             [0.2014519056261343,
                                              0.2984181274048739]]],
                            'column': 'CODE',
                            'confidence': 0.99755859375,
                            'datetime_iso': None,
                            'value': 'B0102150'},
                           {'bboxes': [[[449, 680],
                                        [859, 682],
                                        [859, 702],
                                        [449, 701]]],
                            'bboxes_norm': [[[0.2716273442226255,
                                              0.2907225309961522],
                                             [0.5196612220205686,
                                              0.29157759726378796],
                                             [0.5196612220205686,
                                              0.30012825994014536],
                                             [0.2716273442226255,
                                              0.2997007268063275]]],
                            'column': 'NAME',
                            'confidence': 0.97900390625,
                            'datetime_iso': None,
                            'value': 'VASTAREL MR 35 MG TABLET (TRIMETAZIDINE '
                                     'D'},
                           {'bboxes': [[[961, 685],
                                        [971, 685],
                                        [971, 701],
                                        [961, 701]]],
                            'bboxes_norm': [[[0.5813672111312764,
                                              0.29286019666524155],
                                             [0.5874168179068361,
                                              0.29286019666524155],
                                             [0.5874168179068361,
                                              0.2997007268063275],
                                             [0.5813672111312764,
                                              0.2997007268063275]]],
                            'column': 'QUANTITY',
                            'confidence': 0.9990234375,
                            'datetime_iso': None,
                            'value': '30'},
                           {'bboxes': [[[1076, 682],
                                        [1116, 682],
                                        [1116, 702],
                                        [1076, 702]]],
                            'bboxes_norm': [[[0.6509376890502118,
                                              0.29157759726378796],
                                             [0.6751361161524501,
                                              0.29157759726378796],
                                             [0.6751361161524501,
                                              0.30012825994014536],
                                             [0.6509376890502118,
                                              0.30012825994014536]]],
                            'column': 'PRICE',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '20.56'},
                           {'bboxes': [[[1213, 680],
                                        [1267, 681],
                                        [1267, 702],
                                        [1213, 702]]],
                            'bboxes_norm': [[[0.7338173018753781,
                                              0.2907225309961522],
                                             [0.7664851784633999,
                                              0.2911500641299701],
                                             [0.7664851784633999,
                                              0.30012825994014536],
                                             [0.7338173018753781,
                                              0.30012825994014536]]],
                            'column': 'AMOUNT',
                            'confidence': 0.9990234375,
                            'datetime_iso': None,
                            'value': '616.80'}],
                          [{'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'DATETIME',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'CODE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[450, 711],
                                        [854, 714],
                                        [854, 733],
                                        [450, 730]]],
                            'bboxes_norm': [[[0.27223230490018147,
                                              0.3039760581445062],
                                             [0.5166364186327889,
                                              0.3052586575459598],
                                             [0.5166364186327889,
                                              0.31338178708849934],
                                             [0.27223230490018147,
                                              0.31209918768704575]]],
                            'column': 'NAME',
                            'confidence': 0.955078125,
                            'datetime_iso': None,
                            'value': 'รับประทานครั้งละ 1 เม็ด วันละ 2 ครั้ง '
                                     'หลังอาหาร (เข้า) T'},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'QUANTITY',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'PRICE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'AMOUNT',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''}],
                          [{'bboxes': [[[160, 740],
                                        [301, 741],
                                        [301, 759],
                                        [159, 758]]],
                            'bboxes_norm': [[[0.09679370840895342,
                                              0.31637451902522445],
                                             [0.1820931639443436,
                                              0.31680205215904234],
                                             [0.1820931639443436,
                                              0.324497648567764],
                                             [0.09618874773139746,
                                              0.32407011543394615]]],
                            'column': 'DATETIME',
                            'confidence': 0.99658203125,
                            'datetime_iso': None,
                            'value': '29-01-2565 14:15'},
                           {'bboxes': [[[334, 741],
                                        [413, 741],
                                        [413, 760],
                                        [334, 760]]],
                            'bboxes_norm': [[[0.20205686630369027,
                                              0.31680205215904234],
                                             [0.249848759830611,
                                              0.31680205215904234],
                                             [0.249848759830611,
                                              0.32492518170158186],
                                             [0.20205686630369027,
                                              0.32492518170158186]]],
                            'column': 'CODE',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': 'B0100003'},
                           {'bboxes': [[[450, 742],
                                        [861, 743],
                                        [861, 762],
                                        [450, 761]]],
                            'bboxes_norm': [[[0.27223230490018147,
                                              0.3172295852928602],
                                             [0.5208711433756806,
                                              0.31765711842667804],
                                             [0.5208711433756806,
                                              0.3257802479692176],
                                             [0.27223230490018147,
                                              0.32535271483539974]]],
                            'column': 'NAME',
                            'confidence': 0.9814453125,
                            'datetime_iso': None,
                            'value': 'MADIPLOT 20 MG TABLET (MANIDIPINE '
                                     'HYDROCI'},
                           {'bboxes': [[[961, 747],
                                        [970, 747],
                                        [970, 760],
                                        [961, 760]]],
                            'bboxes_norm': [[[0.5813672111312764,
                                              0.31936725096194957],
                                             [0.5868118572292801,
                                              0.31936725096194957],
                                             [0.5868118572292801,
                                              0.32492518170158186],
                                             [0.5813672111312764,
                                              0.32492518170158186]]],
                            'column': 'QUANTITY',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '15'},
                           {'bboxes': [[[1076, 743],
                                        [1117, 744],
                                        [1117, 762],
                                        [1075, 762]]],
                            'bboxes_norm': [[[0.6509376890502118,
                                              0.31765711842667804],
                                             [0.6757410768300061,
                                              0.3180846515604959],
                                             [0.6757410768300061,
                                              0.3257802479692176],
                                             [0.6503327283726558,
                                              0.3257802479692176]]],
                            'column': 'PRICE',
                            'confidence': 0.9990234375,
                            'datetime_iso': None,
                            'value': '34.88'},
                           {'bboxes': [[[1212, 744],
                                        [1267, 742],
                                        [1268, 762],
                                        [1213, 763]]],
                            'bboxes_norm': [[[0.7332123411978222,
                                              0.3180846515604959],
                                             [0.7664851784633999,
                                              0.3172295852928602],
                                             [0.7670901391409558,
                                              0.3257802479692176],
                                             [0.7338173018753781,
                                              0.3262077811030355]]],
                            'column': 'AMOUNT',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '523.20'}],
                          [{'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'DATETIME',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'CODE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[450, 774],
                                        [835, 775],
                                        [835, 794],
                                        [450, 793]]],
                            'bboxes_norm': [[[0.27223230490018147,
                                              0.3309106455750321],
                                             [0.5051421657592257,
                                              0.33133817870884996],
                                             [0.5051421657592257,
                                              0.3394613082513895],
                                             [0.27223230490018147,
                                              0.3390337751175716]]],
                            'column': 'NAME',
                            'confidence': 0.95849609375,
                            'datetime_iso': None,
                            'value': 'รับประทานครั้งละ 1 เม็ด วัและ 1 ครั้ง '
                                     'หลังอาหาร (เช้า)'},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'QUANTITY',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'PRICE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'AMOUNT',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''}],
                          [{'bboxes': [[[158, 801],
                                        [300, 802],
                                        [300, 821],
                                        [158, 820]]],
                            'bboxes_norm': [[[0.0955837870538415,
                                              0.3424540401881146],
                                             [0.18148820326678766,
                                              0.3428815733219325],
                                             [0.18148820326678766,
                                              0.351004702864472],
                                             [0.0955837870538415,
                                              0.3505771697306541]]],
                            'column': 'DATETIME',
                            'confidence': 0.99609375,
                            'datetime_iso': None,
                            'value': '29-01-2565 14:15'},
                           {'bboxes': [[[331, 800],
                                        [414, 800],
                                        [414, 822],
                                        [331, 821]]],
                            'bboxes_norm': [[[0.20024198427102238,
                                              0.3420265070542967],
                                             [0.25045372050816694,
                                              0.3420265070542967],
                                             [0.25045372050816694,
                                              0.3514322359982899],
                                             [0.20024198427102238,
                                              0.351004702864472]]],
                            'column': 'CODE',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '80102133'},
                           {'bboxes': [[[450, 801],
                                        [856, 801],
                                        [856, 824],
                                        [450, 823]]],
                            'bboxes_norm': [[[0.27223230490018147,
                                              0.3424540401881146],
                                             [0.5178463399879008,
                                              0.3424540401881146],
                                             [0.5178463399879008,
                                              0.3522873022659256],
                                             [0.27223230490018147,
                                              0.35185976913210776]]],
                            'column': 'NAME',
                            'confidence': 0.990234375,
                            'datetime_iso': None,
                            'value': 'CAZOSIN 2 MG TABLET (DOXAZOSIN '
                                     'MESYLATE)'},
                           {'bboxes': [[[959, 807],
                                        [971, 807],
                                        [971, 821],
                                        [959, 821]]],
                            'bboxes_norm': [[[0.5801572897761645,
                                              0.3450192389910218],
                                             [0.5874168179068361,
                                              0.3450192389910218],
                                             [0.5874168179068361,
                                              0.351004702864472],
                                             [0.5801572897761645,
                                              0.351004702864472]]],
                            'column': 'QUANTITY',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '15'},
                           {'bboxes': [[[1078, 805],
                                        [1116, 805],
                                        [1116, 824],
                                        [1078, 823]]],
                            'bboxes_norm': [[[0.6521476104053237,
                                              0.34416417272338606],
                                             [0.6751361161524501,
                                              0.34416417272338606],
                                             [0.6751361161524501,
                                              0.3522873022659256],
                                             [0.6521476104053237,
                                              0.35185976913210776]]],
                            'column': 'PRICE',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '15.00'},
                           {'bboxes': [[[1211, 803],
                                        [1260, 803],
                                        [1260, 823],
                                        [1211, 823]]],
                            'bboxes_norm': [[[0.7326073805202662,
                                              0.3433091064557503],
                                             [0.7622504537205081,
                                              0.3433091064557503],
                                             [0.7622504537205081,
                                              0.35185976913210776],
                                             [0.7326073805202662,
                                              0.35185976913210776]]],
                            'column': 'AMOUNT',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '225.00'}],
                          [{'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'DATETIME',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'CODE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[452, 834],
                                        [836, 835],
                                        [836, 854],
                                        [452, 853]]],
                            'bboxes_norm': [[[0.2734422262552934,
                                              0.35656263360410434],
                                             [0.5057471264367817,
                                              0.35699016673792217],
                                             [0.5057471264367817,
                                              0.36511329628046174],
                                             [0.2734422262552934,
                                              0.36468576314664386]]],
                            'column': 'NAME',
                            'confidence': 0.96337890625,
                            'datetime_iso': None,
                            'value': 'รับประทานครั้งละ 1 เม็ด วันละ 1 ครั้ง '
                                     'หลังอาหาร (เงิน)'},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'QUANTITY',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'PRICE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'AMOUNT',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''}],
                          [{'bboxes': [[[157, 862],
                                        [300, 863],
                                        [300, 882],
                                        [157, 881]]],
                            'bboxes_norm': [[[0.09497882637628555,
                                              0.3685335613510047],
                                             [0.18148820326678766,
                                              0.36896109448482256],
                                             [0.18148820326678766,
                                              0.37708422402736214],
                                             [0.09497882637628555,
                                              0.37665669089354425]]],
                            'column': 'DATETIME',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '29-01-2565 14:15'},
                           {'bboxes': [[[332, 861],
                                        [415, 862],
                                        [415, 883],
                                        [332, 882]]],
                            'bboxes_norm': [[[0.20084694494857835,
                                              0.36810602821718685],
                                             [0.25105868118572294,
                                              0.3685335613510047],
                                             [0.25105868118572294,
                                              0.37751175716118],
                                             [0.20084694494857835,
                                              0.37708422402736214]]],
                            'column': 'CODE',
                            'confidence': 0.9990234375,
                            'datetime_iso': None,
                            'value': 'B0102070'},
                           {'bboxes': [[[451, 863],
                                        [859, 864],
                                        [859, 885],
                                        [451, 884]]],
                            'bboxes_norm': [[[0.27283726557773746,
                                              0.36896109448482256],
                                             [0.5196612220205686,
                                              0.36938862761864044],
                                             [0.5196612220205686,
                                              0.3783668234288157],
                                             [0.27283726557773746,
                                              0.37793929029499784]]],
                            'column': 'NAME',
                            'confidence': 0.97607421875,
                            'datetime_iso': None,
                            'value': 'ORFARIN (WARFARIN) 3 MG (สีฟ้า- BLUE) '
                                     'TABLET('},
                           {'bboxes': [[[960, 868],
                                        [969, 868],
                                        [969, 881],
                                        [960, 881]]],
                            'bboxes_norm': [[[0.5807622504537205,
                                              0.3710987601539119],
                                             [0.5862068965517241,
                                              0.3710987601539119],
                                             [0.5862068965517241,
                                              0.37665669089354425],
                                             [0.5807622504537205,
                                              0.37665669089354425]]],
                            'column': 'QUANTITY',
                            'confidence': 0.9990234375,
                            'datetime_iso': None,
                            'value': '15'},
                           {'bboxes': [[[1077, 865],
                                        [1121, 865],
                                        [1121, 885],
                                        [1077, 885]]],
                            'bboxes_norm': [[[0.6515426497277677,
                                              0.3698161607524583],
                                             [0.6781609195402298,
                                              0.3698161607524583],
                                             [0.6781609195402298,
                                              0.3783668234288157],
                                             [0.6515426497277677,
                                              0.3783668234288157]]],
                            'column': 'PRICE',
                            'confidence': 0.99755859375,
                            'datetime_iso': None,
                            'value': '16.00'},
                           {'bboxes': [[[1211, 866],
                                        [1263, 866],
                                        [1263, 885],
                                        [1211, 884]]],
                            'bboxes_norm': [[[0.7326073805202662,
                                              0.3702436938862762],
                                             [0.764065335753176,
                                              0.3702436938862762],
                                             [0.764065335753176,
                                              0.3783668234288157],
                                             [0.7326073805202662,
                                              0.37793929029499784]]],
                            'column': 'AMOUNT',
                            'confidence': 0.9990234375,
                            'datetime_iso': None,
                            'value': '240.00'}],
                          [{'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'DATETIME',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'CODE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[450, 895],
                                        [784, 896],
                                        [784, 915],
                                        [450, 914]]],
                            'bboxes_norm': [[[0.27223230490018147,
                                              0.3826421547669944],
                                             [0.47428917120387176,
                                              0.3830696879008123],
                                             [0.47428917120387176,
                                              0.3911928174433519],
                                             [0.27223230490018147,
                                              0.390765284309534]]],
                            'column': 'NAME',
                            'confidence': 0.97021484375,
                            'datetime_iso': None,
                            'value': 'รับประทานครั้งละ 1 เม็ด วันละ 1 ครั้ง '
                                     '(ก่อนนอน)'},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'QUANTITY',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'PRICE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'AMOUNT',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''}],
                          [{'bboxes': [[[158, 924],
                                        [301, 925],
                                        [301, 943],
                                        [158, 942]]],
                            'bboxes_norm': [[[0.0955837870538415,
                                              0.3950406156477127],
                                             [0.1820931639443436,
                                              0.3954681487815306],
                                             [0.1820931639443436,
                                              0.4031637451902522],
                                             [0.0955837870538415,
                                              0.4027362120564344]]],
                            'column': 'DATETIME',
                            'confidence': 0.99462890625,
                            'datetime_iso': None,
                            'value': '29-01-2565 14:15'},
                           {'bboxes': [[[333, 924],
                                        [418, 924],
                                        [418, 943],
                                        [333, 942]]],
                            'bboxes_norm': [[[0.2014519056261343,
                                              0.3950406156477127],
                                             [0.25287356321839083,
                                              0.3950406156477127],
                                             [0.25287356321839083,
                                              0.4031637451902522],
                                             [0.2014519056261343,
                                              0.4027362120564344]]],
                            'column': 'CODE',
                            'confidence': 0.99658203125,
                            'datetime_iso': None,
                            'value': 'D0102389'},
                           {'bboxes': [[[450, 923],
                                        [770, 925],
                                        [770, 945],
                                        [450, 943]]],
                            'bboxes_norm': [[[0.27223230490018147,
                                              0.3946130825138948],
                                             [0.46581972171808833,
                                              0.3954681487815306],
                                             [0.46581972171808833,
                                              0.404018811457888],
                                             [0.27223230490018147,
                                              0.4031637451902522]]],
                            'column': 'NAME',
                            'confidence': 0.98779296875,
                            'datetime_iso': None,
                            'value': 'FEBURIC 80 MG TABLET (FEBUXOSTAT)'},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'QUANTITY',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[1065, 925],
                                        [1121, 925],
                                        [1121, 945],
                                        [1065, 945]]],
                            'bboxes_norm': [[[0.6442831215970962,
                                              0.3954681487815306],
                                             [0.6781609195402298,
                                              0.3954681487815306],
                                             [0.6781609195402298,
                                              0.404018811457888],
                                             [0.6442831215970962,
                                              0.404018811457888]]],
                            'column': 'PRICE',
                            'confidence': 0.99755859375,
                            'datetime_iso': None,
                            'value': '138.50'},
                           {'bboxes': [[[1198, 926],
                                        [1265, 924],
                                        [1266, 945],
                                        [1198, 947]]],
                            'bboxes_norm': [[[0.7247428917120388,
                                              0.39589568191534846],
                                             [0.7652752571082879,
                                              0.3950406156477127],
                                             [0.7658802177858439,
                                              0.404018811457888],
                                             [0.7247428917120388,
                                              0.40487387772552375]]],
                            'column': 'AMOUNT',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '1,108.00'}],
                          [{'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'DATETIME',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'CODE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[450, 956],
                                        [841, 956],
                                        [841, 975],
                                        [450, 974]]],
                            'bboxes_norm': [[[0.27223230490018147,
                                              0.40872167592988456],
                                             [0.5087719298245614,
                                              0.40872167592988456],
                                             [0.5087719298245614,
                                              0.41684480547242414],
                                             [0.27223230490018147,
                                              0.41641727233860626]]],
                            'column': 'NAME',
                            'confidence': 0.9658203125,
                            'datetime_iso': None,
                            'value': 'รับประทานครั้งละ ครึ่ง เม็ด วัและ 1 '
                                     'ครั้ง หลังอาหาร (เข้า)'},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'QUANTITY',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'PRICE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'AMOUNT',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''}],
                          [{'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'DATETIME',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'CODE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[451, 988],
                                        [663, 988],
                                        [663, 1008],
                                        [451, 1008]]],
                            'bboxes_norm': [[[0.27283726557773746,
                                              0.42240273621205643],
                                             [0.4010889292196007,
                                              0.42240273621205643],
                                             [0.4010889292196007,
                                              0.43095339888841383],
                                             [0.27283726557773746,
                                              0.43095339888841383]]],
                            'column': 'NAME',
                            'confidence': 0.990234375,
                            'datetime_iso': None,
                            'value': 'INCOME CATEGORY AMOUNT'},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'QUANTITY',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'PRICE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[1195, 986],
                                        [1263, 986],
                                        [1263, 1007],
                                        [1195, 1007]]],
                            'bboxes_norm': [[[0.7229280096793709,
                                              0.42154766994442067],
                                             [0.764065335753176,
                                              0.42154766994442067],
                                             [0.764065335753176,
                                              0.430525865754596],
                                             [0.7229280096793709,
                                              0.430525865754596]]],
                            'column': 'AMOUNT',
                            'confidence': 0.9990234375,
                            'datetime_iso': None,
                            'value': '3,089.96'}],
                          [{'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'DATETIME',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'CODE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[454, 1017],
                                        [561, 1019],
                                        [560, 1038],
                                        [453, 1035]]],
                            'bboxes_norm': [[[0.27465214761040535,
                                              0.4348011970927747],
                                             [0.3393829401088929,
                                              0.4356562633604104],
                                             [0.338777979431337,
                                              0.44377939290295],
                                             [0.27404718693284935,
                                              0.44249679350149634]]],
                            'column': 'NAME',
                            'confidence': 0.99755859375,
                            'datetime_iso': None,
                            'value': 'TOTAL AMOUNT'},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'QUANTITY',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': None,
                            'bboxes_norm': None,
                            'column': 'PRICE',
                            'confidence': 0.0,
                            'datetime_iso': None,
                            'value': ''},
                           {'bboxes': [[[1195, 1015],
                                        [1263, 1015],
                                        [1263, 1038],
                                        [1195, 1038]]],
                            'bboxes_norm': [[[0.7229280096793709,
                                              0.43394613082513894],
                                             [0.764065335753176,
                                              0.43394613082513894],
                                             [0.764065335753176,
                                              0.44377939290295],
                                             [0.7229280096793709,
                                              0.44377939290295]]],
                            'column': 'AMOUNT',
                            'confidence': 0.99853515625,
                            'datetime_iso': None,
                            'value': '3,089.96'}]],
           'time_of_admission': {'bboxes': [[[378, 327],
                                             [400, 327],
                                             [400, 343],
                                             [378, 343]]],
                                 'bboxes_norm': [[[0.22867513611615245,
                                                   0.13980333475844378],
                                                  [0.24198427102238354,
                                                   0.13980333475844378],
                                                  [0.24198427102238354,
                                                   0.1466438648995297],
                                                  [0.22867513611615245,
                                                   0.1466438648995297]]],
                                 'confidence': 0.7804,
                                 'datetime_iso': None,
                                 'value': '52'},
           'time_of_discharge': {'bboxes': [[[661, 327],
                                             [915, 327],
                                             [915, 346],
                                             [661, 346]]],
                                 'bboxes_norm': [[[0.3998790078644888,
                                                   0.13980333475844378],
                                                  [0.5535390199637024,
                                                   0.13980333475844378],
                                                  [0.5535390199637024,
                                                   0.14792646430098333],
                                                  [0.3998790078644888,
                                                   0.14792646430098333]]],
                                 'confidence': 0.9511,
                                 'datetime_iso': None,
                                 'value': '14:3'},
           'total': {}}],
 'error': [],
 'status': 'success'}

import requests

api = "https://apis.aigen.online/aiscript/hospital-invoice/v2"
headers = {"x-aigen-key": "<key>"}
data = {
  "image": "base64_image"
}
res = requests.post(api, json=data, headers=headers)
print(res.json())

Last updated