[L017]Layout-only Parsing (No OCR)

post
https://connect.patsnap.com/rd-llm/v1/documents/layout_parsing
Try in Sandbox

Run layout detection only, without OCR. Every results.content value is null and markdown is not returned. Supported types: png, jpg, jpeg, pdf, doc, docx, ppt, pptx, xls, and xlsx. include_crop_urls is optional and defaults to true.

Request Parameters

List of parameters supported by this API endpoint

NameTypeExampleDescription
file
Required
filemaximum 20MB
File to analyze for layout.

Response Schema

Structure of the API response data

Field NameTypeExampleDescription
data
Required
objectPlease check the form: LayoutParseResponse
Data payload for layout-only parsing.
state
Required
stringsuccess
Execution state; success indicates that parsing completed successfully.
results
Required
arrayPlease check the form: LayoutResultItem
Layout detection results; markdown is not returned.
url
string<uri>https://oss.example.com/doc/0_2.png?sign=...
Cropped-region URL. Null when include_crop_urls=false; when true, URLs are primarily provided for chemical structures and figures.
bbox
Required
array[ 0.16, 0.18, 0.37, 0.2, 0.9 ]
Normalized coordinates [x1, y1, x2, y2, confidence].
page
Required
integer<int32>-
Zero-based page index.
type
Required
stringfigure
Original region type produced by the layout model.
content
stringnull
Always null because layout-only mode does not run OCR.
file_type
Required
stringpng
Input file type inferred from the uploaded filename extension.
total_pages
Required
integer<int32>1
Total pages; always 1 for an image.
status
Required
stringsuccess
The request completed successfully.
error_msg
Required
stringsuccess
Always success on success.
error_code
Required
integer<int32>-
Always 0 on success.

Success Response Example

Example of a successful API response

JSON
{
  "data": {
    "state": "success",
    "results": [
      {
        "url": "https://oss.example.com/doc/0_2.png?sign=...",
        "bbox": [
          0.16,
          0.18,
          0.37,
          0.2,
          0.9
        ],
        "page": 0,
        "type": "figure",
        "content": "null"
      }
    ],
    "file_type": "png",
    "total_pages": 1
  },
  "status": true,
  "error_msg": "success",
  "error_code": 0
}

Error Codes

List of possible error codes returned by this endpoint

Business Errors

Error CodeDescription
68300004Invalid parameter!
68300005Search api failure!
68300006Analytic basic access error!
68300007Bad request!
68300008Service error, please try again later!
68300010The file does not comply with upload specifications!

Platform Errors

Error CodeDescription
67200000API call exceeds the total limit set by the platform!
67200001API call exceeds the total limit set by the platform!
67200002The current call rate is too fast, exceeding the current configuration limit QPS!
67200003The key and secret parameters for applying for the token are incorrect or the client has been disabled!
67200004The requested api does not have permission. Please contact our support personnel!
67200005Insufficient account balance/number of calls!
67200006The client has exceeded the activation validity period!
67200007The current call exceeds the configured usage limit of the day!
67200008Please check if the required apikey in the query parameter has been transmitted!
67200009The apikey does not match the passed bearerToken. Please check if a valid token is being used!
67200012The request is illegal!
67200100The current server status is busy, request response timeout!
67200101The API requested currently does not exist. Please check the request path!

HTTP Status Codes

Status CodeDescription
0Success
400Invalid request, missing file, empty file, or unsupported file format
413File exceeds 20 MB or the document exceeds 200 pages
500Internal server error; error_code is INTERNAL_ERROR
502Downstream processing failed; error_code may be OCR_FAILED, LAYOUT_DETECTION_FAILED, PDF_PARSE_FAILED, or DOCUMENT_CONVERSION_FAILED
504Request processing exceeded 300 seconds; error_code is GATEWAY_TIMEOUT

Performance Metrics

Expected performance characteristics for this endpoint

Normal Response Time

5000 ms

Max Response Time

10000 ms