Get product performance
curl --request GET \
--url https://api.khaime.com/api/v1/analytics/products \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.khaime.com/api/v1/analytics/products"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.khaime.com/api/v1/analytics/products', 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://api.khaime.com/api/v1/analytics/products",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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://api.khaime.com/api/v1/analytics/products"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.khaime.com/api/v1/analytics/products")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.khaime.com/api/v1/analytics/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyStore Data
Get product performance
Views, adds to cart, orders and revenue for each product.
GET
/
api
/
v1
/
analytics
/
products
Get product performance
curl --request GET \
--url https://api.khaime.com/api/v1/analytics/products \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.khaime.com/api/v1/analytics/products"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.khaime.com/api/v1/analytics/products', 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://api.khaime.com/api/v1/analytics/products",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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://api.khaime.com/api/v1/analytics/products"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.khaime.com/api/v1/analytics/products")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.khaime.com/api/v1/analytics/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyViews, adds to cart, orders and revenue for each product. For price and stock, use List products. Needs Store Pulse on the business’s plan. Without it, the response is
403 with BUSINESS_FEATURE_UNAVAILABLE.
Call this from your server with a pk_ key. See Store data overview for keys, errors and how to read empty values.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
range | string | No | today, 7d, 30d or 90d. Default 30d. |
limit | integer | No | How many rows, 1 to 50. Default 10. |
Request
curl -H "X-API-Key: $KHAIME_API_KEY" \
"https://api.khaime.com/api/v1/analytics/products?range=30d&limit=5"
Response
{
"message": "Product performance retrieved",
"success": true,
"status": true,
"data": {
"environment": "live",
"range": "30d",
"currency": "USD",
"tracked": true,
"items": [
{
"product_id": 412,
"title": "North Core Hoodie",
"thumbnail": "https://cdn.example.com/hoodie.jpg",
"views": 540,
"sessions": 410,
"add_to_carts": 62,
"orders": 11,
"revenue": 66000
}
]
}
}
Read it correctly
revenueis in hundredths ofcurrency.tracked: falsewith noitemsmeans no tracker is running.
