Skip to content

Discover trends

Discovers compact industry/content trends for one URL.

Use this before scoring when you want to inspect the trends or reuse the same trends in a separate score call.

POST /v1/content-intelligence/trends/discover
Header Required Value
Authorization Yes Bearer sw_api_live_...
Content-Type Yes application/json

Required scope:

content_intelligence:trends:discover
Field Type Required Description
url string Yes Page URL to analyze.
extraction_mode string No Accepts ssr, csr, or full. The current one-off endpoint always executes static SSR extraction; the other values remain accepted for compatibility. Defaults to ssr.
language string No Language code. Defaults to en.
country string No Country/market code. Defaults to US.

See Enums for language and country code formats.

Terminal window
curl -s https://api.sleepwalker.ai/v1/content-intelligence/trends/discover \
-H "Authorization: Bearer sw_api_live_..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.sleepwalker.ai",
"language": "en",
"country": "US"
}'

The same request in Python and JavaScript:

Python
import requests
resp = requests.post(
"https://api.sleepwalker.ai/v1/content-intelligence/trends/discover",
headers={"Authorization": "Bearer sw_api_live_..."},
json={
"url": "https://www.sleepwalker.ai",
"language": "en",
"country": "US",
},
)
resp.raise_for_status()
print(resp.json())
JavaScript
const resp = await fetch("https://api.sleepwalker.ai/v1/content-intelligence/trends/discover", {
method: "POST",
headers: {
Authorization: "Bearer sw_api_live_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://www.sleepwalker.ai",
language: "en",
country: "US",
}),
});
const data = await resp.json();
console.log(data);
{
"trend_discovery": {
"url": "https://www.sleepwalker.ai",
"http_status": 200,
"language": "en",
"country": "US",
"industry": "AI visibility software",
"trends": [
{
"topic": "AI visibility monitoring",
"description": "Brands track how AI search engines mention and cite them.",
"relevance": "high",
"opportunity": "Show platform-specific citation gaps."
}
],
"trend_count": 1,
"citations": [],
"citation_count": 0,
"analysis_date": "2026-06-10",
"billing": {
"billable": true,
"estimated_credits": "1.00"
},
"payload_limits": {
"content_view_returned": false,
"raw_extraction_returned": false,
"raw_llm_response_returned": false,
"max_trend_count": 5,
"max_citation_count": 10
}
}
}
  • Trend discovery returns up to 5 trends.
  • Citations are compact and capped.
  • To reuse the result with Score Content, copy trend_discovery.industry and trend_discovery.trends into the score request’s top-level industry and trends fields.

A successful billable trend discovery response costs 1 credit.

If the page is blocked, unavailable, or does not contain enough content, the response includes billing.billable: false.

Status Meaning
400 Invalid URL or unsupported extraction_mode.
401 Missing or invalid API key.
402 Insufficient credits for a billable request.
403 API key is missing content_intelligence:trends:discover.
422 url is missing, or a request field has the wrong type.
503 Credit storage is temporarily unavailable. Try again shortly.

Extraction/provider failures and API-key rate limits are documented in Errors.