API for query rating