Skip to content
amitchewPublic

About

Django REST API for blog analytics — view counts, top-content rankings, and period-over-period growth metrics, with dynamic query filtering

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Ideeza Analytics API

Django REST API for blog analytics, view counts, top charts, and period-over-period growth.


Running with Docker

docker compose up --build

To run the test suite inside the container:

docker compose run --rm web python manage.py test analytics

Running locally

Requires Python 3.11+ and a running Postgres instance.

python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

The three endpoints

/analytics/blog-views/

{
  "object_type": "country",
  "range": "month"
}
  • object_type: country | user
  • range: week | month | year
  • x = country name or username, y = distinct blog count, z = total views

/analytics/top/

{
  "top": "blog",
  "range": "week"
}
  • top: user | country | blog
  • For blog: x = title, y = author username, z = views
  • For user/country: x = name, y = blog count, z = views

/analytics/performance/

{
  "compare": "month",
  "user_id": 3
}
  • compare: day | week | month | year
  • user_id is optional — leave it out for site-wide numbers
  • x = period label + how many blogs were created that period
  • y = views during that period
  • z = growth % vs previous period (0.0 if previous period had no views)

Dynamic filters

Every endpoint accepts an optional filter key. Supports and, or, not, and eq.

{
  "filter": {
    "and": [
      { "eq": { "field": "blog__author__country__name", "value": "Egypt" } },
      { "not": { "eq": { "field": "blog__is_published", "value": false } } }
    ]
  }
}

About

Django REST API for blog analytics — view counts, top-content rankings, and period-over-period growth metrics, with dynamic query filtering

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages