curl --request GET \
--url https://api.unif.dev/v1/coverage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.unif.dev/v1/coverage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.unif.dev/v1/coverage', 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.unif.dev/v1/coverage",
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://api.unif.dev/v1/coverage"
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://api.unif.dev/v1/coverage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unif.dev/v1/coverage")
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{
"object": "coverage",
"entity": "shop",
"fields": [
{
"field": "metrics.revenue",
"channel": "tiktok_shop",
"market": "US",
"availability": "full",
"filterable": true,
"sortable": true,
"typical_lag_hours": 123,
"note": "<string>"
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "filters.revenue.gte must be a non-negative number.",
"param": "filters.revenue.gte",
"doc_url": "https://unif.dev/docs/platform/errors#parameter_invalid",
"request_id": "req_01k3m9x7v2q8r4t6y0b1n5d7fa"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "No API key was provided in the Authorization header.",
"doc_url": "https://unif.dev/docs/platform/errors#invalid_api_key",
"request_id": "req_01k3m9x7v2q8r4t6y0b1n5d7fa"
}
}Check field coverage
Reports which fields of an entity are populated for a given channel and market, and how fresh they are. Query this before you build a filter on a field, so you know whether it is available everywhere you plan to run.
curl --request GET \
--url https://api.unif.dev/v1/coverage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.unif.dev/v1/coverage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.unif.dev/v1/coverage', 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.unif.dev/v1/coverage",
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://api.unif.dev/v1/coverage"
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://api.unif.dev/v1/coverage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unif.dev/v1/coverage")
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{
"object": "coverage",
"entity": "shop",
"fields": [
{
"field": "metrics.revenue",
"channel": "tiktok_shop",
"market": "US",
"availability": "full",
"filterable": true,
"sortable": true,
"typical_lag_hours": 123,
"note": "<string>"
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "filters.revenue.gte must be a non-negative number.",
"param": "filters.revenue.gte",
"doc_url": "https://unif.dev/docs/platform/errors#parameter_invalid",
"request_id": "req_01k3m9x7v2q8r4t6y0b1n5d7fa"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "No API key was provided in the Authorization header.",
"doc_url": "https://unif.dev/docs/platform/errors#invalid_api_key",
"request_id": "req_01k3m9x7v2q8r4t6y0b1n5d7fa"
}
}Authorizations
Send your workspace API key as a bearer token:
Authorization: Bearer unif_sk_live_...
Keys are scoped to a single workspace. See Authentication.
Query Parameters
The entity type to report coverage for.
shop, product, creator, video, livestream, category Restrict to one channel. Omit to span every channel your workspace has enabled —
each returned object names its own channel.
A sales channel — the commerce surface a request is about. Behind each channel is a cascade of data sources, tried in cost order until one verifies; the roster is published, but which source answered a given row is not carried in the response, so the cascade can be re-tuned without breaking your code.
tiktok_shop "tiktok_shop"
The market to measure, as an ISO 3166-1 alpha-2 code. An ISO 3166-1 alpha-2 country code identifying a channel storefront.
US, GB, IE, ES, FR, DE, IT, ID, TH, VN, MY, PH, SG, JP, BR, MX "US"
Response
Field coverage for the requested entity.
"coverage"shop, product, creator, video, livestream, category Hide child attributes
Hide child attributes
"metrics.revenue"
A sales channel — the commerce surface a request is about. Behind each channel is a cascade of data sources, tried in cost order until one verifies; the roster is published, but which source answered a given row is not carried in the response, so the cascade can be re-tuned without breaking your code.
tiktok_shop "tiktok_shop"
An ISO 3166-1 alpha-2 country code identifying a channel storefront.
US, GB, IE, ES, FR, DE, IT, ID, TH, VN, MY, PH, SG, JP, BR, MX "US"
full, partial, unavailable Usual delay between an event on the channel and it appearing here.
Was this page helpful?