  We provide an algorithm which decides whether a polynomial foliation
$\mathcal{F}^{\mathbb{C}^2}$ on the complex plane has a polynomial first
integral of genus $g\neq 1$. Except in a specific case, an extension of the
algorithm also decides if $\mathcal{F}^{\mathbb{C}^2}$ has a rational first
integral of that genus.
