We propose and study a novel way to produce a dc transport of vortices when applying an ac electrical current to a sample. Specifically, we study superconductors with a graduated random pinning density, which transports interacting vortices as a ratchet system. We show that a ratchet effect appears as a consequence of the long range interactions between the vortices. The pinned vortices create an asymmetric periodic flux density profile, which results in an asymmetric effective potential for the unpinned interstitial vortices. The latter exhibit a net longitudinal rectification under an applied transverse ac electric current.