Ansar started his career in the 2014–15 Pakistan Premier League, making his debut in Pakistan Army's opening game of the season against Pakistan Railways, he scored on debut, netting his team's third goal in the 24th minute as Pakistan Army won the match 6–0.[2] He scored his second goal in Pakistan Army's second match of the season where he broke the deadlock in the 65th minutes as his team defeated Pakistan Air Force 1–0.[3] Ansar went on with three consecutive matches with goal after scoring the lone goal of the match against Muslim on 15 October 2014.[4] On 15 November 2015, Ansar scored a brace and got booked against Muslim.[5] Ansar's last goal of the season was against relegation bound Pakistan Railways.[6] Ansar scored his first National Football Challenge Cup goal in his second match 2015 NBP National Challenge Cup against Pakistan Navy.[7] His second match of the cup competition was against Karachi Port Trust.[8] Ansar scored the first penalty in penalty shootout against WAPDA as Pakistan Army won the third position match.[9] Ansar ended his season with 8 goals in 22 matches.[10]
2018–19
Ansar was made the captain of Pakistan Army for the 2018–19 Pakistan Premier League, he scored the equaliser against WAPDA in the first match of the season.[11] On 16 November 2018, Ansar scored his first career hat-trick, scoring four goals against Baloch Nushki in a 5–0 victory. Ansar scored goals in 15th, 50th, 85th and 91st of the game.[12] Ansar scored a brace against Karachi Port Trust on 17 December 2018 in 5–0 victory.[13] Ansar's last goal of the season was against K-Electric in the 91st minute.[14] Ansar ended his 2018–19 season with 15 goals in 29 appearances.[10]