Skip to content

Tracking API

Endpoints

Create tracker

POST /api/tracking

Body:

json
{
  "name": "string (required)",
  "keyword": "string (required, max 800)",
  "exact_match": "boolean (default: false)",
  "minus_words": "string[] | null",
  "search_channels": "boolean (default: true)",
  "search_chats": "boolean (default: true)",
  "filter_geo": "string | null",
  "filter_language": "string | null",
  "filter_category": "string | null",
  "filter_min_subscribers": "number | null",
  "include_sources": "string[] | null",
  "exclude_sources": "string[] | null",
  "notify_via": "'bot' | 'webhook' (default: 'bot')",
  "webhook_url": "string | null (required if notify_via = 'webhook')",
  "notify_on_delete": "boolean (default: false)"
}

Response: KeywordTrackerResponse (201)

List trackers

GET /api/tracking

Response: KeywordTrackerResponse[]

Get tracker

GET /api/tracking/:id

Response: KeywordTrackerResponse

Update tracker

PATCH /api/tracking/:id

Body: partial fields from Create

Response: KeywordTrackerResponse

Delete tracker

DELETE /api/tracking/:id

Response:

json
{
  "success": true
}

Get limits

GET /api/tracking/limits

Response:

json
{
  "current": 2,
  "max": 5,
  "plan": "pro"
}

Get matches

GET /api/tracking/:id/matches?limit=20&offset=0

Response:

json
{
  "items": "KeywordMatchResponse[]",
  "total": 42
}

Get unread count

GET /api/tracking/:id/matches/unread

Response:

json
{
  "count": 5
}

Mark all matches read

POST /api/tracking/:id/matches/read-all

Response:

json
{
  "success": true
}

Test notification

POST /api/tracking/:id/test

Response:

json
{
  "success": true
}

Get filter options

GET /api/tracking/filters

Response:

json
{
  "geo": [{ "code": "RU", "label": "Россия" }],
  "languages": [{ "code": "ru", "label": "Русский" }],
  "categories": [{ "code": "tech", "label": "Технологии" }]
}

Types

KeywordTrackerResponse

FieldTypeDescription
idnumberTracker ID
namestringDisplay name
keywordstringSearch keyword/phrase
exact_matchbooleanWhole-word matching
minus_wordsstring[] | nullExclusion words
search_channelsbooleanSearch in channels
search_chatsbooleanSearch in chats
filter_geostring | nullCountry filter
filter_languagestring | nullLanguage filter
filter_categorystring | nullCategory filter
filter_min_subscribersnumber | nullMin subscriber count
include_sourcesstring[] | nullOnly search in these sources
exclude_sourcesstring[] | nullExclude these sources
notify_via'bot' | 'webhook'Notification method
webhook_urlstring | nullWebhook URL
notify_on_deletebooleanNotify on post deletion
is_enabledbooleanActive status
total_matchesnumberTotal match count
created_atstringISO 8601 datetime

KeywordMatchResponse

FieldTypeDescription
idnumberMatch ID
tracker_idnumberParent tracker ID
source_titlestring | nullChannel/chat title
source_usernamestring | nullChannel/chat username
source_message_idnumberTelegram message ID
text_snippetstring | nullMatched text preview
matched_keywordstring | nullActual matched text
post_urlstring | nullDirect link to post
is_deletedbooleanPost was deleted
is_readbooleanRead status
detected_atstringISO 8601 detection datetime

Authentication

All endpoints require Authorization: Bearer <token> header. Obtain token via /api/auth/telegram.

Rate limits

Standard API rate limits apply (see rate-limits).

Telegram-аналитика для тех, кто понимает