A simple API to count banner views and manage counters for shops.
Adds a given number of views to a shop’s counter. Automatically resets every 30 days.
POST /views
Content-Type: application/json
{
"shop": "example.myshopify.com",
"views": 3
}
Response: true
Retrieves the current counter and how many seconds remain in the current 30-day window.
GET /views?shop=example.myshopify.com
Example response:
{
"shop": "example.myshopify.com",
"total": 12,
"period_start": 1728312345,
"seconds_left_in_window": 220
}
Resets the counter for a shop (useful when upgrading a plan). Requires an admin key.
POST /reset
Content-Type: application/json
x-admin-key: YOUR_ADMIN_KEY
{
"shop": "example.myshopify.com"
}
Response: true