{"id":15069131,"url":"https://github.com/mindee/mindee-api-java","last_synced_at":"2025-04-10T16:51:55.225Z","repository":{"id":52340253,"uuid":"459186979","full_name":"mindee/mindee-api-java","owner":"mindee","description":"Mindee API Helper Library for Java","archived":false,"fork":false,"pushed_at":"2025-04-08T09:51:19.000Z","size":15363,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T10:35:45.546Z","etag":null,"topics":["api-client","java-11","java-8","ocr","ocr-api"],"latest_commit_sha":null,"homepage":"https://mindee.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mindee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-14T14:06:18.000Z","updated_at":"2025-03-28T15:14:53.000Z","dependencies_parsed_at":"2024-01-29T17:02:24.900Z","dependency_job_id":"3d152572-1dd2-4550-b0c3-ca7643f5e55f","html_url":"https://github.com/mindee/mindee-api-java","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindee%2Fmindee-api-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindee%2Fmindee-api-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindee%2Fmindee-api-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindee%2Fmindee-api-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mindee","download_url":"https://codeload.github.com/mindee/mindee-api-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248256104,"owners_count":21073462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","java-11","java-8","ocr","ocr-api"],"created_at":"2024-09-25T01:40:38.725Z","updated_at":"2025-04-10T16:51:55.212Z","avatar_url":"https://github.com/mindee.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: MIT](https://img.shields.io/github/license/mindee/mindee-api-java)](https://opensource.org/licenses/MIT) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/mindee/mindee-api-java/push-main-branch.yml)](https://github.com/mindee/mindee-api-java) [![Version](https://img.shields.io/maven-central/v/com.mindee.sdk/mindee-api-java)](https://mvnrepository.com/artifact/com.mindee.sdk/mindee-api-java)\n\n# Mindee Client Library for Java\nQuickly and easily connect to Mindee's API services using Java.\n\n## Quick Start\nHere's the TL;DR of getting started.\n\nFirst, get an [API Key](https://developers.mindee.com/docs/create-api-key)\n\nInclude the following maven dependency in your project to use the helper library:\n```xml\n\u003cdependency\u003e\n  \u003cartifactId\u003emindee-api-java\u003c/artifactId\u003e\n  \u003cgroupId\u003ecom.mindee.sdk\u003c/groupId\u003e\n  \u003cversion\u003e${mindee.sdk.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nWhere `${mindee.sdk.version}` is the version shown here:\n\n![Version](https://img.shields.io/maven-central/v/com.mindee.sdk/mindee-api-java)\n\n\n## Loading a File and Parsing It\nThe `MindeeClient` class is the entry point for most of the helper library features.\n\n## Synchronously Parsing a File\nThis is the easiest and fastest way to integrate into the Mindee API.\n\nHowever, not all products are available in synchronous mode.\n\n### Global Documents\nThese classes are available in the `com.mindee.product` package:\n\n```java\nimport com.mindee.MindeeClient;\nimport com.mindee.input.LocalInputSource;\nimport com.mindee.parsing.common.PredictResponse;\nimport com.mindee.product.invoice.InvoiceV4;\nimport java.io.File;\nimport java.io.IOException;\n\npublic class SimpleMindeeClient {\n  public static void main(String[] args) throws IOException {\n\n    // Init a new client\n    MindeeClient mindeeClient = new MindeeClient(\"my-api-key\");\n\n    // Load a file from disk\n    LocalInputSource localInputSource = new LocalInputSource(\n        \"/path/to/the/file.ext\"\n    );\n    // Parse the file\n    Document\u003cInvoiceV4\u003e response = mindeeClient.parse(\n        InvoiceV4.class,\n        localInputSource\n    );\n    // Print a summary of the parsed data\n    System.out.println(response.getDocument().toString());\n  }\n}\n```\n\n**Note for Region-Specific Documents:**\n\nEach region will have its own package within the general `com.mindee.product` package.\n\nFor example USA-specific classes will be in the `com.mindee.product.us` package:\n```java\nimport com.mindee.product.us.bankcheck.BankCheckV1;\n```\n\n### Custom Documents (docTI \u0026 Custom APIs)\n```java\nimport com.mindee.MindeeClient;\nimport com.mindee.input.LocalInputSource;\nimport com.mindee.parsing.common.PredictResponse;\nimport com.mindee.product.generated.GeneratedV1;\nimport com.mindee.http.Endpoint;\nimport java.io.File;\nimport java.io.IOException;\n\npublic class SimpleMindeeClient {\n  public static void main(String[] args) throws IOException {\n\n    // Init a new client\n    MindeeClient mindeeClient = new MindeeClient(\"my-api-key\");\n    \n    // Init the endpoint for the custom document\n    Endpoint endpoint = new Endpoint(\"my-endpoint\", \"my-account\");\n\n    // Load a file from disk\n    LocalInputSource localInputSource = new LocalInputSource(\n        \"src/main/resources/invoices/invoice1.pdf\"\n    );\n    // Parse the file\n    Document\u003cGeneratedV1\u003e customDocument = mindeeClient.enqueueAndParse(\n        localInputSource,\n        endpoint\n    );\n  }\n}\n```\n\n## Asynchronously Parsing a File\nThis allows for easier handling of bursts of documents sent.\n\nSome products are only available asynchronously, check the example code\ndirectly on the Mindee platform.\n\n### Enqueue and Parse a File\nThe client library will take care of handling the polling requests for you.\n\nThis is the easiest way to get started.\n\n```java\nimport com.mindee.MindeeClient;\nimport com.mindee.input.LocalInputSource;\nimport com.mindee.parsing.common.AsyncPredictResponse;\nimport com.mindee.product.internationalid.InternationalIdV2;\nimport java.io.File;\nimport java.io.IOException;\n\npublic class SimpleMindeeClient {\n\n  public static void main(String[] args) throws IOException, InterruptedException {\n    String apiKey = \"my-api-key\";\n    String filePath = \"/path/to/the/file.ext\";\n\n    // Init a new client\n    MindeeClient mindeeClient = new MindeeClient(apiKey);\n\n    // Load a file from disk\n    LocalInputSource inputSource = new LocalInputSource(new File(filePath));\n\n    // Parse the file asynchronously\n    AsyncPredictResponse\u003cInternationalIdV2\u003e response = mindeeClient.enqueueAndParse(\n        InternationalIdV2.class,\n        inputSource\n    );\n\n    // Print a summary of the response\n    System.out.println(response.toString());\n  }\n}\n```\n\n### Enqueue and Parse a Webhook Response\nThis is an optional way of handling asynchronous APIs.\n\n```java\nimport com.mindee.MindeeClient;\nimport com.mindee.input.LocalInputSource;\nimport com.mindee.input.LocalResponse;\nimport com.mindee.input.WebhookSource;\nimport com.mindee.product.internationalid.InternationalIdV2;\nimport java.io.IOException;\n\npublic class SimpleMindeeClient {\n  public static void main(String[] args) throws IOException {\n\n    // Init a new client\n    MindeeClient mindeeClient = new MindeeClient(\"my-api-key\");\n\n    // Load a file from disk\n    LocalInputSource localInputSource = new LocalInputSource(\n      \"/path/to/the/file.ext\"\n    );\n    // Enqueue the file\n    String jobId = client.enqueue(InternationalIdV2.class, localInputSource)\n      .getJob().getId();\n\n    // Load the JSON string sent by the Mindee webhook POST callback.\n    //\n    // Reading the callback data will vary greatly depending on your HTTP server.\n    // This is therefore beyond the scope of this example.\n    String jsonData = myHttpServer.getPostBodyAsString();\n    LocalResponse localResponse = new LocalResponse(jsonData);\n\n    // Verify the HMAC signature.\n    // You'll need to get the \"X-Mindee-Hmac-Signature\" custom HTTP header.\n    String hmacSignature = myHttpServer.getHeader(\"X-Mindee-Hmac-Signature\");\n    boolean isValid = localResponse.isValidHmacSignature(\n        \"obviously-fake-secret-key\", hmacSignature\n    );\n    if (!isValid) {\n      throw new MyException(\"Bad HMAC signature! Is someone trying to do evil?\");\n    }\n\n    // You can also use a File object as the input.\n    //LocalResponse localResponse = new LocalResponse(new File(\"/path/to/file.json\"));\n\n    // Deserialize the response into Java objects\n    AsyncPredictResponse\u003cInternationalIdV2\u003e response = mindeeClient.loadPrediction(\n      InternationalIdV2.class,\n      localResponse\n    );\n\n    // Print a summary of the parsed data\n    System.out.println(response.getDocument().toString());\n  }\n}\n```\n\n\n## Further Reading\nComplete details on the working of the library are available in the following guides:\n\n* [Getting started](https://developers.mindee.com/docs/java-ocr-getting-started)\n* [Java Generated APIs](https://developers.mindee.com/docs/java-generated-ocr)\n* [Java Custom APIs (API Builder - Deprecated)](https://developers.mindee.com/docs/java-api-builder)\n* [Java Invoice OCR](https://developers.mindee.com/docs/java-invoice-ocr)\n* [Java Receipt OCR](https://developers.mindee.com/docs/java-receipt-ocr)\n* [Java Financial Document OCR](https://developers.mindee.com/docs/java-financial-document-ocr)\n* [Java Passport OCR](https://developers.mindee.com/docs/java-passport-ocr)\n* [Java Resume OCR](https://developers.mindee.com/docs/java-resume-ocr)\n* [Java International Id OCR](https://developers.mindee.com/docs/java-international-id-ocr)\n* [Java FR Bank Account Detail OCR](https://developers.mindee.com/docs/java-fr-bank-account-details-ocr)\n* [Java FR Carte Grise OCR](https://developers.mindee.com/docs/java-fr-carte-grise-ocr)\n* [Java FR Health Card OCR](https://developers.mindee.com/docs/java-fr-health-card-ocr)\n* [Java FR ID Card OCR](https://developers.mindee.com/docs/java-fr-carte-nationale-didentite-ocr)\n* [Java US Bank Check OCR](https://developers.mindee.com/docs/java-us-bank-check-ocr)\n* [Java Barcode Reader API](https://developers.mindee.com/docs/java-barcode-reader-ocr)\n* [Java Cropper API](https://developers.mindee.com/docs/java-cropper-ocr)\n* [Java Invoice Splitter API](https://developers.mindee.com/docs/java-invoice-splitter-ocr)\n* [Java Multi Receipts Detector API](https://developers.mindee.com/docs/java-multi-receipts-detector-ocr)\n\nYou can view the source code on [GitHub](https://github.com/mindee/mindee-api-java).\n\nYou can also take a look at the\n**[Reference Documentation](https://mindee.github.io/mindee-api-java/)**.\n\n## License\nCopyright © Mindee\n\nAvailable as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n\n## Questions?\n[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindee%2Fmindee-api-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmindee%2Fmindee-api-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindee%2Fmindee-api-java/lists"}