Japan My Number card OCR: Extract Fields with Python

Extract visible fields from Japan my number card images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.

Japan document intake: what needs review

The reverse can contain a personal number; collect only the side and fields required for the stated workflow, and keep face-side identity extraction separate. In a production intake, keep the uploaded document associated with the correct application record before extraction. A legible name alone does not establish that the number, dates and address were captured correctly. Avoid filling missing values from a previous booking or a customer profile without recording that separate source.

Map Japan document evidence into your backend

Check the printed document type before assigning its number to an identity record. Submit a readable side at a time and keep the side association in your application. A field absent from the submitted side should remain unfilled until supported by another source. Send the image to the national id API and keep extracted evidence separate from your approval decision. The same endpoint handles the submitted image; the article's country or state context does not force the API to return that jurisdiction. Compare the returned country with the source before saving the result.

A reviewable intake workflow

  • Japan document intake: The reverse can contain a personal number; collect only the side and fields required for the stated workflow, and keep face-side identity extraction separate.
  • Map fields without losing their meaning: Store document_number as text, keep surname and given_names in their own fields, and retain source images according to your document-handling policy. Date parsing failures should be reviewable instead of becoming today's date.
  • Compare a resubmitted document: Keep a prior extraction and a new extraction as separate events. A change in number, name or expiry should produce a review item, not an automatic overwrite of a trusted record.
  • Export only the fields your workflow uses: Map the response to your form explicitly. Keep the document number separate from any supported personal identifier.
Need more testing? Create a free account to get 200 free credits (equals 100 National ID scans).

Python request for Japan my number card OCR

This REST example sends a local image as Base64 JSON. Run it on a backend and keep the API key in an environment variable. The printed example below is deliberately synthetic and is not a valid document-number format specimen.

Prerequisite: Python 3, pip install requests; STRUCTOCR_API_KEY set on the server

import base64
import os
import requests

with open("japan-national-id.jpg", "rb") as source:
    encoded = base64.b64encode(source.read()).decode("ascii")

response = requests.post(
    "https://api.structocr.com/v1/national-id",
    headers={"x-api-key": os.environ["STRUCTOCR_API_KEY"]},
    json={"img": encoded},
    timeout=60,
)
response.raise_for_status()
result = response.json()
if not result.get("success"):
    raise RuntimeError("Extraction was not successful; inspect the response securely")
data = result.get("data") or {}
required = ["document_number", "surname", "date_of_expiry"]
missing = [field for field in required if not data.get(field)]
# Queue incomplete records; do not log identity data in production.
print({"needs_review": bool(missing), "missing_fields": missing})

Technical Specs

  • •Endpoint: POST /v1/national-id
  • •Authentication: Server-side x-api-key header
  • •Input: Base64 image in JSON img; use a readable JPG, PNG or WebP for this example
  • •File size: Up to 4.5MB decoded
  • •Standard processing: 2 credits per scan
  • •Output: JSON; retain incomplete results for review

Key Features

  • •Local extraction concern: The reverse can contain a personal number; collect only the side and fields required for the stated workflow, and keep face-side identity extraction separate.
  • •Identifiers: Keep strings intact; do not coerce document numbers into numeric spreadsheet columns.
  • •Dates: Validate date syntax and labels. An unexpected value needs source review, not silent correction.
  • •Image evidence: Preserve all card or page edges, reduce glare and avoid cropping small text.

Illustrative response fields

Synthetic subset of the response for mapping purposes. Values and dates are examples, not a real scan or an assertion about document validity periods. Actual fields depend on the submitted document.

{
  "success": true,
  "data": {
    "country_code": "JPN",
    "document_number": "EXAMPLE-NOT-A-REAL-ID",
    "surname": "EXAMPLE",
    "given_names": "PERSON",
    "date_of_birth": "1990-01-15",
    "date_of_issue": "2024-04-12",
    "date_of_expiry": "2029-04-12",
    "issuing_authority": null,
    "personal_number": null,
    "address": null,
    "additional_fields": {}
  }
}

Frequently Asked Questions

What is the main concern with Japan my number card intake?

The reverse can contain a personal number; collect only the side and fields required for the stated workflow, and keep face-side identity extraction separate.

Does extracting a number verify the document?

No. Extraction returns visible data. Authenticity checks, live registry checks and the final onboarding decision are separate processes.

What should happen when a date or name is unreadable?

Keep the record pending and request a clearer image or a manual review. Do not infer a date from an account profile or shorten a name to make it match.

Where should I check document-format references?

Use the PRADO public document reference collection as a starting point for document-format research, together with the issuing authority. Public collections may not include every country or current card version.

Can the same workflow run without Python?

Yes. Any backend that can send an authenticated JSON request can call /v1/national-id. See the API reference for the current response contract.

You May Also Like

Related tutorials, platform guides, and comparisons

Tutorial

Python National ID OCR API

High-accuracy National ID OCR for Python. Upload an image for a free test! Get structured JSON output via our dedicated Python SDK. Automate KYC and data entry.

Python · National ID
Country Tutorial

Kenya National ID (Maisha Card) OCR Python SDK

Python Tutorial: Automate KYC in Kenya. Extract data, Maisha Namba (UPI), and validate TD1 MRZ from National ID (Maisha Card) using StructOCR Python SDK.

Python · National ID
Country Tutorial

Egypt ID OCR API & Python SDK

Python tutorial: read Egyptian national IDs, including the 14-digit national number (century, date of birth, governorate, gender and check digit), as JSON. Test the ID OCR engine free.

Python · National ID
Country Tutorial

Guatemala DPI OCR: Extract Fields with Python

Extract visible fields from Guatemala dpi images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.

Python · National ID
Country Tutorial

Ecuador identity card OCR: Extract Fields with Python

Extract visible fields from Ecuador identity card images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.

Python · National ID
Country Tutorial

Uganda National ID Card OCR Python SDK

Python Tutorial: Automate KYC in Uganda. Extract data from National ID Card using StructOCR Python SDK. Supports native text and MRZ extraction.

Python · National ID
Country Tutorial

Ukraine National ID OCR Python SDK

Python Tutorial: Automate KYC in Ukraine. Extract data from National ID using StructOCR Python SDK. Supports native text and MRZ extraction.

Python · National ID
Country Tutorial

Tunisia CIN (Carte d'Identité Nationale) OCR Python SDK

Python Tutorial: Automate KYC in Tunisia. Extract data from CIN (Carte d'Identité Nationale) using StructOCR Python SDK. Supports native text.

Python · National ID
Country Tutorial

UAE Emirates ID OCR with Node.js SDK

Extract Emirates ID number, names, dates and other visible fields from Emirates ID with the StructOCR Node.js SDK and Express.

Node.js · National ID
Country Tutorial

Japan Passport OCR with Node.js SDK

Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Japan passports.

Node.js · Passport

Technical Comparisons & Integrations

Explore platform integrations and competitive analysis

From tutorial to production in 5 minutes.

You've seen the code. Now get your API key, grab your 200 free credits, and see it work with your own images. No credit card required.

Instant Access Cancel Anytime No Credit Card