The reconstruction of a k-essence inflationary universe, considering the unification between the swampland criteria and the attractor given by the scalar spectral index nS(N) together with the slow-roll parameter ϵ(N) in terms of the number of e-folds N is studied. In the context of a coupling of the form L(φ)X in the k-essence model, we find the effective potential V and the coupling parameter L in terms of the scalar spectral index and the slow-roll parameter under a general formalism. To apply the unification in our model, we consider some examples in order to rebuild the effective potential V(φ) and the coupling parameter L(φ) as a function of the inflaton field φ. Here, we find that the reconstruction gives rise to an exponential potential and also to natural and hyperbolic inflation, respectively. Thus, in this article we show that it is possible to unify the theoretical foundations from the swampland criteria and the observational parameters corroborated by observations, in the reconstruction of an inflationary universe.