curl --request GET \
--url https://snapwidget.com/api/v1/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://snapwidget.com/api/v1/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://snapwidget.com/api/v1/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://snapwidget.com/api/v1/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://snapwidget.com/api/v1/stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://snapwidget.com/api/v1/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://snapwidget.com/api/v1/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{}{
"message": "<string>",
"errors": {},
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"upgrade_url": "<string>"
}Get Widget Stats
The Analytics of the user’s widgets, as the Analytics page shows it (paid plans): views, clicks and visitors per day, the sites and countries that show the widgets, the devices, and the widgets with the most views. For one widget: the posts or reviews that visitors click most, and the Shoppable product clicks. Analytics counts Pro widgets and review widgets. visitors is the sum of each day’s visitors. from and to: the first and the last day of the range. counted_from: null when every day of the range has counts; else , the first day with counts, and why the days before it have none (reason “counting”: counting started that day; “widget”: the widget was made that day). With days 365, each point of daily is a week (date: its first day), and its days field gives the number of days in it: the oldest week can have fewer than 7.
curl --request GET \
--url https://snapwidget.com/api/v1/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://snapwidget.com/api/v1/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://snapwidget.com/api/v1/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://snapwidget.com/api/v1/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://snapwidget.com/api/v1/stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://snapwidget.com/api/v1/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://snapwidget.com/api/v1/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{}{
"message": "<string>",
"errors": {},
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"upgrade_url": "<string>"
}{
"message": "<string>",
"errors": {},
"upgrade_url": "<string>"
}Authorizations
A token from the API page: https://snapwidget.com/settings/api
Query Parameters
One widget's id (the id in list_widgets). Leave it out for all the widgets.
The last 7, 30 or 90 days, today included (30 when not given), or 365: the last 52 full weeks (364 days), one point a week.
7, 30, 90, 365 Response
The answer, as JSON.
The response is of type object.