Get trend
Viewing v2, the current version
curl --request GET \ --url https://api.app.layer.ai/api/v2/workspaces/:workspace_id/trends/:trend_id \ --header 'Authorization: Bearer <token>'import requests
url = "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/trends/:trend_id"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.json())const url = 'https://api.app.layer.ai/api/v2/workspaces/:workspace_id/trends/:trend_id';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/trends/:trend_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(res) fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/trends/:trend_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;}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/trends/:trend_id") .get() .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();require 'uri'require 'net/http'
url = URI("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/trends/:trend_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_bodyvar client = new RestClient("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/trends/:trend_id");var request = new RestRequest("", Method.Get);request.AddHeader("Authorization", "Bearer <token>");var response = client.Execute(request);New in v2. This endpoint has no v1 equivalent.
Get a trend’s full detail: its scenario and variants for a creative trend, its web research for a top trend, and the public reference files that show it, each with a download URL. Pass a reference file_id as guidance to make an asset in the trend’s style.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”ID of the workspace that owns the resource.
ID of the workspace that owns the resource.
ID of the trend, as returned by the list trends endpoint.
ID of the trend, as returned by the list trends endpoint.
Responses
Section titled “ Responses ”Successful Response
object
The trend’s id; read its full detail with the get-trend call.
creative for a pattern distilled from mobile game UA video ads, top for a public board entry.
The name of the trend.
What the trend is and why it works; empty while a board trend’s research runs.
Descriptive tags.
Game genres the trend shows up in.
Countries the trend was seen in.
How many distinct ads show a creative trend; 0 for a top trend.
Board slug, such as tiktok, for a top trend.
Place on the board’s latest refresh, for a top trend.
Place on the refresh before; null on a top trend means it is newly charted.
When the board placement was recorded.
When the trend was first recorded.
The ad beat by beat, for a creative trend.
Why the pattern works and where it fits.
Alternative angles on the same pattern, for a creative trend.
object
Short name of the variant.
How this angle differs from the main pattern.
object
What the trend is and which media carries it.
Angles for adapting the trend to game UA video ads.
Grounded claims.
object
What the finding is about.
The grounded claim.
Pages that back the claim.
Pages consulted.
object
Title of a page the research consulted.
Address of the page.
Videos that show the trend.
object
YouTube address of the video; it is not downloaded.
Title of the video.
Channel that published it.
Length of the video; null when unknown.
Start of the part that shows the trend.
End of the part that shows the trend.
What that part demonstrates.
Stills that show the trend.
object
The image as a public file; it is also among the reference files.
Page the image was found on.
One line on what the image shows.
Gaps the research could not close.
When the research ran.
Public files that show the trend, in display order: the matched ads for a creative trend, the research images for a top trend.
object
Public file to pass by id as generation guidance, such as a reference video or image.
Download URL for the file.
MIME type, e.g. video/mp4 or image/jpeg.
Length of a video; null when not probed.
Pixel width; null when not probed.
Pixel height; null when not probed.
Example
{ "type": "creative", "scenario": ""}Unauthenticated — missing or invalid Bearer token.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Resource not found.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}The outcome of the request with this Idempotency-Key is not known yet: it is still running, or it failed without a stored response. Retry after the number of seconds in Retry-After.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Invalid input parameters, or an Idempotency-Key reused for a different request.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Rate limited — retry after the number of seconds in Retry-After.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}Internal server error.
object
Machine-readable error code: the last path segment of type.
The request field the error is about, by its name in the body (on a tool run, in input), on the errors that name one: so far the value a Layer tool fixes on an INFERENCE_TOOL_PIN_MISMATCH, and the scale factor on an INFERENCE_TOOL_UPSCALE_COPIES_SOURCE. Absent otherwise, even when detail names a field.
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description.", "error_code": "ERROR_CODE", "field": "tileability"}