Atomic clocks are vital in a wide array of technologies and experiments, including tests of fundamental physics1. Clocks operating at optical frequencies have now demonstrated fractional stability and reproducibility at the 10−18 level, two orders of magnitude beyond their microwave predecessors2. Frequency ratio measurements between optical clocks are the basis for many of the applications that take advantage of this remarkable precision. However, the highest reported accuracy for frequency ratio measurements has remained largely unchanged for more than a decade3-5. Here we operate a network of optical clocks based on 27Al+ (ref. 6), 87Sr (ref. 7) and 171Yb (ref. 8), and measure their frequency ratios with fractional uncertainties at or below 8 × 10−18. Exploiting this precision, we derive improved constraints on the potential coupling of ultralight bosonic dark matter to standard model fields9,10. Our optical clock network utilizes not just optical fibre11, but also a 1.5-kilometre free-space link12,13. This advance in frequency ratio measurements lays the groundwork for future networks of mobile, airborne and remote optical clocks that will be used to test physical laws1, perform relativistic geodesy14 and substantially improve international timekeeping15.