The analyze endpoint runs CogNerd’s full brand intelligence pipeline against your brand and streams progress and results back in real time using Server-Sent Events (SSE). Each call costs 30 credits and is validated before the pipeline starts. The stream delivers incremental progress events as each stage completes, followed by a final result containing your AI visibility score, platform breakdown, competitor rankings, sentiment, alerts, source attribution, and prompt analytics.Documentation Index
Fetch the complete documentation index at: https://docs.cognerd.in/llms.txt
Use this file to discover all available pages before exploring further.
This endpoint uses Server-Sent Events (SSE), not standard JSON. The response content type is
text/event-stream. Use fetch with a streaming reader in JavaScript, or curl with --no-buffer in the terminal. Do not call this endpoint with a standard REST client expecting a JSON body.Endpoint
Request headers
Your API token in the format
Bearer YOUR_TOKEN. Obtain this from your CogNerd account settings.Must be
application/json.Set to
text/event-stream to receive SSE output. If omitted, most HTTP clients will still receive the stream but may buffer it.Request body
The full URL of the brand to analyze, including scheme (e.g.,
https://yoursite.com). CogNerd scrapes this URL to extract brand metadata before running analysis. Provide either brandUrl or brandName, not both.The brand name to analyze, used when you do not have a URL or want to analyze a brand by name only. CogNerd uses this name directly in prompt generation and scoring.
An optional array of pre-built prompt objects to use instead of auto-generated prompts. If omitted, CogNerd generates up to 4 prompts automatically based on your brand, industry, and competitors.
An optional list of competitor brands to track. If provided, CogNerd uses this list instead of identifying competitors automatically via AI. Maximum 8 competitors.
When
true, CogNerd runs each prompt through AI providers with live web search enabled (where the provider supports it). This produces more up-to-date results but may increase analysis time.An optional seed query to prepend to the generated prompt list. Useful for anchoring the analysis around a specific question or topic relevant to your brand’s audience.
SSE event stream
The response is a stream of newline-delimited SSE events. Each event has the format:Pipeline stages
| Stage | Description |
|---|---|
initializing | Pipeline has started. Credit check passed. |
identifying-competitors | CogNerd is identifying your competitors via AI or using your provided list. |
generating-prompts | Prompts are being generated or validated. |
analyzing-prompts | Each prompt is being sent to every configured AI provider. |
calculating-scores | Visibility scores and competitor rankings are being computed. |
finalizing | Analysis is complete. Final result is about to be emitted. |
Event types
The type of SSE event. Possible values:
start— Pipeline has begun.stage— A new pipeline stage has started. Includesstagename andprogress(0–100).progress— Progress update within a stage. Includesprogress(0–100) and a human-readablemessage.competitor-found— A competitor was identified. Includescompetitorname,index, andtotal.prompt-generated— A prompt was generated. Includesprompttext,category,index, andtotal.prompt-dequeued— A prompt has started processing across all providers.analysis-start— A specific provider has started analyzing a prompt.analysis-complete— A specific provider finished analyzing a prompt.statusiscompletedorfailed.partial-result— A provider returned a result for one prompt. ContainsbrandMentioned,brandPosition, andsentiment.prompt-complete— All providers finished a prompt successfully.prompt-failed— All or some providers failed for a prompt.scoring-start— Competitor scoring has started for one competitor.result— Final analysis result. Contains the full structured output described below.error— A fatal error occurred and the stream is closing.
Final result event
When the pipeline finishes, a result event is emitted containing the complete analysis object.
High-level mention and score summary.
Detailed visibility metrics broken down by time and platform.
Competitor ranking data.
Automatically generated alerts based on analysis results.
Source attribution data mapping AI citations back to specific pages on your site.
Analytics for each prompt used in the analysis.
true if a previous analysis run was interrupted before completing. When present, the dashboard displays a recovery banner.Error responses
| Status | Meaning |
|---|---|
400 | Invalid or missing request body. Check that brandUrl or brandName is provided. |
401 | Missing or invalid Authorization header. |
402 | Insufficient credits. You need at least 30 credits to run an analysis. |
500 | Internal server error. The stream may emit an error event before closing. |