Visualise data in front end with count api

System Information
  • Strapi Version: 3.6.1
  • Operating System: ubuntu 20.x
  • Database: mysql
  • Node Version: 14.x
  • NPM Version: 6.x
  • Yarn Version: N?A

I want to create a chart to show daily report, for instance, there are 10 posts today, and 20 posts in last day, day by day, I know the API can return the no.of records by using COUNT, but let’s say 1 month, then I got to request it day by day and plot it into chart, is there any best practices to do so?

Instead of calling the API 30 times for each day, I would recommend building a new route with a custom controller and a custom query that retrieves counts for each day in a single request.

do u have any examples?

if your frontend supports websockets you can use the realtime chat template i did it but with stock data