Version 2.1.0 | RESTful API for Publisher Statistics
Include your API key as a query parameter in every request.
| Parameter | Required | Description | Example |
|---|---|---|---|
ts |
Yes | Traffic Source ID | 66 |
from |
Yes | Start date (YYYY-MM-DD) | 2025-08-01 |
to |
Yes | End date (YYYY-MM-DD) | 2025-08-30 |
key |
Yes | Your API key | Your_API_Key_Here |
format |
No | Response format (json or csv) |
json |
GET https://api.searchbarista.com/functions/v1/pubstats?ts=66&from=2025-08-01&to=2025-08-30&key=YOUR_API_KEY
[
{
"date": "2025-08-30",
"total_searches": 1500,
"monetized_searches": 1200,
"paid_clicks": 450,
"revenue": 125.5678,
"feed_id": 123
}
]
| Field | Type | Description |
|---|---|---|
date |
string | Date (YYYY-MM-DD) |
total_searches |
integer | Total searches |
monetized_searches |
integer | Monetized searches |
paid_clicks |
integer | Paid clicks |
revenue |
float | Your revenue in USD |
feed_id |
integer | Campaign ID |
| Status Code | Error Message |
|---|---|
400 |
Missing required parameters |
401 |
Invalid API key |
403 |
Access denied |
500 |
Internal server error |
import requests
url = "https://api.searchbarista.com/functions/v1/pubstats"
params = {
"ts": YOUR_TS_ID,
"from": "2025-08-01",
"to": "2025-08-30",
"key": "YOUR_API_KEY"
}
response = requests.get(url, params=params)
data = response.json()
for row in data:
print(f"Date: {row['date']}, Revenue: ${row['revenue']}")
const url = 'https://api.searchbarista.com/functions/v1/pubstats';
const params = new URLSearchParams({
ts: YOUR_TS_ID,
from: '2025-08-01',
to: '2025-08-30',
key: 'YOUR_API_KEY'
});
fetch(`${url}?${params}`)
.then(res => res.json())
.then(data => {
data.forEach(row => {
console.log(`Date: ${row.date}, Revenue: $${row.revenue}`);
});
});
curl "https://api.searchbarista.com/functions/v1/pubstats?ts=YOUR_TS_ID&from=2025-08-01&to=2025-08-30&key=YOUR_API_KEY"
For technical support or questions, please contact:
Email: api-support@searchbarista.com