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.
Endpoint
Section titled “Endpoint”POST /v1/content-intelligence/trends/discoverAuthentication
Section titled “Authentication”| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer sw_api_live_... |
Content-Type | Yes | application/json |
Required scope:
content_intelligence:trends:discoverRequest Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Page URL to analyze. |
extraction_mode | string | No | Optional extraction profile. Omit unless instructed otherwise. |
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.
Example Request
Section titled “Example Request”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:
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())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);Response
Section titled “Response”{ "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": { "max_trends": 5, "max_citations": 10 } }}- Trend discovery returns up to 5 trends.
- Citations are compact and capped.
- The output can be passed directly to Score Content.
Credits
Section titled “Credits”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.
Errors
Section titled “Errors”| Status | Meaning |
|---|---|
400 | Invalid URL or request body. |
401 | Missing or invalid API key. |
402 | Insufficient credits for a billable request. |
403 | API key is missing content_intelligence:trends:discover. |
503 | Page extraction is temporarily unavailable. |