Carte Vitale - FRANCE OCR

Mindee’s Carte Vitale - FRANCE API uses deep learning to automatically, accurately, and instantaneously parse your card details. In under a second, the API extracts a set of data from your PDFs or photos of Carte Vitale, including:

  • Given Name(s)

  • Surname

  • Social Security Number

  • Issuance Date

The Carte Vitale - France API supports the new and old format for all people in France. The cards of other nationalities and states are not supported with this model.

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 french carte vitale. You can use one of the sample documents provided below.

  2. Access your API by clicking on the Carte Vitale - FRANCE 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 document 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/french_healthcard/v1/documents/1ec5aff1-ef20-4744-bf7e-fe03464192f3"
  },
  "document": {
    "id": "1ec5aff1-ef20-4744-bf7e-fe03464192f3",
    "inference": {
      "extras": {},
      "finished_at": "2024-10-28T10:07:18.627000",
      "is_rotation_applied": true,
      "pages": [
        {
          "extras": {},
          "id": 0,
          "orientation": {
            "value": 0
          },
          "prediction": {}
        }
      ],
      "prediction": { ... },
      "processing_time": 2.084,
      "product": {
        "features": [
          "given_names",
          "surname",
          "social_security",
          "issuance_date"
        ],
        "name": "mindee/french_healthcard",
        "type": "standard",
        "version": "1.0"
      },
      "started_at": "2024-10-28T10:07:16.391000"
    },
    "n_pages": 1,
    "name": "CarteVitale2 (1).jpg"
  },
  "job": {
    "available_at": "2024-10-28T10:07:18.636000",
    "error": {},
    "id": "097af697-b4dc-4a4a-9374-9e64fb009b01",
    "issued_at": "2024-10-28T10:07:16.391000",
    "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.

Each predicted field may contain one or several values:

  • a polygon highlighting the information location

  • a page_id where the information was found (document level only)

{
  "api_request": { ... },
  "document": {
       ...
      "prediction": {
        "given_names": [
          {
            "page_id": 0,
            "polygon": [
              [
                0.282,
                0.671
              ],
              [
                0.441,
                0.671
              ],
              [
                0.441,
                0.709
              ],
              [
                0.282,
                0.709
              ]
            ],
            "value": "NATHALIE"
          }
        ],
        "issuance_date": {
          "page_id": 0,
          "polygon": [
            [
              0.443,
              0.438
            ],
            [
              0.605,
              0.438
            ],
            [
              0.605,
              0.475
            ],
            [
              0.443,
              0.475
            ]
          ],
          "value": "2007-01-01"
        },
        "social_security": {
          "page_id": 0,
          "polygon": [
            [
              0.282,
              0.838
            ],
            [
              0.616,
              0.838
            ],
            [
              0.616,
              0.873
            ],
            [
              0.282,
              0.873
            ]
          ],
          "value": "2 69 05 49 588 157 80"
        },
        "surname": {
          "page_id": 0,
          "polygon": [
            [
              0.284,
              0.727
            ],
            [
              0.422,
              0.727
            ],
            [
              0.422,
              0.766
            ],
            [
              0.284,
              0.766
            ]
          ],
          "value": "DURAND"
        }
      },
...

  }
}

Detailed Field Information

Depending on the field type specified, additional attributes can be extracted from the Carte Vitale -FRANCE card object. Using the above example the following are the basic fields that can be extracted.

Given Name(s)

  • given_names: The given names of the card holder.

{
  "given_names": [
    {
      "page_id": 0,
      "polygon": [[0.282,0.671],[0.441,0.671],[0.441,0.709],[0.282,0.709]],
      "value": "NATHALIE"
    }
  ]
}

Surname

  • surname: The surname of the card holder.

{
  "surname": {
    "page_id": 0,
    "polygon": [[0.284,0.727],[0.422,0.727],[0.422,0.766],[0.284,0.766]],
    "value": "DURAND"
  }
}

Social Security Number

  • social_security: The social security number of the card holder.

{
  "social_security": {
    "page_id": 0,
    "polygon": [[0.282,0.838],[0.616,0.838],[0.616,0.873],[0.282,0.873]],
    "value": "2 69 05 49 588 157 80"
  }
}

Issuance Date

  • issuance_date: The date when the carte vitale was issued.

{
  "issuance_date": {
    "page_id": 0,
    "polygon": [[0.443,0.438],[0.605,0.438],[0.605,
        0.475
      ],
      [
        0.443,
        0.475
      ]
    ],
    "value": "2007-01-01"
  }
}

Last updated

Was this helpful?