We compute the motive of the variety of representations of the torus knot of type (m,n) into the affine groups $AGL_1(C)$ and $AGL_2(C)$. For this, we stratify the varieties and show that the motives lie in the subring generated by the Lefschetz motive q=[C].