Extract Cmr with Ruby Gem — OCR Document Extraction

Learn how to extract Cmr data programmatically using Ruby Gem — OCR Document Extraction. Step-by-step tutorial to extract structured data from CMR international consignment notes. Includes code, field mapping, and API integration.

Why Extract Cmr with Ruby

Logistics companies process thousands of Cmr documents monthly. Using Ruby to automate Cmr data extraction eliminates manual entry, reduces errors, and speeds up document processing from minutes to seconds. With the Cargoffer OCR API, you can integrate Cmr extraction into any Ruby application in under 10 lines of code.

Setting Up the Ruby Client

First, get your free API key from the dashboard. Then install the HTTP client for Ruby and configure authentication. The API uses Bearer token auth — pass your key in the Authorization header.

Uploading a Cmr Document

Use the POST /api/upload endpoint to send the document file. The system auto-detects Cmr format and routes it to the best extraction model. Upload in PDF, image, or Excel format.

Extracted Data Fields

Upload your CMR (PDF or photo). System auto-detects document type and selects the best model. Handwritten CMRs use Gemini native PDF vision.

Ruby Code Example

The complete Ruby integration code handles file upload, extraction request, polling for results, and error management. Error types: 401 (invalid key), 402 (quota exceeded — upgrade your plan), 429 (rate limit — wait and retry), 422 (malformed request).

Pricing & Volume

Each Cmr extraction costs from 0.002 EUR per page. The free plan includes 1 page. The Pro plan (49 EUR/month) covers 1,000 pages — enough for 500000 Cmr documents. Manual Cmr data entry costs 3-15 EUR per document — OCR saves 99%.

Related Integrations

See also: [Cmr with Python](https://ocr.cargoffer.com/tutorials/documents/cmr-extraction/integration/python) | [Cmr with JavaScript](https://ocr.cargoffer.com/tutorials/documents/cmr-extraction/integration/javascript) | [Cmr with Java](https://ocr.cargoffer.com/tutorials/documents/cmr-extraction/integration/java) | [Cmr via REST API](https://ocr.cargoffer.com/tutorials/documents/cmr-extraction)

Ready to try it?

Start Free →