Get a video
curl --request GET \
--url https://api.unif.dev/v1/videos/{video_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.unif.dev/v1/videos/{video_id}"
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/videos/{video_id}', 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/videos/{video_id}",
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/videos/{video_id}"
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/videos/{video_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unif.dev/v1/videos/{video_id}")
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{
"id": "vid_01k3m9x7v2q8r4t6y0b1n5d7fa",
"object": "video",
"channel": "tiktok_shop",
"market": "US",
"caption": "<string>",
"url": "<string>",
"cover_url": "<string>",
"duration_seconds": 123,
"published_at": "2023-11-07T05:31:56Z",
"creator": {
"id": "crt_01k3m9x7v2q8r4t6y0b1n5d7fa",
"name": "June",
"handle": "@glowbyjune"
},
"products": [
{
"id": "prd_01k3m9x7v2q8r4t6y0b1n5d7fa",
"title": "Ceramide Barrier Repair Serum 30ml",
"url": "<string>"
}
],
"metrics": {
"views": 123,
"likes": 123,
"comments": 123,
"shares": 123,
"engagement_rate": 123,
"revenue": 123,
"units_sold": 123,
"gpm": 123
},
"currency": "<string>",
"meta": {
"refreshed_at": "2023-11-07T05:31:56Z",
"completeness": 0.5,
"missing_fields": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}Videos
Get a video
GET
https://api.unif.dev/v1
/
videos
/
{video_id}
Get a video
curl --request GET \
--url https://api.unif.dev/v1/videos/{video_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.unif.dev/v1/videos/{video_id}"
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/videos/{video_id}', 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/videos/{video_id}",
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/videos/{video_id}"
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/videos/{video_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unif.dev/v1/videos/{video_id}")
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{
"id": "vid_01k3m9x7v2q8r4t6y0b1n5d7fa",
"object": "video",
"channel": "tiktok_shop",
"market": "US",
"caption": "<string>",
"url": "<string>",
"cover_url": "<string>",
"duration_seconds": 123,
"published_at": "2023-11-07T05:31:56Z",
"creator": {
"id": "crt_01k3m9x7v2q8r4t6y0b1n5d7fa",
"name": "June",
"handle": "@glowbyjune"
},
"products": [
{
"id": "prd_01k3m9x7v2q8r4t6y0b1n5d7fa",
"title": "Ceramide Barrier Repair Serum 30ml",
"url": "<string>"
}
],
"metrics": {
"views": 123,
"likes": 123,
"comments": 123,
"shares": 123,
"engagement_rate": 123,
"revenue": 123,
"units_sold": 123,
"gpm": 123
},
"currency": "<string>",
"meta": {
"refreshed_at": "2023-11-07T05:31:56Z",
"completeness": 0.5,
"missing_fields": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}Authorizations
Send your workspace API key as a bearer token:
Authorization: Bearer unif_sk_live_...
Keys are scoped to a single workspace. See Authentication.
Path Parameters
The Unif ID of the video.
Query Parameters
Convert every monetary field to this ISO 4217 currency.
Examples:
"USD"
"GBP"
"IDR"
Response
The video.
A short-form video with products attached.
Example:
"vid_01k3m9x7v2q8r4t6y0b1n5d7fa"
Allowed value:
"video"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.
Available options:
tiktok_shop Example:
"tiktok_shop"
An ISO 3166-1 alpha-2 country code identifying a channel storefront.
Available options:
US, GB, IE, ES, FR, DE, IT, ID, TH, VN, MY, PH, SG, JP, BR, MX Example:
"US"
How current and how complete this record is.
Was this page helpful?