  The iron-based superconductor Ba$_{1-x}$K$_x$Fe$_\text{2}$As$_\text{2}$ is
emerging as a key material for high magnetic field applications owing to the
recent developments in superconducting wires and bulk permanent magnets.
Epitaxial thin films play important roles in investigating and artificially
tuning physical properties; nevertheless, the synthesis of
Ba$_{1-x}$K$_x$Fe$_2$As$_2$ epitaxial thin films remained challenging because
of the high volatility of K. Herein, we report the successful growth of
epitaxial Ba$_{1-x}$K$_x$Fe$_\text{2}$As$_\text{2}$ thin films by
molecular-beam epitaxy with employing a combination of fluoride substrates
(CaF$_\text{2}$, SrF$_\text{2}$, and BaF$_\text{2}$) and a low growth
temperature (350$-$420$^\circ$C). Our epitaxial thin film grown on
CaF$_\text{2}$ showed sharp superconducting transition at an onset critical
temperature of 36 K, slightly lower than bulk crystals by ~2 K due presumably
to the strain effect arising from the lattice and thermal expansion mismatch.
Critical current density ($J$$_\text{c}$) determined by the magnetization
hysteresis loop is as high as 2.2 MA/cm$^\text{2}$ at 4 K under self-field.
In-field $J$$_\text{c}$ characteristics of the film are superior to the bulk
crystals. The realization of epitaxial thin films opens opportunities for
tuning superconducting properties by epitaxial strain and revealing intrinsic
grain boundary transport of Ba$_{1-x}$K$_x$Fe$_\text{2}$As$_\text{2}$.
