 Ansari made his Surrey debut against Sussex in September 2010 in a List A match, before making his first-class debut for Cambridge MCCU against Essex in April 2011.He had bowling figures of 5-33 in only his third first-class match, for Cambridge MCCU against his own county of Surrey, Kevin Pietersen being among his victims.He scored his maiden first-class century in 2014, for Surrey against Derbyshire.