Send a photo of a South African passport and get structured data back in the same HTTP
response – the machine-readable zone parsed, the ICAO 9303 check digits verified and the
visual fields extracted. No SDK to install, no queue to poll.
A South Africa passport follows the ICAO 9303 standard: a two-line, 44-character
machine-readable zone (format TD3) printed at the foot of the data page,
below the human-readable visual inspection zone. Its first five characters are P<ZAF – the document code, then the issuing stateas the ISO 3166-1 alpha-3 code ZAF. The API reads both zones,
cross-checks the MRZ check digits, and returns one response shape with every key present.
South Africa is ZA in an alpha-2 list and ZAF in the zone: here the longer code is the shorter one with F after it. That holds for this pair and not as a rule, so deriving one from the other is a bug waiting for the first country it does not fit.
The ordinary tourist passport is issued to citizens aged 16 or older, is valid for 10 years and has 32 pages; the 48-page maxi passport is also valid for 10 years.
A minor's tourist passport is issued to citizens aged 15 or younger and is valid for five years.
Names are printed as they appear in the National Population Register at the time of application.
Home Affairs no longer issues temporary passports.
9303 defines three zone layouts, and the API reads all three. Below is one invented holder
– she is nobody, and paradeigma is the Greek word for example – in each
layout, with ZAF as the issuing state. Every check digit is
computed from the characters beside it rather than typed in, so each zone here validates.
TD3 – South Africa passport
2 lines of 44. Nationality ZAF. Issuing state and nationality are both ZAF: a passport certifies the nationality of the state that issued it.
2 lines of 36. Nationality GRC. Issued by ZAF to a GRC national, so the two codes differ. The name has 31 characters here instead of the passport's 39.
TD1 – Identity card or residence permit issued by South Africa
3 lines of 30. Nationality GRC. Three lines of 30, with the name on a line of its own. The document code is ID – 9303 part 5 fixes the first character as A, C or I and leaves the second to the issuing state.
No check digit covers the issuing state: on all three layouts the arithmetic runs over the
document number, the dates and the optional data, never over the three characters that say
who issued the document. A zone whose digits all pass has not proved it came from
South Africa – the visual zone and the document's own security features do that.
Paste an MRZ into the MRZ parser to validate its check digits, or build one with the MRZ generator.
Fields you get back
Every recognised South African passport returns the same structured fields. A value
that could not be read is null, never a missing key.
Run this against the public sandbox – no registration, real recognition, free for a
limited number of documents and 10 requests per hour per IP. Swap the sandbox key for
your own live key to keep recognising South African passports.
The zone is Latin transliteration; the visual zone is not. Which reading carries the original script, and how a language identifier resolves to a language.