API Reference

Programmatic access to AIDRAN's discourse data. All endpoints return JSON and are available under /api/v1.

All endpoints require authentication. Include your API key using either the x-api-key header or the Authorization: Bearer <key> header.

curl -H "x-api-key: YOUR_KEY" \
  https://aidran.ai/api/v1/topics

Using the Authorization header:

curl -H "Authorization: Bearer YOUR_KEY" \
  https://aidran.ai/api/v1/topics
https://aidran.ai/api/v1

All endpoint paths below are relative to this base URL. Responses are JSON with Content-Type: application/json.

GET/api/v1/topics

Returns all active editorial topics with metadata including display names, descriptions, categories, keywords, and tracked subreddits.

Query Parameters

ParameterTypeDescription
activebooleanFilter by active status. Defaults to true.

Response: Returns { topics: [...], count: number }

GET/api/v1/discourse

Paginated access to discourse records with filtering by source platform, topic, and date range. Returns full record data including analysis results.

Query Parameters

ParameterTypeDescription
sourcestringFilter by platform: "reddit", "bluesky", or "gdelt".
topicstringFilter by topic slug.
sinceISO 8601Records captured after this date.
untilISO 8601Records captured before this date.
limitintegerResults per page. Default 50, max 100.
offsetintegerPagination offset. Default 0.

Response: Returns { data: [...], pagination: { total, limit, offset, hasMore } }

GET/api/v1/search

Search discourse records using Voyage AI embeddings and pgvector. Returns results ranked by semantic similarity to your query.

Query Parameters

ParameterTypeDescription
qrequiredstringSearch query. Max 500 characters.
sourcestringFilter by platform: "reddit", "bluesky", or "gdelt".
topicstringFilter by topic slug.
daysintegerLimit to records from the last N days.
limitintegerMax results. Default 20, max 50.
GET/api/v1/signals

Signals detected by the analysis pipeline: volume spikes, sentiment shifts, emerging narratives, and cross-platform divergences.

Query Parameters

ParameterTypeDescription
topicstringFilter by topic slug.
severitystringFilter by severity level.
sinceISO 8601Signals detected after this date.
limitintegerResults per page. Default 50, max 100.
offsetintegerPagination offset. Default 0.

Response: Returns { data: [...], pagination: { total, limit, offset, hasMore } }

GET/api/v1/entities

Named entities extracted from discourse analysis, aggregated by mention count. Returns the most frequently mentioned entities across tracked records.

Query Parameters

ParameterTypeDescription
topicstringFilter by topic slug. Defaults to all topics.
sinceISO 8601Aggregate from this date. Defaults to 7 days ago.
limitintegerMax entities returned. Default 50, max 200.

Response: Returns { data: [{ name, mentions, types }], count, params }

GET/api/v1/clusters

Narrative clusters from the latest clustering analysis. Groups related discourse into coherent narrative threads with labels and top terms.

Query Parameters

ParameterTypeDescription
topicstringFilter by topic slug.
limitintegerMax clusters returned. Default 50, max 100.

Response: Returns { data: [...], count: number }

GET/api/v1/trends

Daily discourse volume counts for a specific topic, along with external trend signals from sources like Google Trends.

Query Parameters

ParameterTypeDescription
topicrequiredstringTopic slug. Required.
daysintegerNumber of days to look back. Default 30.

Response: Returns { topic, days, volume: [{ day, count }], externalTrends: [...] }

Errors return a JSON object with an error field describing the issue.

// 400 Bad Request — missing required parameter
{ "error": "q parameter is required" }

// 401 Unauthorized — missing or invalid API key
{ "error": "Invalid or missing API key" }

// 503 Service Unavailable — API keys not configured
{ "error": "API access not configured" }

// 500 Internal Server Error
{ "error": "Search failed" }
StatusMeaning
200Success. Response body contains the requested data.
400Bad request. A required parameter is missing or invalid.
401Unauthorized. API key is missing or invalid.
500Internal error. Try again or contact support.
503Service unavailable. API keys not yet configured on server.

AIDRAN's API is available to researchers, journalists, and developers working with AI discourse data. To request an API key, reach out with a brief description of your use case.

Request an API Key