A finite dimensional filiform K-Lie algebra is a nilpotent Lie algebra g whose nil index is maximal, that is equal to dim g -1. We describe necessary and sufficient conditions for a filiform algebra over an algebraically closed field of characteristic 0 to admit a contact linear form (in odd dimension) or a symplectic structure (in even dimension). If we fix a Vergnes basis, the set of filiform n-dimensional Lie algebras is a closed Zariski subset of an affine space generated by the structure constants associated with this fixed basis. Then this subset is an algebraic variety and we describe in small dimensions the algebraic components.