Skip to main content

Narratives

Narrative endpoints answer why: they attach a written summary or theme, with source links, to a market move.

EndpointReturns
GET /v2/data/event-summaryWritten event summaries for keyword mentions in a window, with source links. 5 credits.
GET /v2/data/trending-narrativesWritten trending narratives from Twitter mentions, with source links. 5 credits.

Event Summary​

GET /v2/data/event-summary generates event summaries from keyword mentions within a time period. It costs 5 credits per request, or 1 when it returns 503.

Sample response (from the spec example):

{
"success": true,
"data": [
{ "tweetIds": ["string"], "sourceLinks": ["string"], "summary": "string" }
]
}

Request:

curl "https://api.elfa.ai/v2/data/event-summary?keywords=bitcoin,etf&timeWindow=24h&searchType=or" \
-H "x-elfa-api-key: $ELFA_API_KEY"
FieldTypeMeaning
data[].summarystringWritten summary of one event.
data[].sourceLinksstring[]Links to the posts behind the summary.
data[].tweetIdsstring[]IDs of the posts behind the summary.
ParameterRequiredTypeMeaning
keywordsYesstringKeywords to search for, separated by commas.
timeWindowNostringWindow ending now, e.g. 30m, 1h, 4h, 24h, 7d, 30d. Default 7d.
fromNonumberStart of the window, unix timestamp.
toNonumberEnd of the window, unix timestamp.
searchTypeNostringHow keywords combine: and or or. Default or.

Cost​

5 credits per request. It replaces an ingest, dedupe, clustering and summarization pipeline you would otherwise run.

Uses​

  • Learn what happened in a window without reading every post.
  • Fill a digest, alert or client note; source links travel with each summary.

Also via x402: GET /x402/v2/data/event-summary

Trending Narratives​

GET /v2/data/trending-narratives returns trending narratives based on analysis of Twitter mentions. It costs 5 credits per request.

Sample response (from the spec example):

{
"success": true,
"data": {
"metadata": { "error": "string", "total_tweets": 1, "total_narratives": 1 },
"trending_narratives": [
{ "tweet_ids": ["string"], "source_links": ["string"], "narrative": "string" }
]
}
}

Request:

curl "https://api.elfa.ai/v2/data/trending-narratives?timeFrame=day&maxNarratives=1&maxTweetsPerNarrative=1" \
-H "x-elfa-api-key: $ELFA_API_KEY"
FieldTypeMeaning
data.trending_narratives[].narrativestringWritten narrative.
data.trending_narratives[].source_linksstring[]Links to the posts behind the narrative.
data.trending_narratives[].tweet_idsstring[]IDs of the posts behind the narrative.
data.metadata.total_narrativesnumberNarratives returned.
data.metadata.total_tweetsnumberNot described in the spec.
data.metadata.errorstringNot described in the spec.
ParameterRequiredTypeMeaning
timeFrameNostringday or week. Default day.
maxNarrativesNonumberMaximum narratives to return, 1 to 20. Default 7.
maxTweetsPerNarrativeNonumberMaximum posts per narrative, 1 to 20. Default 5.

Cost and Access​

5 credits per request. With an API key it requires Grow and above or PAYG. It is also available through x402 pay-per-request.

Uses​

  • See the theme one level above individual tokens. Narratives often move before the tokens inside them.
  • Condition an agent on the prevailing market story instead of one strategy for every market.

Also via x402: GET /x402/v2/data/trending-narratives

Choosing Between Them​

NeedEndpoint
Evidence that news exists for a token moveToken news
A source-backed summary for a keyword windowEvent summary
The themes currently winning market attentionTrending narratives
A feed of events as they happen, threaded into storylinesAPI v3 Events

Errors​

StatusEndpointWhat it meansWhat to do
503Event summaryThe matched posts could not be processed into summaries. Not an empty result: a quiet window is a 200 with an empty data. Costs 1 credit, not 5Retry, or narrow the keywords or the time window
503Trending narrativesTrending narratives are temporarily unavailable. Not an empty result. Not declared in the spec, so a generated client has no branch for itRetry with backoff

For every other status, see Enums and Errors.