TAŇBA-OOH Developers

Estimated audience of the complete plays

GET /api/v1/stats/audience

https://app.tanba-ooh.kz/api/v1/stats/audience

Scope read:stats. Own organisation; the authority sees the city. For each period, structure and approval: the plays, the complete plays and an estimate of the people who noticed the screen. The estimate is not measured: it comes from a versioned model whose inputs are assumptions until counted figures replace them, and it is information only. The bill counts plays. Incomplete plays add nothing to the estimate. Days are Asia/Almaty days; a month uses the model that applies to it.

Authentication

API key in the Authorization header, or a console session.

Scope: read:stats

Parameters

NameInTypeRequiredDescriptionExample
fromquerystring (date)noFirst day (default 29 days back).2026-09-01
toquerystring (date)noLast day (default today).2026-09-30
grainquerystringnoLength of one period: day or month. day, monthday
structurequerystringnoCode of one structure.ALM-0012
approvalquerystringnoNumber of one approval.TNB-2026-000123

Responses

200 The estimate for each period, structure and approval.

application/json

NameTypeRequiredDescriptionExample
fromstring (date)yesFirst day of the answer."2026-09-01"
tostring (date)yesLast day of the answer."2026-09-30"
grainstringyesLength of one period. day, month
measuredbooleanyesAlways false while the inputs of the model are assumptions and not counts.false
itemsarray of AudienceEstimateyesOne row for each period, structure and approval with plays.
items[].periodstringyesThe day (YYYY-MM-DD) or the month (YYYY-MM), by the grain."2026-09"
items[].structurestringyesCode of the structure."ALM-0012"
items[].approval_numberstringyesNumber of the approval the plays belong to."TNB-2026-000123"
items[].playsintegeryesPlays in the period.14210
items[].complete_playsintegeryesPlays that ran to the end; only these enter the estimate.13980
items[].impressionsnumberyesEstimated people who noticed the screen, from the model named in model. Not measured.21870.4
items[].modelstring | nullyesCode of the model version that gave the estimate; null when no model exists."audience-v1-draft"
items[].model_statusstring | nullyesWhether that version is a draft (placeholder assumptions) or published. draft, published, <nil>

Example

{
  "from": "2026-09-01",
  "to": "2026-09-30",
  "grain": "month",
  "measured": false,
  "items": [
    {
      "period": "2026-09",
      "structure": "ALM-0012",
      "approval_number": "TNB-2026-000123",
      "plays": 14210,
      "complete_plays": 13980,
      "impressions": 21870.4,
      "model": "audience-v1-draft",
      "model_status": "draft"
    }
  ]
}

Errors

Errors are problem documents (application/problem+json) with a stable code.

StatusMeaning
401No valid session or API key (unauthenticated, session_expired, invalid_api_key).
403The role or the key's scope does not allow this (forbidden, key_scope_denied, key_route_denied).
422Field errors (validation_failed).
defaultAn error as a problem document.

Code samples

curl

curl 'https://app.tanba-ooh.kz/api/v1/stats/audience' \
  -H 'Authorization: Bearer YOUR_API_KEY'
Python
import requests

response = requests.get(
    "https://app.tanba-ooh.kz/api/v1/stats/audience",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
    },
)
print(response.status_code, response.text)
Go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, err := http.NewRequest("GET", "https://app.tanba-ooh.kz/api/v1/stats/audience", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	data, _ := io.ReadAll(resp.Body)
	fmt.Println(resp.Status, string(data))
}