It is nowadays accepted that the universe is undergoing a phase of accelerated expansion as tested by the Hubble diagram of Type Ia Supernovae (SNeIa) and several LSS observations. Future SNeIa surveys and other probes will make it possible to better characterize the dynamical state of the universe renewing the interest in cosmography which allows a model independent analysis of the distance - redshift relation. On the other hand, fourth order theories of gravity, also referred to as $f(R)$ gravity, have attracted a lot of interest since they could be able to explain the accelerated expansion without any dark energy. We show here how it is possible to relate the cosmographic parameters (namely the deceleration $q_0$, the jerk $j_0$, the snap $s_0$ and the lerk $l_0$ parameters) to the present day values of $f(R)$ and its derivatives $f^{(n)}(R) = d^nf/dR^n$ (with $n = 1, 2, 3$) thus offering a new tool to constrain such higher order models. Our analysis thus offers the possibility to relate the model independent results coming from cosmography to the theoretically motivated assumptions of $f(R)$ cosmology.