Bill of Lading OCR

Mindee’s Bill Of Lading API uses deep learning to automatically, accurately, and instantaneously parse your documents details. In a few seconds, the API extracts a set of data from your PDFs or photos of Bill of Lading, including:

  • Bill of Lading Number

  • Shipper

  • Consignee

  • Notify Party

  • Carrier

  • Items

  • Port of Loading

  • Port of Discharge

  • Place of Delivery

  • Date of Issue

  • Departure Date

Set up the API

Create an API key

To begin using the Mindee V1 OCR API, your first step is to create your V1 API key.

  1. You'll need a Bill Of Lading. You can use one of the sample documents provided below.

  2. Access your Bill of Lading API by clicking on the corresponding product card in the Document Catalog

  3. From the left navigation, go to documentation > API Reference, you'll find sample code in popular languages and command line.

  • Replace my-api-key-here with your new API key, or use the select an API key feature and it will be filled automatically.

  • Copy and paste the sample code of your desired choice in your application, code environment, terminal etc.

  • Replace /path/to/the/file.ext with the path to your input document.

  1. Run your code. You will receive a JSON response with the Bill of Lading details.

API Response

Here is the full JSON response you get when you call the API:

{
    "api_request": {
        "error": {},
        "resources": [
            "document",
            "job"
        ],
        "status": "success",
        "status_code": 200,
        "url": "https://api.mindee.net/v1/products/mindee/bill_of_lading/v1/documents/.."
    },
    "document": {
        "id": "bae163d3-ea9c-4972-bd28-2a7598d3d424",
        "inference": {
            "extras": {},
            "finished_at": "2024-10-17T15:01:28.197000",
            "is_rotation_applied": true,
            "pages": [
                {
                    "extras": {},
                    "id": 0,
                    "orientation": {
                        "value": 0
                    },
                    "prediction": {}
                }
            ],
            "prediction": {..},
            "processing_time": 7.42,
            "product": {
                "features": [
                    "bill_of_lading_number",
                    "shipper",
                    "consignee",
                    "notify_party",
                    "carrier",
                    "carrier_items",
                    "port_of_loading",
                    "port_of_discharge",
                    "place_of_delivery",
                    "date_of_issue",
                    "departure_date"
                ],
                "name": "mindee/bill_of_lading",
                "type": "standard",
                "version": "1.1"
            },
            "started_at": "2024-10-17T15:01:20.640000"
        },
        "n_pages": 1,
        "name": "Bill_of_lading_sample.jpg"
    },
    "job": {
        "available_at": "2024-10-17T15:01:28.208000",
        "error": {},
        "id": "8ae70ce3-ef4f-44dc-af7c-738b54e44423",
        "issued_at": "2024-10-17T15:01:20.640000",
        "status": "completed"
    }
}

You can find the prediction within the prediction key found in document > inference > prediction for document-level predictions: it contains the different fields extracted at the document level, meaning that for multi-pages PDFs, we reconstruct a single object using all the pages.


    "document": {
				    ...
            "prediction": {
                "bill_of_lading_number": {
                    "value": "XYZ123456"
                },
                "carrier": {
                    "name": "GLOBAL SHIPPING CO",
                    "professional_number": null,
                    "scac": null
                },
                "carrier_items": [
                    {
                        "description": "ELECTRONIC COMPONENTS\nP/N: 12345\nDRAWING NO. A1B2C3\nP/O: 987654\nLOT NO. 112233\nMADE IN CHINA",
                        "gross_weight": 500.0,
                        "measurement": 1.5,
                        "measurement_unit": "cbm",
                        "quantity": 50.0,
                        "weight_unit": "kgs"
                    }
                ],
                "consignee": {
                    "address": "789 TRADE STREET, SINGAPORE 567890, SINGAPORE",
                    "email": null,
                    "name": "PACIFIC TRADING CO.",
                    "phone": "65-65432100"
                },
                "date_of_issue": {
                    "value": "2022-09-30"
                },
                "departure_date": {
                    "value": null
                },
                "notify_party": {
                    "address": "789 TRADE STREET, SINGAPORE 567890, SINGAPORE",
                    "email": null,
                    "name": "PACIFIC TRADING CO.",
                    "phone": "65-65432100"
                },
                "place_of_delivery": {
                    "value": "456 SHIPPING LANE, LOS ANGELES, CA 90001, USA"
                },
                "port_of_discharge": {
                    "value": "LOS ANGELES, USA"
                },
                "port_of_loading": {
                    "value": "SHANGHAI, CHINA"
                },
                "shipper": {
                    "address": "123 OCEAN DRIVE, SHANGHAI, CHINA",
                    "email": null,
                    "name": "GLOBAL FREIGHT SOLUTIONS INC.",
                    "phone": "86-21-12345678"
                }
            },
            "processing_time": 7.42,
            "product": {
                "features": [
                    "bill_of_lading_number",
                    "shipper",
                    "consignee",
                    "notify_party",
                    "carrier",
                    "carrier_items",
                    "port_of_loading",
                    "port_of_discharge",
                    "place_of_delivery",
                    "date_of_issue",
                    "departure_date"
                ],
                "name": "mindee/bill_of_lading",
                "type": "standard",
                "version": "1.1"
            },
            "started_at": "2024-10-17T15:01:20.640000"
        },
        "n_pages": 1,
        "name": "Bill_of_lading_sample.jpg"
    },
    "job": {
        "available_at": "2024-10-17T15:01:28.208000",
        "error": {},
        "id": "8ae70ce3-ef4f-44dc-af7c-738b54e44423",
        "issued_at": "2024-10-17T15:01:20.640000",
        "status": "completed"
    }
}

Detailed Field Information

Using the above Bill of Lading example the following are the basic fields that can be extracted.

Bill of Lading Number

  • bill_of_lading_number: Unique identifier assigned to a Bill of Lading.

{
  "bill_of_lading_number": {
    "value": "XYZ123456"
  }
}

Shipper

  • Shipper: The party responsible for shipping the goods.

    • name: The name of the shipper.

    • address: The address of the shipper.

    • phone: the phone number of the shipper.

    • email: the email address of the shipper.

{
  "shipper": {
    "address": "123 OCEAN DRIVE, SHANGHAI, CHINA",
    "email": null,
    "name": "GLOBAL FREIGHT SOLUTIONS INC.",
    "phone": "86-21-12345678"
  }
}

Consignee

  • consignee: The party to whom the goods are being shipped.

    • name: The name of the consignee.

    • address: The address of the consignee.

    • phone: the phone number of the consignee.

    • email: the email address of the consignee.

{
  "consignee": {
    "address": "789 TRADE STREET, SINGAPORE 567890, SINGAPORE",
    "email": null,
    "name": "PACIFIC TRADING CO.",
    "phone": "65-65432100"
  }
}

Notify Party

  • notify_party: The party to be notified of the arrivals of the goods.

    • name: The name of the notify party.

    • address: The address of the notify party.

    • phone: the phone number of the notify party.

    • email: the email address of the notify party.

{
  "notify_party": {
    "address": "789 TRADE STREET, SINGAPORE 567890, SINGAPORE",
    "email": null,
    "name": "PACIFIC TRADING CO.",
    "phone": "65-65432100"
  }
}

Carrier

  • carrier: The shipping company responsible for the transport of the good.

    • name: The name of the carrier.

    • professional_number: The professional number of the carrier.

    • scac: The Standard Carrier Alpha Code (SCAC) of the carrier.

{
  "carrier": {
    "name": "GLOBAL SHIPPING CO",
    "professional_number": null,
    "scac": null
  }
}

Items

  • carrier_items: The goods being shipped.

    • description: A description of the item.

    • quantity: The quantity of the item being shipped.

    • gross_weight: The gross weight of the item.

    • weight_unit: The unit of measurement for weights.

    • measurement: The measurement of the item.

    • measurement_unit: The unit of measurement for the measurement.

{
  "carrier_items": [
    {
      "description": "ELECTRONIC COMPONENTS\nP/N: 12345\nDRAWING NO. A1B2C3\nP/O: 987654\nLOT NO. 112233\nMADE IN CHINA",
      "gross_weight": 500,
      "measurement": 1.5,
      "measurement_unit": "cbm",
      "quantity": 50,
      "weight_unit": "kgs"
    }
  ]
}

Port of loading

  • port_of_loading: The port where the goods are loaded on the vessel.

{
  "port_of_loading": {
    "value": "SHANGHAI, CHINA"
  }
}

Port of Discharge

  • port_of_discharge: The port where the goods are unloaded on the vessel.

{
  "port_of_discharge": {
    "value": "LOS ANGELES, USA"
  }
}

Place of Delivery

  • place_of_delivery: The place where the goods are to be delivered.

{
  "place_of_delivery": {
    "value": "456 SHIPPING LANE, LOS ANGELES, CA 90001, USA"
  }
}

Date of Issue

  • date_of_issue: The date when the bill lading is issued.

{
  "date_of_issue": {
    "value": "2022-09-30"
  }
}

Departure Date

  • departure_date: The date when the vessel departs from the port of loading.

{
  "departure_date": {
    "value": null
  }
}

Last updated

Was this helpful?