{"openapi":"3.1.0","info":{"title":"Form to JSON - Handwritten & Printed Form OCR","description":"Photo, scan or PDF of a filled-in form to JSON: your own typed fields, or every field, checkbox, table and signature found. Handwriting too.","version":"v1"},"servers":[{"url":"https://form-to-json-handwritten-printed-form-ocr.p.rapidapi.com","description":"RapidAPI"}],"paths":{"/v1/form-ocr/extract":{"post":{"tags":["Form Extraction"],"summary":"Read a filled-in form from its URL into JSON","description":"A photo, scan or PDF of a filled-in form (typed or handwritten) as JSON.\nWith `fields`: one typed value per field you name, checked against the\npage's own text. Without: every field (label and value), checkbox, option\ngroup, table and signature box. 1 credit per page (PDF: up to 10 pages).","operationId":"extractFormFromUrl","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormRequest"},"examples":{"Extract Form from URL":{"summary":"Extract Form from URL","value":{"url":"https://upload.wikimedia.org/wikipedia/commons/a/aa/World_War_I_Draft_Registration_Card_for_Louis_Armstrong_1918.gif","fields":[{"name":"full_name","type":"string"},{"name":"date_of_birth","type":"date"},{"name":"race","type":"string"},{"name":"employer","type":"string"},{"description":"is it signed","name":"signed","type":"boolean"}],"pages":"1-2"}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormResponse"},"examples":{"Extract Form from URL":{"summary":"Extract Form from URL (real response)","value":{"source":"https://upload.wikimedia.org/wikipedia/commons/a/aa/World_War_I_Draft_Registration_Card_for_Louis_Armstrong_1918.gif","mime_type":"image/jpeg","mode":"fields","page_count":1,"pages_read":[1],"title":"REGISTRATION CARD","languages":["en"],"handwriting":true,"data":{"full_name":"Lewis Armstrong","date_of_birth":"1900-07-04","race":"Negro","employer":"Peter Lala","signed":true},"fields":[{"name":"full_name","type":"string","value":"Lewis Armstrong","page":1,"handwritten":true,"confidence":"high"},{"name":"date_of_birth","label":"Date of Birth","type":"date","value":"1900-07-04","page":1,"handwritten":true,"confidence":"high"},{"name":"race","label":"Negro","type":"string","value":"Negro","page":1,"handwritten":true,"confidence":"high"},{"name":"employer","label":"EMPLOYER'S NAME","type":"string","value":"Peter Lala","page":1,"handwritten":true,"confidence":"high"},{"name":"signed","label":"REGISTRANT'S SIGNATURE OR MARK","type":"boolean","value":true,"page":1,"handwritten":true,"confidence":"high"}],"filled":5,"empty":0,"text":"REGISTRATION CARD\n\nSERIAL NUMBER\t928\tORDER NUMBER\t4177\n\n1. Lewis Armstrong\n(First name) (Middle name) (Last name)\n2. PERMANENT HOME ADDRESS: 1233 Perdido St. N.O. La.\n...","truncated":false,"credits":1}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Extract Form from URL"}},"/v1/form-ocr/extract/upload":{"post":{"tags":["Form Extraction"],"summary":"Read an uploaded filled-in form into JSON","description":"Same as /extract, for a file sent as multipart/form-data (field `file`;\n`fields` as a JSON array string).","operationId":"extractUploadedForm","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_Extract_Uploaded_Form"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormResponse"},"examples":{"Extract Uploaded Form":{"summary":"Extract Uploaded Form","value":{"mime_type":"image/jpeg","mode":"fields","pages_read":[1],"languages":["en"],"data":{"date_of_birth":"1900-08-04","full_name":"Louis Armstrong"},"fields":[{"type":"date","confidence":"high","alternative":"4127"}],"tables":[{}],"signatures":[{"label":"Signature of registrant"}],"truncated":false,"credits":1}}}}}},"400":{"description":"Invalid input, or the target could not be processed (see `error.code`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing proxy secret (call through RapidAPI with your key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Invalid proxy secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Daily limit of your plan reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"The AI provider failed (`ai_error`) or capacity is temporarily exhausted (`capacity_exhausted`); retry. Not billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-rapidapi-endpoint":"Extract Uploaded Form"}}},"components":{"schemas":{"Body_Extract_Uploaded_Form":{"properties":{"file":{"type":"string","title":"File","description":"Form image or PDF, up to 20 MB.","format":"binary"},"fields":{"type":"string","maxLength":20000,"title":"Fields","description":"The values you want, each with a name, a type and an optional short description of where it is on the form. Leave empty to get every field of the form (labels, values, checkboxes, tables, signatures). Sent as a JSON array."},"pages":{"type":"string","maxLength":200,"title":"Pages","description":"PDF only: pages to read, e.g. '1-2' or '1,3'. All when empty."}},"type":"object","required":["file"],"title":"Body_Extract Uploaded Form"},"ErrorBody":{"properties":{"status":{"type":"integer","title":"Status","examples":[400]},"code":{"type":"string","title":"Code","examples":["invalid_url"]},"message":{"type":"string","title":"Message","examples":["A website URL is required."]}},"type":"object","required":["status","code","message"],"title":"ErrorBody"},"ErrorEnvelope":{"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"type":"object","required":["error"],"title":"ErrorEnvelope"},"ExtractedField":{"properties":{"name":{"type":"string","title":"Name","description":"Your field name, or a key made from the label."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"The label printed on the form next to the value."},"type":{"type":"string","title":"Type","description":"Your field's type; in auto mode text, number, date, checkbox or choice.","examples":["date"]},"value":{"title":"Value","description":"null when the field is empty or not on the form. Checkboxes are true/false; in auto mode other values are strings, as written."},"page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page","description":"Page of the field (1-based)."},"handwritten":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Handwritten","description":"The value is handwritten (not typed or printed)."},"confidence":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}],"title":"Confidence","description":"How legible the value is: high, medium or low."},"uncertain":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Uncertain","description":"true when a second, independent reading of this handwritten value did not read it the same way (a digit or a letter differs): check it by eye. Its confidence is then low. Absent otherwise."},"alternative":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alternative","description":"Auto mode, with uncertain: what the second reading saw, e.g. 4127 for 4177.","examples":["4127"]}},"type":"object","required":["name","type"],"title":"ExtractedField"},"FormField":{"properties":{"name":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,39}$","title":"Name","description":"Output key: letters, digits and underscores, 40 max.","examples":["date_of_birth"]},"type":{"type":"string","enum":["string","number","integer","date","boolean","checkbox","list"],"title":"Type","description":"string (as written), number, integer, date (YYYY-MM-DD), boolean (a yes/no answer), checkbox (is the box ticked) or list (of short strings).","default":"string"},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Description","description":"Where or what the value is, e.g. 'box 3, date of birth'."}},"type":"object","required":["name"],"title":"FormField"},"FormRequest":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url","description":"Direct link to a form: an image (PNG, JPEG, WEBP, HEIC, GIF, BMP, TIFF) or a PDF, up to 20 MB.","examples":["https://upload.wikimedia.org/wikipedia/commons/a/aa/World_War_I_Draft_Registration_Card_for_Louis_Armstrong_1918.gif"]},"fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/FormField"},"type":"array","maxItems":40},{"type":"null"}],"title":"Fields","description":"The values you want, each with a name, a type and an optional short description of where it is on the form. Leave empty to get every field of the form (labels, values, checkboxes, tables, signatures).","examples":[[{"name":"full_name","type":"string"},{"name":"date_of_birth","type":"date"},{"name":"race","type":"string"},{"name":"employer","type":"string"},{"description":"is it signed","name":"signed","type":"boolean"}]]},"pages":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Pages","description":"PDF only: pages to read, e.g. '1-2' or '1,3'. All when empty.","examples":["1-2"]}},"type":"object","required":["url"],"title":"FormRequest"},"FormResponse":{"properties":{"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"File name or final URL."},"mime_type":{"type":"string","title":"Mime Type","examples":["image/jpeg"]},"mode":{"type":"string","enum":["fields","auto"],"title":"Mode","description":"'fields': your fields; 'auto': every field found."},"page_count":{"type":"integer","title":"Page Count","description":"Pages in the file (1 for an image)."},"pages_read":{"items":{"type":"integer"},"type":"array","title":"Pages Read","examples":[[1]]},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"The form's printed title."},"languages":{"items":{"type":"string"},"type":"array","title":"Languages","description":"ISO 639-1 codes of the text found.","examples":[["en"]]},"handwriting":{"type":"boolean","title":"Handwriting","description":"Whether the form has handwriting."},"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Field name -> value, ready to store.","examples":[{"date_of_birth":"1900-08-04","full_name":"Louis Armstrong"}]},"fields":{"items":{"$ref":"#/components/schemas/ExtractedField"},"type":"array","title":"Fields","description":"Each field with its label, page, handwriting and confidence."},"tables":{"anyOf":[{"items":{"$ref":"#/components/schemas/FormTable"},"type":"array"},{"type":"null"}],"title":"Tables","description":"Auto mode: tables of the form (line items, schedules)."},"signatures":{"anyOf":[{"items":{"$ref":"#/components/schemas/Signature"},"type":"array"},{"type":"null"}],"title":"Signatures","description":"Auto mode: signature boxes and whether they are signed."},"filled":{"type":"integer","title":"Filled","description":"Fields with a value."},"empty":{"type":"integer","title":"Empty","description":"Fields left empty (value null)."},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"Fields mode: the full text of the form, in reading order (what every text value was checked against)."},"truncated":{"type":"boolean","title":"Truncated","description":"A page was too dense to read in full: the end of its content may be missing.","default":false},"credits":{"type":"integer","title":"Credits","description":"Credits used: 1 per page, 2 or 3 for very dense pages.","examples":[1]}},"type":"object","required":["mime_type","mode","page_count","pages_read","languages","handwriting","data","fields","filled","empty","credits"],"title":"FormResponse"},"FormTable":{"properties":{"page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"headers":{"items":{"type":"string"},"type":"array","title":"Headers"},"rows":{"items":{"items":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"array"},"type":"array","title":"Rows"}},"type":"object","title":"FormTable"},"Signature":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","examples":["Signature of registrant"]},"signed":{"type":"boolean","title":"Signed","description":"A signature, initials or a stamp is present."},"page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page"}},"type":"object","required":["signed"],"title":"Signature"}},"securitySchemes":{"RapidAPIKey":{"type":"apiKey","in":"header","name":"X-RapidAPI-Key"},"RapidAPIHost":{"type":"apiKey","in":"header","name":"X-RapidAPI-Host"}}},"tags":[{"name":"Form Extraction","description":"A form image or PDF to JSON: your fields, or every field found."}],"security":[{"RapidAPIKey":[],"RapidAPIHost":[]}]}