You can work an iteration of stats, and then use the transpose command to work with this and format it how you want..
I would just do it this way:
your search here | untable API Measure Count
I replicated your use case with the following CSV:
API, SUCCESS, FAIL, POLICY, TOTAL x, 2, 3, 4, 9
And tested it with the following query:
| inputcsv mycsv.csv | untable API Measure Count
And the output is: see attached image.