Skip to content

Add subscription API with traffic aggregation#14

Open
LiberSurf wants to merge 1 commit intodev-ir:masterfrom
LiberSurf:master
Open

Add subscription API with traffic aggregation#14
LiberSurf wants to merge 1 commit intodev-ir:masterfrom
LiberSurf:master

Conversation

@LiberSurf
Copy link

Overview

This PR adds REST API endpoints that enable monitoring bots and automation tools to query traffic data by subscription ID instead of individual inbounds.

What's New

  • GET /api/subscriptions - Returns all unique subscription IDs
  • GET /api/traffic/:subId - Returns aggregated traffic across all inbounds for a subscription

Key Improvements

✅ Multi-inbound traffic aggregation per subscription
✅ Single API call replaces multiple inbound queries
✅ Perfect for distributed server setups
✅ Comprehensive JSDoc documentation
✅ Works seamlessly with existing subscription system

Enhanced by @LiberSurf - https://t.me/libersurf

Implemented /api/subscriptions and /api/traffic/:subId endpoints that
aggregate traffic across all inbounds per subscription. This replaces
per-inbound queries and makes monitoring across multiple servers much easier.

Also cleaned up code documentation and added JSDoc comments.

Enhanced by @LiberSurf - https://t.me/libersurf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant