API Integration

The Gloria Data Platform provides three ways to access curated crypto news and market intelligence:

  • REST API — Query historical and recent news, recaps, narratives, and articles

  • WebSocket API — Stream real-time news as it's published

  • x402 API — Pay-per-request access via micropayments (no account needed) — see x402 Integration

Base URL: https://ai-hub.cryptobriefing.com


Authentication

Generate tokens at itsgloria.ai/api-keys-newarrow-up-right. Each token is scoped to specific feed categories selected during creation.

Pass your token in one of two ways:

# Query parameter
curl "https://ai-hub.cryptobriefing.com/news?token=YOUR_TOKEN&feed_categories=crypto"

# Authorization header
curl -H "Authorization: Bearer YOUR_TOKEN" "https://ai-hub.cryptobriefing.com/news?feed_categories=crypto"

Wallet Authentication

For programmatic access, authenticate with an Ethereum wallet using SIWE (Sign-In with Ethereum):

  1. Get nonce: GET /auth/nonce → returns {"nonce": "..."}

  2. Sign & verify: POST /auth/verify with {"message": "<SIWE message>", "signature": "<hex>"} → returns {"access_token": "...", "is_admin": false}

  3. Use the returned JWT as your token.

Public Token

For anonymous read-only access: GET /auth/public-token → returns {"access_token": "..."}.

Feed Permissions

Each token is associated with permissions for specific feed categories. If you request a feed category not in your allowed list, the request will fail with a 403 Forbidden response.


News API

GET /news

Retrieve news items with filtering and pagination.

Query Parameters

Parameter
Type
Description

token

string

Authorization token (alternative to Authorization header).

feed_categories

string

Comma-separated category codes (e.g. crypto,ai_agents). Use token_listings for exchange listings only. If omitted, returns all sources.

from_date

string

Optional. Start date in YYYY-MM-DD format.

to_date

string

Optional. End date in YYYY-MM-DD format.

keyword

string

Optional. Text search filter.

page

number

Optional. Page number for pagination. Defaults to 1.

limit

number

Optional. Number of items per page. Defaults to 20.

Response Format

The API returns an array of feed items in JSON format:

Response Fields

Field
Type
Description

id

string

Unique identifier for the news item.

signal

string

Processed headline of the news item.

sentiment

string

Tone of the news: bullish, bearish, or neutral.

sentiment_value

number

Sentiment confidence score (0.0 to 1.0).

timestamp

number

Unix timestamp (seconds) of when the item was processed.

feed_categories

string[]

Feed categories the news item belongs to.

short_context

string

One-line summary of the broader context.

long_context

string

Expanded context including related events, background, and significance.

sources

string[]

Source URLs and citations used for context enrichment.

author

string

The primary source (X/Twitter handle).

tokens

string[]

Mentioned token symbols (e.g. $BTC, $ETH).

tweet_url

string

Direct link to the original post on X.

narrative_id

string | null

ID of the narrative (story arc) this item belongs to, if any.

Status Codes

Status Code
Description

200

Success

400

Bad Request (invalid parameters)

401

Unauthorized (missing or invalid token)

403

Forbidden (token does not have permission for the requested feed)

404

Not Found (no data found for the specified parameters)

Example Requests

cURL

JavaScript


GET /news/{id}

Retrieve a single news item by its unique ID.

Returns a single object with the same fields as the /news response.


GET /news-ticker-summary

Generate an AI-powered 24-hour summary for a specific token or project.

Query Parameters

Parameter
Type
Description

token

string

Authorization token.

ticker

string

Required. Token symbol or name (e.g. SOL, LayerZero, ZRO).

Example

Response


Recaps API

GET /recaps

Retrieve an AI-generated summary of the most significant news from a given time window.

Query Parameters

Parameter
Type
Description

token

string

Authorization token.

feed_category

string

Category code to get the recap for (e.g. crypto, macro).

timeframe

string

News collection window. Available options: 12h, 24h. High-frequency categories (crypto, macro) use 12h; others use 24h. See table below.

Recap Timeframes by Category

Timeframe
Categories

12h

ai, ai_agents, crypto, defi, machine_learning, macro, tech, virtuals

24h

base, bitcoin, dats, ethereum, hyperliquid, on_chain_whale, perps, ripple, rwa, solana

Response Format

Response Fields

Field
Type
Description

feed_category

string

The category the recap was generated for.

timeframe

string

The news collection window.

recap

string

The recap content.

created_at

string

ISO 8601 timestamp of when the recap was generated.

Example Requests

cURL

JavaScript


Narratives API

Narratives group related news items into story arcs — for example, all coverage of a single developing story across multiple sources and timeframes.

GET /narratives

Retrieve all active narratives.

Response Format

Response Fields

Field
Type
Description

narrative_id

string

Unique identifier for the narrative.

updated_at

string

ISO 8601 timestamp of the last update.

tag

string

Short descriptive headline for the narrative.

summary

string

Prose summary of the narrative arc.

content

array

Array of news items in this narrative (same schema as /news response).

GET /narratives/{id}

Retrieve a single narrative by ID.


Articles API

GET /articles

Retrieve AI-generated long-form articles with optional filtering.

Query Parameters

Parameter
Type
Description

token

string

Authorization token.

limit

number

Optional. Results per page (1–100). Defaults to 20.

page

number

Optional. Page number. Defaults to 1.

category

string

Optional. Filter by category.

search

string

Optional. Search in headline and content.

type

string

Optional. Filter by article type.

Response Format

GET /articles/{article_id}

Retrieve a single article by ID.


Feed Categories

GET /available-feed-categories

List all available feed categories. No authentication required.

Response

For detailed category descriptions, see Categories.


News WebSocket API

Overview

The WebSocket API provides real-time news updates. Subscribe to specific feed categories and receive items as they are published.

Connection

Client to Server Messages

Subscribe to a Feed

The server responds with a confirmation:

Unsubscribe from a Feed

Server to Client Messages

Welcome Message

Upon successful connection:

Data Message

When new content is available in a subscribed feed:

The content object has the same schema as items returned by the /news endpoint.

Error Message

Ping/Pong

The server sends ping messages every 30 seconds. Respond with pong to keep the connection alive:

Message Types

Type
Direction
Description

connected

Server → Client

Connection established

subscribe

Client → Server

Subscribe to a feed category

subscribed

Server → Client

Subscription confirmed

unsubscribe

Client → Server

Unsubscribe from a feed category

unsubscribed

Server → Client

Unsubscription confirmed

data

Server → Client

News item (same schema as REST API)

error

Server → Client

Error message

ping

Server → Client

Keep-alive ping (every 30s)

pong

Client → Server

Keep-alive response

Connection Lifecycle

  1. Connect with a valid token

  2. Receive the welcome message

  3. Subscribe to desired feeds

  4. Receive real-time updates

  5. Respond to ping messages to keep the connection alive

  6. Unsubscribe when no longer interested

  7. Connection auto-closes after 5 minutes of inactivity

Error Handling

The server may close the connection with the following status codes:

  • 1000: Normal closure (server shutting down or inactive connection)

  • 1008: Policy violation (missing or invalid token)

Client Example (JavaScript)


Status Codes

Code
Description

200

Success

400

Bad Request (invalid parameters)

401

Unauthorized (missing or invalid token)

402

Payment Required (x402 only)

403

Forbidden (token lacks permission for requested feed)

404

Not Found (no data for specified parameters)

500

Internal Server Error

Last updated