Get a brand's ad creatives
curl --request POST \
--url https://app.spyglass.so/api/v1/brands/{id}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "smart",
"userRequest": "video ads about comfort",
"limit": 20
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mode: 'smart', userRequest: 'video ads about comfort', limit: 20})
};
fetch('https://app.spyglass.so/api/v1/brands/{id}/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.spyglass.so/api/v1/brands/{id}/media"
payload = {
"mode": "smart",
"userRequest": "video ads about comfort",
"limit": 20
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"count": 123,
"media": [
{
"id": "<string>",
"title": "<string>",
"type": "DPA",
"mediaType": "VIDEO",
"mediaUrl": "<string>",
"thumbnailUrl": "<string>",
"platforms": [
"<string>"
],
"hook": "<string>",
"startAt": "<string>",
"endAt": "<string>",
"daysRun": 123,
"categories": [
"<string>"
],
"carouselCount": 123,
"viewCount": 123,
"likeCount": 123,
"commentCount": 123,
"impressionPercentile": 123,
"impressionsText": "<string>"
}
]
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}Ads
Get a brand's ad creatives
Return creatives for a brand. mode: "structured" derives filters
from userRequest; mode: "smart" also runs a semantic search.
Limited to 120 requests per minute for this endpoint.
Costs 1,000 microdollars ($0.0010) per creative returned, charged against your plan’s monthly credits. The count field is what you were charged for.
Both modes run a language model, so the call bills a minimum of one
row even when nothing matches. In that case count is 0 but you
are charged for one row.
POST
/
brands
/
{id}
/
media
Get a brand's ad creatives
curl --request POST \
--url https://app.spyglass.so/api/v1/brands/{id}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "smart",
"userRequest": "video ads about comfort",
"limit": 20
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mode: 'smart', userRequest: 'video ads about comfort', limit: 20})
};
fetch('https://app.spyglass.so/api/v1/brands/{id}/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.spyglass.so/api/v1/brands/{id}/media"
payload = {
"mode": "smart",
"userRequest": "video ads about comfort",
"limit": 20
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"count": 123,
"media": [
{
"id": "<string>",
"title": "<string>",
"type": "DPA",
"mediaType": "VIDEO",
"mediaUrl": "<string>",
"thumbnailUrl": "<string>",
"platforms": [
"<string>"
],
"hook": "<string>",
"startAt": "<string>",
"endAt": "<string>",
"daysRun": 123,
"categories": [
"<string>"
],
"carouselCount": 123,
"viewCount": 123,
"likeCount": 123,
"commentCount": 123,
"impressionPercentile": 123,
"impressionsText": "<string>"
}
]
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}Authorizations
An API key from Settings → API, prefixed sg_live_.
Path Parameters
Brand id returned by POST /brands/search.
Body
application/json