Skip to main content
Lorna
Contributor ⭐️⭐️⭐️
February 21, 2018
Solved

API 'statistics' date filter

  • February 21, 2018
  • 4 replies
  • 155 views
Can I filter the statistics by date?

Basically I want to know how many topics etc per community (we have 3) on a weekly/monthly basis. The analytics in control only show me one community so to see all 3 I need to build something separately.
    Best answer by Maryam
    Hi Lorna,

    This is indeed possible by our API; I can suggest you two different ways to build it:
    1. Statistics object: You can fetch the community statistics by a GET /statistics call. However, it is not possible to filter the result based on date and it returns the total number of topics. If you store the data in your own CMS however, by the weekly/monthly difference of total topics you can indicate the number of new topics in that specific week/month.
    2. Thread object: You can also get all the topics created in a certain time period by: GET /thread?filter[t.dateline ][from]=123&filter[t.dateline ][to]=456. You can read the total number of topics created in the 'count' parameter.
    Hopefully one of the options will suit your purpose.

    4 replies

    Maryam
    MaryamAnswer
    Helper ⭐️⭐️
    February 21, 2018
    Hi Lorna,

    This is indeed possible by our API; I can suggest you two different ways to build it:
    1. Statistics object: You can fetch the community statistics by a GET /statistics call. However, it is not possible to filter the result based on date and it returns the total number of topics. If you store the data in your own CMS however, by the weekly/monthly difference of total topics you can indicate the number of new topics in that specific week/month.
    2. Thread object: You can also get all the topics created in a certain time period by: GET /thread?filter[t.dateline ][from]=123&filter[t.dateline ][to]=456. You can read the total number of topics created in the 'count' parameter.
    Hopefully one of the options will suit your purpose.
    Lorna
    LornaAuthor
    Contributor ⭐️⭐️⭐️
    March 6, 2018
    @Maryam do you have an example of the dates using the php wrapper? I don't get any errors but I don't get any response data and I would expect some...
    Lorna
    LornaAuthor
    Contributor ⭐️⭐️⭐️
    March 6, 2018
    Aaaan ignore me - I was being an idiot. 🤓
    Contributor ⭐️
    October 26, 2021

    Do these endpoints still exist? I’m trying to pull statistics for an internal dashboard and don’t see any documentation for GET /statistics here: https://api2-eu-west-1.insided.com/docs/