Overview
The King of Hungary was the ruling head of state of the Kingdom of Hungary from 1000 (or 1001) to 1918. The style of title "Apostolic King of Hungary" (Apostoli Magyar Király) was endorsed by Pope Clement XIII in 1758 and used afterwards by all Monarchs of Hungary.
Establishment of the title
Before 1000 AD, Hungary was not yet recognized as a kingdom by the Pope and the ruler of Hungary was styled Grand Prince of the Hungarians. The first King of Hungary, Stephen I. was crowned on 25 December 1000 (or 1 January 1001) with the crown Pope Sylvester II had sent him and with the consent of Otto III, Holy Roman Emperor.
Following King Stephen I's coronation, all the monarchs of Hungary and the Árpád dynasty used the title "King". However, not all rulers of Hungary were kings—for example, Stephen Bocskai and Francis II Rákóczi were proclaimed rulers as "High Princes of Hungary", and there were also three Governors of Hungary who were sometimes styled "regents", János Hunyadi, Lajos Kossuth and Miklós Horthy.
Legal requirements for a coronation to be legitimate
From Wikipedia (CC BY-SA 4.0).