{"id":39033948,"url":"https://github.com/altafino/mindee-client","last_synced_at":"2026-01-17T17:42:39.378Z","repository":{"id":163319032,"uuid":"637648836","full_name":"altafino/mindee-client","owner":"altafino","description":"A simple Golang client for the Mindee API, allowing you to extract invoice data from JPEG, PNG, WEBP, HEIC, TIFF image or PDF files.","archived":false,"fork":false,"pushed_at":"2025-12-18T06:36:15.000Z","size":33,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-21T15:04:55.369Z","etag":null,"topics":["go","golang","mindee","ocr"],"latest_commit_sha":null,"homepage":"https://altafino.com","language":"Go","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/altafino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-08T05:52:21.000Z","updated_at":"2025-12-19T13:50:52.000Z","dependencies_parsed_at":"2024-09-10T06:42:48.882Z","dependency_job_id":"bd638b74-9152-413e-928f-f3ab43d3400c","html_url":"https://github.com/altafino/mindee-client","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/altafino/mindee-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altafino%2Fmindee-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altafino%2Fmindee-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altafino%2Fmindee-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altafino%2Fmindee-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/altafino","download_url":"https://codeload.github.com/altafino/mindee-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altafino%2Fmindee-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28513972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","golang","mindee","ocr"],"created_at":"2026-01-17T17:42:39.278Z","updated_at":"2026-01-17T17:42:39.364Z","avatar_url":"https://github.com/altafino.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mindee Invoice API Go Client\n\nA Golang client for the Mindee API, supporting both V1 (legacy) and V2 APIs for extracting invoice data from JPEG, PNG, WEBP, HEIC, TIFF image or PDF files.\n\n## Installation\n\nTo use this library in your Go project, run the following command:\n\n```bash\ngo get github.com/altafino/mindee-client\n```\n\n## API Versions\n\nThis library supports both Mindee API V1 and V2:\n\n### V1 API (Legacy)\n- **Status**: Maintained for backward compatibility\n- **Endpoint**: `api.mindee.net/v1/...`\n- **Processing**: Synchronous\n- **Free tier**: Ends September 15, 2025\n- **Use case**: Existing integrations, simple synchronous workflows\n\n### V2 API (Recommended)\n- **Status**: Current, actively developed\n- **Endpoint**: `api-v2.mindee.net/v2/...`\n- **Processing**: Asynchronous with polling\n- **Features**: Advanced AI, custom models, RAG support, webhooks\n- **Use case**: New integrations, advanced features, custom models\n\n**Note**: V1 and V2 use different API keys and are not interchangeable.\n\n## Usage\n\nImport the `mindee-client` library in your Go code:\n\n```go\nimport \"github.com/altafino/mindee-client\"\n```\n\n### V1 API Usage (Legacy)\n\nV1 provides simple synchronous methods:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"os\"\n    mindee_client \"github.com/altafino/mindee-client\"\n    \"github.com/joho/godotenv\"\n)\n\nfunc main() {\n    // Load .env file (API_KEY and TEST_FILE_PATH)\n    if err := godotenv.Load(); err != nil {\n        log.Fatalf(\"Error loading .env file: %v\", err)\n    }\n\n    apiKey := os.Getenv(\"API_KEY\")\n    filePath := os.Getenv(\"TEST_FILE_PATH\")\n\n    // V1 API - Synchronous\n    data, err := mindee_client.GetInvoiceDataForFilePath(filePath, apiKey)\n    if err != nil {\n        log.Fatalf(\"Error: %v\", err)\n    }\n\n    fmt.Printf(\"Invoice data: %+v\\n\", data)\n}\n```\n\n**V1 Methods:**\n- `GetInvoiceDataForFilePath(filePath, apiKey string) (*models.InvoiceData, error)`\n- `GetInvoiceDataForBase64(base64Content, apiKey string) (*models.InvoiceData, error)`\n\n### V2 API Usage (Recommended)\n\nV2 requires a model ID and uses asynchronous processing:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"os\"\n    mindee_client \"github.com/altafino/mindee-client\"\n    \"github.com/joho/godotenv\"\n)\n\nfunc main() {\n    // Load .env file\n    if err := godotenv.Load(); err != nil {\n        log.Fatalf(\"Error loading .env file: %v\", err)\n    }\n\n    // V2 API requires a config with API key and model ID\n    config := mindee_client.V2Config{\n        APIKey:  os.Getenv(\"API_KEY_V2\"),\n        ModelID: os.Getenv(\"MODEL_ID\"), // Get from Mindee dashboard\n    }\n\n    filePath := os.Getenv(\"TEST_FILE_PATH\")\n\n    // V2 API - Asynchronous with polling\n    data, err := mindee_client.GetInvoiceDataForFilePathV2(filePath, config)\n    if err != nil {\n        log.Fatalf(\"Error: %v\", err)\n    }\n\n    fmt.Printf(\"Invoice data: %+v\\n\", data)\n}\n```\n\n**V2 Methods:**\n- `GetInvoiceDataForFilePathV2(filePath string, config V2Config) (*models.InvoiceData, error)`\n- `GetInvoiceDataForBase64V2(base64Content string, config V2Config) (*models.InvoiceData, error)`\n\n**Important Note on V2 Response Mapping:**\nThe V2 API returns data in a structure that depends on your custom model configuration. The current implementation provides the V2 API infrastructure (authentication, enqueuing, polling) but does not automatically map V2 response fields to the V1 `InvoiceData` structure. You may need to:\n1. Modify `convertV2ToV1Format()` in `client_v2.go` to map your specific model's fields\n2. Or access the raw V2 response data directly by modifying the return type\n3. Or create a new response model that matches your V2 model's schema\n\n### Getting Your V2 Model ID\n\n1. Log in to your [Mindee account](https://platform.mindee.com/)\n2. Navigate to the Models section\n3. Select or create an Invoice model\n4. Copy the Model ID from the model details\n\n### Environment Variables\n\nCreate a `.env` file with the following variables:\n\nFor V1:\n```\nAPI_KEY=your_v1_api_key_here\nTEST_FILE_PATH=/path/to/your/test/invoice.pdf\n```\n\nFor V2:\n```\nAPI_KEY_V2=your_v2_api_key_here\nMODEL_ID=your_model_id_here\nTEST_FILE_PATH=/path/to/your/test/invoice.pdf\n```\n\n### Example Project\nSample app demonstrating usage: https://github.com/altafino/testpdf\n\n## Migration Guide: V1 to V2\n\nIf you're currently using V1 and want to migrate to V2, follow these steps:\n\n### 1. Get V2 API Credentials\n- Create a new API key in the [Mindee V2 platform](https://platform.mindee.com/)\n- V1 API keys do not work with V2\n\n### 2. Create or Select a Model\n- In the Mindee dashboard, create a custom invoice model or use a pre-configured one\n- Note your Model ID (required for all V2 API calls)\n\n### 3. Update Your Code\n\n**Before (V1):**\n```go\ndata, err := mindee_client.GetInvoiceDataForFilePath(filePath, apiKey)\n```\n\n**After (V2):**\n```go\nconfig := mindee_client.V2Config{\n    APIKey:  apiKeyV2,\n    ModelID: modelID,\n}\ndata, err := mindee_client.GetInvoiceDataForFilePathV2(filePath, config)\n```\n\n### 4. Key Differences\n\n| Feature | V1 | V2 |\n|---------|----|----|\n| **Processing** | Synchronous | Asynchronous (with polling) |\n| **API Keys** | V1 keys | V2 keys (separate) |\n| **Model** | Pre-defined | Custom or pre-configured |\n| **Response Time** | Immediate | 3-5 seconds (with polling) |\n| **Customization** | Limited | Fully customizable models |\n| **Features** | Basic extraction | RAG, webhooks, advanced AI |\n\n### 5. Testing\nTest your integration thoroughly as V2 may have different response structures depending on your model configuration.\n\n## Testing\n\nTo run tests for this library, execute the following command in the root directory of the project:\n\n```bash\ngo test\n```\n\n## License\n\nThis library is released under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltafino%2Fmindee-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faltafino%2Fmindee-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltafino%2Fmindee-client/lists"}