Can we calculate the average rating using math Api?
No, but you can use the aggregations API https://docs.hypi.app/references/aggregations-api