Schnellstart für Entwickler

Eine Anfrage. Ein sauberes Dokument.

Senden Sie ein JPEG, PNG oder PDF an ScanKit und erhalten Sie einen perspektivisch korrigierten Scan für den nächsten Schritt in Ihrem Produkt. Entdecken Sie Anfrage, Antwort und Code unten.

SCAN-ANFRAGEBereit
POST /scan/crop
EingabeJPEG, PNG, PDF
AusgabeSauberes JPG oder PDF
VerarbeitungErkennen + korrigieren
API AUSPROBIEREN

Testen Sie ScanKit mit Ihrem Dokument.

Laden Sie ein JPEG, PNG oder PDF hoch, wählen Sie die gewünschte Ausgabe und sehen Sie direkt, welchen sauberen Scan ScanKit zurückgibt.

Input Image

Result

War diese Information hilfreich?
Beispielcode

Fertige Code-Snippets

Integrieren Sie Scan-Funktionen mit einem einfachen API-Aufruf in Ihre Anwendung. Die ScanKit-API unterstützt verschiedene Parameter für präzise Kontrolle über das Ergebnis.

JPEG-Bild
curl -X POST https://api.scankit.io/scan/crop \
-H "Authorization: Bearer YOUR_API_KEY" \

-H "Content-Type: multipart/form-data" \

-F "file=@/path/to/your/image.jpg" \

-F "output_width=1536" \

-F "filter=white" \

--output result.jpg
PDF mit OCR-Text
curl -X POST https://api.scankit.io/scan/crop \
-H "Authorization: Bearer YOUR_API_KEY" \

-H "Content-Type: multipart/form-data" \

-F "file=@/path/to/your/image.jpg" \

-F "output_width=1536" \

-F "return_pdf=true" \

-F "ocr_lang=eng" \

--output result.pdf
Mehrseitiges PDF (französisch)
curl -X POST https://api.scankit.io/scan/crop \
-H "Authorization: Bearer YOUR_API_KEY" \

-H "Content-Type: multipart/form-data" \

-F "files=@/path/to/page1.jpg" \

-F "files=@/path/to/page2.jpg" \

-F "output_width=1536" \

-F "filter=white" \

-F "return_pdf=true" \

-F "ocr_lang=fra" \

--output result.pdf
Reference

API Reference

Servers

Document Scanning

Upload an image to be cropped and optionally filtered. The result is returned as a binary JPEG file.

Parameters

No parameters

Request body

file *
string($binary)

The image file to process.

output_width
integer($int32)

Specifies the desired width (in pixels) of the output image after cropping.

  • The output height is calculated automatically to preserve the aspect ratio of the cropped document.
  • The aspect ratio is determined by the shape of the document after cropping, which depends on the detected content and cannot be predicted in advance.
  • The default value is 1536 pixels, and a typical recommended range is between 1024 and 2048 pixels for optimal quality and performance.
filter
string

Specifies the filter applied to the image after cropping:

  • "white" (default): Corrects irregular lighting and produces a plain white background for white paper documents.
  • "flat": Corrects irregular lighting but does not change contrast or colors.
  • "original": No filter applied, the image remains unmodified.
segment_count
integer($int32)

Specifies the number of segments used to process curved or folded images.

  • Higher values provide better handling of heavily curved or folded documents but may increase processing time.
  • Lower values are faster but may not handle severe curves as well.
  • The default value is 9 segments, which provides a good balance between quality and performance.
return_pdf
boolean

Determines the output format of the processed document:

  • false (default): Returns the processed image as a JPEG file.
  • true: Creates a searchable PDF with an OCR text layer instead of returning a JPEG image.
ocr_lang
string

Language for OCR text recognition when return_pdf is true:

  • "eng" (default): English language OCR
  • "deu": German language OCR This parameter is only used when return_pdf is set to true.

Responses

CodeDescription
200

Successfully processed and cropped image returned as a binary file.

Media type
Controls Accept header.
(binary image data)
400

Invalid parameters or unprocessable input file (no credits charged)

Media type
Examples
{
  "errors": [
    {
      "code": "invalid_file_type",
      "title": "The uploaded file format is not supported. Please use JPEG or PNG."
    }
  ]
}
402

Error: Insufficient credits (no credits charged)

Media type
{
  "errors": [
    {
      "title": "Insufficient credits"
    }
  ]
}
403

Error: Authentication failed (no credits charged)

Media type
{
  "errors": [
    {
      "title": "Missing API Key"
    }
  ]
}
429

Error: Rate limit exceeded (no credits charged)

Media type
{
  "errors": [
    {
      "title": "Rate limit exceeded"
    }
  ]
}
500

Internal server error. Contact support if the issue persists.

War diese Information hilfreich?