Get a prediction
curl --request GET \
--url https://api.lumisreach.com/api/v1/predictions/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.lumisreach.com/api/v1/predictions/{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.lumisreach.com/api/v1/predictions/{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.lumisreach.com/api/v1/predictions/{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.lumisreach.com/api/v1/predictions/{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.lumisreach.com/api/v1/predictions/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lumisreach.com/api/v1/predictions/{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{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "processing",
"format": "video",
"platforms": [
"tiktok"
],
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"error": "<string>",
"price_cents": 0,
"charged": true,
"result": {
"overall_score": 0,
"overall_score_parts": [
{
"label": "<string>",
"chance": 123,
"weight": 123
}
],
"basis": "history",
"quality": {
"overall": 123,
"hook": {
"score": 123,
"reason": "<string>"
},
"script": {
"score": 123,
"reason": "<string>"
},
"video": {
"score": 123,
"reason": "<string>"
},
"source": "watch"
},
"platforms": [
{
"platform": "tiktok",
"model_version": "<string>",
"percentile": 123,
"relative": {
"likes": {
"low": 123,
"expected": 123,
"high": 123
},
"comments": {
"low": 123,
"expected": 123,
"high": 123
},
"engagement": {
"low": 123,
"expected": 123,
"high": 123
},
"views": {
"low": 123,
"expected": 123,
"high": 123
},
"reposts": {
"low": 123,
"expected": 123,
"high": 123
},
"conversion": {
"low": 123,
"expected": 123,
"high": 123
}
},
"predicted": {
"views": {
"low": 123,
"expected": 123,
"high": 123
},
"likes": {
"low": 123,
"expected": 123,
"high": 123
},
"comments": {
"low": 123,
"expected": 123,
"high": 123
},
"engagement": {
"low": 123,
"expected": 123,
"high": 123
},
"buying_intent_comments": {
"low": 123,
"expected": 123,
"high": 123
}
},
"drivers": [
{
"label": "<string>",
"impact": 123,
"detail": "<string>"
}
],
"history_posts": 0
}
],
"total": {
"views": {
"low": 123,
"expected": 123,
"high": 123
},
"likes": {
"low": 123,
"expected": 123,
"high": 123
},
"comments": {
"low": 123,
"expected": 123,
"high": 123
},
"engagement": {
"low": 123,
"expected": 123,
"high": 123
}
},
"likely_comments": [
{
"author": "<string>",
"text": "<string>",
"tone": "positive"
}
],
"tips": [
"<string>"
]
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {},
"doc_url": "<string>"
}
}Predictions
Get a prediction
A prediction’s status and, once succeeded, its result: the overall score, the quality scores, each platform’s percentile, counts and drivers, the likely comments and tips. A failed one says why in error; send it again once that is fixed. Poll every 5 to 10 seconds.
GET
/
v1
/
predictions
/
{id}
Get a prediction
curl --request GET \
--url https://api.lumisreach.com/api/v1/predictions/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.lumisreach.com/api/v1/predictions/{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.lumisreach.com/api/v1/predictions/{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.lumisreach.com/api/v1/predictions/{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.lumisreach.com/api/v1/predictions/{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.lumisreach.com/api/v1/predictions/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lumisreach.com/api/v1/predictions/{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{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "processing",
"format": "video",
"platforms": [
"tiktok"
],
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"error": "<string>",
"price_cents": 0,
"charged": true,
"result": {
"overall_score": 0,
"overall_score_parts": [
{
"label": "<string>",
"chance": 123,
"weight": 123
}
],
"basis": "history",
"quality": {
"overall": 123,
"hook": {
"score": 123,
"reason": "<string>"
},
"script": {
"score": 123,
"reason": "<string>"
},
"video": {
"score": 123,
"reason": "<string>"
},
"source": "watch"
},
"platforms": [
{
"platform": "tiktok",
"model_version": "<string>",
"percentile": 123,
"relative": {
"likes": {
"low": 123,
"expected": 123,
"high": 123
},
"comments": {
"low": 123,
"expected": 123,
"high": 123
},
"engagement": {
"low": 123,
"expected": 123,
"high": 123
},
"views": {
"low": 123,
"expected": 123,
"high": 123
},
"reposts": {
"low": 123,
"expected": 123,
"high": 123
},
"conversion": {
"low": 123,
"expected": 123,
"high": 123
}
},
"predicted": {
"views": {
"low": 123,
"expected": 123,
"high": 123
},
"likes": {
"low": 123,
"expected": 123,
"high": 123
},
"comments": {
"low": 123,
"expected": 123,
"high": 123
},
"engagement": {
"low": 123,
"expected": 123,
"high": 123
},
"buying_intent_comments": {
"low": 123,
"expected": 123,
"high": 123
}
},
"drivers": [
{
"label": "<string>",
"impact": 123,
"detail": "<string>"
}
],
"history_posts": 0
}
],
"total": {
"views": {
"low": 123,
"expected": 123,
"high": 123
},
"likes": {
"low": 123,
"expected": 123,
"high": 123
},
"comments": {
"low": 123,
"expected": 123,
"high": 123
},
"engagement": {
"low": 123,
"expected": 123,
"high": 123
}
},
"likely_comments": [
{
"author": "<string>",
"text": "<string>",
"tone": "positive"
}
],
"tips": [
"<string>"
]
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"fields": {},
"doc_url": "<string>"
}
}