Statistics
Get Daily Aggregated Statistics
Get pre-aggregated daily statistics for dashboard charts
curl -X POST https://api.ugc.inc/stats/aggregated/daily \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"startDate": "2024-01-01T00:00:00Z",
"endDate": "2024-01-31T23:59:59Z",
"tag": "fitness"
}'
import requests
response = requests.post(
'https://api.ugc.inc/stats/aggregated/daily',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'startDate': '2024-01-01T00:00:00Z',
'endDate': '2024-01-31T23:59:59Z',
'tag': 'fitness'
}
)
data = response.json()
if data['ok']:
for day in data['data']:
print(f"{day['date']}: +{day['followers']} followers, +{day['views']} views, {day['posts']} posts")
const response = await fetch('https://api.ugc.inc/stats/aggregated/daily', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
startDate: '2024-01-01T00:00:00Z',
endDate: '2024-01-31T23:59:59Z',
tag: 'fitness'
})
});
const data = await response.json();
if (data.ok) {
data.data.forEach(day => {
console.log(`${day.date}: +${day.followers} followers, +${day.views} views, ${day.posts} posts`);
});
}
import { UGCClient } from 'ugcinc';
const client = new UGCClient({
apiKey: 'YOUR_API_KEY'
});
const response = await client.stats.getDailyAggregated({
startDate: '2024-01-01T00:00:00Z',
endDate: '2024-01-31T23:59:59Z',
tag: 'fitness'
});
if (response.ok) {
response.data.forEach(day => {
console.log(`${day.date}:`);
console.log(` Followers: +${day.followers}`);
console.log(` Views: +${day.views}`);
console.log(` Posts: ${day.posts}`);
});
}
{
"ok": true,
"code": 200,
"message": "Success",
"data": [
{
"date": "2024-01-01",
"followers": 234,
"following": 12,
"views": 45600,
"likes": 3420,
"posts": 15
},
{
"date": "2024-01-02",
"followers": 189,
"following": 8,
"views": 38900,
"likes": 2890,
"posts": 12
}
]
}
⌘I
curl -X POST https://api.ugc.inc/stats/aggregated/daily \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"startDate": "2024-01-01T00:00:00Z",
"endDate": "2024-01-31T23:59:59Z",
"tag": "fitness"
}'
import requests
response = requests.post(
'https://api.ugc.inc/stats/aggregated/daily',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'startDate': '2024-01-01T00:00:00Z',
'endDate': '2024-01-31T23:59:59Z',
'tag': 'fitness'
}
)
data = response.json()
if data['ok']:
for day in data['data']:
print(f"{day['date']}: +{day['followers']} followers, +{day['views']} views, {day['posts']} posts")
const response = await fetch('https://api.ugc.inc/stats/aggregated/daily', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
startDate: '2024-01-01T00:00:00Z',
endDate: '2024-01-31T23:59:59Z',
tag: 'fitness'
})
});
const data = await response.json();
if (data.ok) {
data.data.forEach(day => {
console.log(`${day.date}: +${day.followers} followers, +${day.views} views, ${day.posts} posts`);
});
}
import { UGCClient } from 'ugcinc';
const client = new UGCClient({
apiKey: 'YOUR_API_KEY'
});
const response = await client.stats.getDailyAggregated({
startDate: '2024-01-01T00:00:00Z',
endDate: '2024-01-31T23:59:59Z',
tag: 'fitness'
});
if (response.ok) {
response.data.forEach(day => {
console.log(`${day.date}:`);
console.log(` Followers: +${day.followers}`);
console.log(` Views: +${day.views}`);
console.log(` Posts: ${day.posts}`);
});
}
{
"ok": true,
"code": 200,
"message": "Success",
"data": [
{
"date": "2024-01-01",
"followers": 234,
"following": 12,
"views": 45600,
"likes": 3420,
"posts": 15
},
{
"date": "2024-01-02",
"followers": 189,
"following": 8,
"views": 38900,
"likes": 2890,
"posts": 12
}
]
}
