We define a linear code Cη(δ T , δ X ) by evaluating polynomials of bidegree (δ T , δ X ) in the Cox ring on Fq-rational points of a minimal Hirzebruch surface over the finite field Fq. We give explicit parameters of the code, notably using Gröbner bases. The minimum distance provides an upper bound of the number of Fq-rational points of a non-filling curve on a Hirzebruch surface.