# Get trend

GET

/v2/workspaces/{workspace\_id}/trends/{trend\_id}

```bash
curl --request GET \
  --url https://api.app.layer.ai/api/v2/workspaces/:workspace_id/trends/:trend_id \
  --header 'Authorization: Bearer <token>'
```

```python
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())
```

```js
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);
}
```

```go
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
<?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;
}
```

```java
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();
```

```ruby
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_body
```

```csharp
var 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);
```

* Layer API

> **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

* **[bearerAuth](/docs/v2/rest-api#bearerauth)**
* **[oauth2](/docs/v2/rest-api#oauth2)**
* **[serviceAccount](/docs/v2/rest-api#serviceaccount)**  
workspace:read

## Parameters 

### Path Parameters

**workspace\_id**

required

_Workspace ID_

ID of the workspace that owns the resource.

string format: uuid

ID of the workspace that owns the resource.

**trend\_id**

required

_Trend ID_

ID of the trend, as returned by the list trends endpoint.

string format: uuid

ID of the trend, as returned by the list trends endpoint.

## Responses 

### 200

Successful Response

_GetTrendOutput_object

**trend\_id**

required

_Trend ID_

The trend’s id; read its full detail with the get-trend call.

string format: uuid

**type**

required

_TrendType_

`creative` for a pattern distilled from mobile game UA video ads, `top` for a public board entry.

string

Allowed values: creative top

**title**

required

_Title_

The name of the trend.

string

**summary**

required

_Summary_

What the trend is and why it works; empty while a board trend’s research runs.

string

**tags**

_Tags_

Descriptive tags.

Array<string>

**genres**

_Genres_

Game genres the trend shows up in.

Array<string>

**countries**

_Countries_

Countries the trend was seen in.

Array<string>

**match\_count**

required

_Match Count_

How many distinct ads show a `creative` trend; 0 for a `top` trend.

integer

**source**

_Source_

Board slug, such as `tiktok`, for a `top` trend.

string

nullable

**rank**

_Rank_

Place on the board’s latest refresh, for a `top` trend.

integer

nullable

**previous\_rank**

_Previous Rank_

Place on the refresh before; null on a `top` trend means it is newly charted.

integer

nullable

**ranked\_at**

_Ranked At_

When the board placement was recorded.

string format: date-time

nullable

**created\_at**

required

_Created At_

When the trend was first recorded.

string format: date-time

**scenario**

_Scenario_

The ad beat by beat, for a `creative` trend.

string

""

**notes**

_Notes_

Why the pattern works and where it fits.

string

nullable

**variants**

_Variants_

Alternative angles on the same pattern, for a `creative` trend.

Array<object>

_TrendVariantOutput_object

**label**

required

_Label_

Short name of the variant.

string

**description**

required

_Description_

How this angle differs from the main pattern.

string

**research**

Any of:

**TrendResearchOutput**

_TrendResearchOutput_object

**summary**

required

_Summary_

What the trend is and which media carries it.

string

**remix\_ideas**

required

_Remix Ideas_

Angles for adapting the trend to game UA video ads.

string

**findings**

_Findings_

Grounded claims.

Array<object>

_TrendResearchFindingOutput_object

**topic**

required

_Topic_

What the finding is about.

string

**finding**

required

_Finding_

The grounded claim.

string

**source\_urls**

_Source URLs_

Pages that back the claim.

Array<string>

**sources**

_Sources_

Pages consulted.

Array<object>

_TrendResearchSourceOutput_object

**title**

required

_Title_

Title of a page the research consulted.

string

**url**

required

_URL_

Address of the page.

string

**videos**

_Videos_

Videos that show the trend.

Array<object>

_TrendResearchVideoOutput_object

**url**

required

_URL_

YouTube address of the video; it is not downloaded.

string

**title**

required

_Title_

Title of the video.

string

**channel**

required

_Channel_

Channel that published it.

string

**duration\_seconds**

_Duration Seconds_

Length of the video; null when unknown.

integer

nullable

**start\_seconds**

required

_Start Seconds_

Start of the part that shows the trend.

integer

**end\_seconds**

required

_End Seconds_

End of the part that shows the trend.

integer

**why**

required

_Why_

What that part demonstrates.

string

**images**

_Images_

Stills that show the trend.

Array<object>

_TrendResearchImageOutput_object

**file\_id**

required

_File ID_

The image as a public file; it is also among the reference files.

string format: uuid

**source\_url**

required

_Source URL_

Page the image was found on.

string

**shows**

required

_Shows_

One line on what the image shows.

string

**uncertainties**

_Uncertainties_

Gaps the research could not close.

Array<string>

**researched\_at**

required

_Researched At_

When the research ran.

string format: date-time

**null**

null

**reference\_files**

_Reference Files_

Public files that show the trend, in display order: the matched ads for a `creative` trend, the research images for a `top` trend.

Array<object>

_TrendReferenceFile_object

**file\_id**

required

_File ID_

Public file to pass by id as generation guidance, such as a reference video or image.

string format: uuid

**url**

required

_URL_

Download URL for the file.

string

**content\_type**

required

_Content Type_

MIME type, e.g. video/mp4 or image/jpeg.

string

**duration\_seconds**

_Duration Seconds_

Length of a video; null when not probed.

number

nullable

**width**

_Width_

Pixel width; null when not probed.

integer

nullable

**height**

_Height_

Pixel height; null when not probed.

integer

nullable

##### Example

```json
{
  "type": "creative",
  "scenario": ""
}
```

### 401

Unauthenticated — missing or invalid Bearer token.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

**field**

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.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE",
  "field": "tileability"
}
```

### 403

Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

**field**

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.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE",
  "field": "tileability"
}
```

### 404

Resource not found.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

**field**

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.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE",
  "field": "tileability"
}
```

### 409

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

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

**field**

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.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE",
  "field": "tileability"
}
```

### 422

Invalid input parameters, or an `Idempotency-Key` reused for a different request.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

**field**

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.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE",
  "field": "tileability"
}
```

### 429

Rate limited — retry after the number of seconds in `Retry-After`.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

**field**

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.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE",
  "field": "tileability"
}
```

### 500

Internal server error.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

**field**

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.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE",
  "field": "tileability"
}
```
