월별 통계 조회
API Endpoint
GET /api/stats/monthly
월별 통계 트렌드를 조회합니다. 장기간의 푸시 발송 성과 변화와 월별 비교 분석을 확인할 수 있습니다.
엔드포인트: GET https://api.pushmanager.kr/api/stats/monthly
GET /api/stats/monthly?months=12
X-API-Key: <서비스-API-키>
Origin: <등록된-도메인>
X-API-Key: <서비스-API-키>
Origin: <등록된-도메인>
Parameters
months
조회할 월의 개수입니다. 최근 N개월의 데이터를 조회하며, 기본값은 12개월입니다. 최대 24개월까지 조회 가능합니다.
Discussion
이 엔드포인트는 월별로 집계된 푸시 발송 통계를 제공하여 장기 트렌드 분석과 성과 변화를 추적할 수 있습니다. 각 월별로 총 요청 수, 성공률, 활성 일수, 일평균 요청 수 등의 지표를 확인할 수 있어 서비스 성장과 사용자 참여도 분석에 유용합니다.
최대 조회 기간: 최대 24개월
데이터 정렬: 최신 월 순으로 정렬
인증: 유효한 X-API-Key 헤더와 Origin 검증 필요
데이터 정렬: 최신 월 순으로 정렬
인증: 유효한 X-API-Key 헤더와 Origin 검증 필요
응답 형식
성공 응답 (200 OK)
{
"success": true,
"data": {
"monthly": [
{
"year": 2024,
"month": 1,
"period": "2024-01",
"total_requests": 150,
"total_subscriptions": 2500,
"success_count": 2350,
"fail_count": 150,
"success_rate": 94.0,
"active_days": 25,
"avg_daily_requests": 6.0
},
{
"year": 2023,
"month": 12,
"period": "2023-12",
"total_requests": 128,
"total_subscriptions": 2200,
"success_rate": 92.5,
"active_days": 22,
"avg_daily_requests": 5.8
}
// ... 추가 월별 데이터
],
"service": {
"siteName": "내 웹사이트",
"apiKey": "your-api-key"
},
"months": 12
}
}
"success": true,
"data": {
"monthly": [
{
"year": 2024,
"month": 1,
"period": "2024-01",
"total_requests": 150,
"total_subscriptions": 2500,
"success_count": 2350,
"fail_count": 150,
"success_rate": 94.0,
"active_days": 25,
"avg_daily_requests": 6.0
},
{
"year": 2023,
"month": 12,
"period": "2023-12",
"total_requests": 128,
"total_subscriptions": 2200,
"success_rate": 92.5,
"active_days": 22,
"avg_daily_requests": 5.8
}
// ... 추가 월별 데이터
],
"service": {
"siteName": "내 웹사이트",
"apiKey": "your-api-key"
},
"months": 12
}
}
사용 예시
// 최근 12개월 통계 조회
const response = await fetch('https://api.pushmanager.kr/api/stats/monthly', {
headers: {
'X-API-Key': 'your-api-key-here'
}
});
const { data } = await response.json();
// 월별 성장률 계산
const currentMonth = data.monthly[0];
const previousMonth = data.monthly[1];
const growthRate = ((currentMonth.total_subscriptions - previousMonth.total_subscriptions) / previousMonth.total_subscriptions * 100).toFixed(1);
console.log(`이번 달 성장률: ${growthRate}%`);
const response = await fetch('https://api.pushmanager.kr/api/stats/monthly', {
headers: {
'X-API-Key': 'your-api-key-here'
}
});
const { data } = await response.json();
// 월별 성장률 계산
const currentMonth = data.monthly[0];
const previousMonth = data.monthly[1];
const growthRate = ((currentMonth.total_subscriptions - previousMonth.total_subscriptions) / previousMonth.total_subscriptions * 100).toFixed(1);
console.log(`이번 달 성장률: ${growthRate}%`);