ABSTRACT Spiral arms are observed in numerous protoplanetary discs. These spiral arms can be excited by companions, either on bound or unbound orbits. We simulate a scenario where an unbound perturber, i.e. a flyby, excites spiral arms during a periastron passage. We run three-dimensional hydrodynamical simulations of a parabolic flyby encountering a gaseous protoplanetary disc. The perturber mass ranges from $10\, \rm M_J$ to $1\, \rm {\rm M}_{\odot }$. The perturber excites a two-armed spiral structure, with a more prominent spiral feature for higher mass perturbers. The two arms evolve over time, eventually winding up, consistent with previous works. We focus on analysing the pattern speed and pitch angle of these spirals during the whole process. The initial pattern speed of the two arms are close to the angular velocity of the perturber at periastron, and then it decreases over time. The pitch angle also decreases over time as the spiral winds up. The spirals disappear after several local orbital times. An inclined prograde orbit flyby induces similar disc substructures as a coplanar flyby. A solar-mass flyby event causes increased eccentricity growth in the protoplanetary disc, leading to an eccentric disc structure which dampens over time. The spirals’ morphology and the disc eccentricity can be used to search for potential unbound stars or planets around discs where a flyby is suspected. Future disc observations at high resolution and dedicated surveys will help to constrain the frequency of such stellar encounters in nearby star-forming regions.