convert api stats to code for arduino