Skip to main content

News & Widget API Guide

The News API provides access to financial news articles across multiple languages. Query articles with full-text search, date ranges, and topic filters. The Widget API is a lightweight, CORS-enabled endpoint designed for embedding a news feed directly into third-party websites via a JavaScript widget or custom integration.

Both APIs authenticate with an API key sent in the x-api-key header.

Base URL: https://wingnews.theinvestinsight.com/api


Authentication​

API Key​

All requests require an API key passed in the x-api-key header.

x-api-key: na_live_abc123...

Domain Whitelisting​

API keys can optionally enforce domain restrictions. When enabled, the server validates the Origin (or Referer) header against the key's allowed domain list.

Wildcard patterns are supported:

PatternMatches
example.comExact match only
*.example.comAny subdomain (app.example.com, cdn.example.com)

If the requesting domain is not in the list, the API returns 403 Forbidden.

Rate Limiting​

Each API key has a per-hour token budget.

Header / StatusDescription
429 Too Many RequestsBudget exhausted — wait and retry
503 Service UnavailableRate-limit service temporarily down

News API​

Full-featured endpoint for server-to-server integrations. Supports text search, sorting, and both cursor and offset pagination.

List Articles​

Retrieve a paginated list of refined news articles.

GET /api/news

Query Parameters

ParameterTypeDefaultDescription
qstring—Full-text search across title and summary (case-insensitive)
langstring—Language code (e.g. es, zh, ja)
tagsstring[]—Filter by topics (repeatable: tags=finance&tags=crypto)
fromstring—Start date, ISO-8601 (e.g. 2026-01-01T00:00:00Z)
tostring—End date, ISO-8601 (e.g. 2026-01-31T23:59:59Z)
sortFieldstringpublishedAtSort by publishedAt or title
sortOrderstringdescasc or desc
cursorstring—Cursor token for cursor-based pagination
offsetnumber0Offset for offset-based pagination (min: 0)
limitnumber20Items per page (min: 1, max: 100)

Pagination: Supply either cursor or offset, not both. Cursor-based is recommended for infinite-scroll UIs; offset-based for numbered pages.

Example Request

GET /api/news?q=inflation&lang=es&tags=markets&from=2026-02-01T00:00:00Z&limit=10

Response

{
"items": [
{
"id": "cm6xk9abc000108l4",
"title": "Fed Signals Continued Caution on Inflation",
"summary": "Federal Reserve officials indicated they remain cautious about inflation trends...",
"content": "<p>Federal Reserve officials indicated they remain cautious...</p>",
"image": {
"original": "https://cdn.example.com/images/abc123.jpg",
"large": "https://cdn.example.com/images/abc123-large.jpg",
"medium": "https://cdn.example.com/images/abc123-medium.jpg",
"thumbnail": "https://cdn.example.com/images/abc123-thumbnail.jpg"
},
"language": "es",
"publishedAt": "2026-02-15T09:30:00.000Z",
"topics": ["markets", "federal-reserve", "inflation"]
}
],
"pagination": {
"cursor": "cm6xk9abc000208l4",
"hasMore": true,
"total": 245
}
}

Get Article​

Retrieve a single article by ID.

GET /api/news/:id

Path Parameters

ParameterTypeDescription
idstringArticle ID

Response — A single Article object.

Returns 404 if the article doesn't exist.


Get Available Languages​

Retrieve the list of languages that currently have published articles. Use these codes with the lang filter.

GET /api/news/cultures

Response

[
{ "code": "ar", "name": "Arabic" },
{ "code": "de", "name": "German" },
{ "code": "es", "name": "Spanish" },
{ "code": "fr", "name": "French" },
{ "code": "hu", "name": "Hungarian" },
{ "code": "id", "name": "Indonesian" },
{ "code": "it", "name": "Italian" },
{ "code": "ja", "name": "Japanese" },
{ "code": "pt", "name": "Portuguese" },
{ "code": "ru", "name": "Russian" },
{ "code": "tr", "name": "Turkish" },
{ "code": "vi", "name": "Vietnamese" },
{ "code": "zh", "name": "Chinese" }
]

The list only includes languages with at least one completed, refined article. Sorted alphabetically by name.


Widget API​

Lightweight endpoint for client-side integrations and the embeddable JavaScript widget. CORS is fully open, however security is enforced through API key domain whitelisting.

List Widget Articles​

GET /api/v1/widget/news

Query Parameters

ParameterTypeDefaultDescription
langstring—Language code (e.g. es, ja)
fromstring—Start date, ISO-8601
tostring—End date, ISO-8601
topicsstring[]—Filter by topics (repeatable or comma-separated)
cursorstring—Cursor for infinite scroll pagination
offsetnumber0Offset for numbered page pagination
limitnumber20Items per page (min: 1, max: 100)

Example Request

GET /api/v1/widget/news?lang=es&topics=crypto&limit=5

Response — Same shape as News API list response.


Get Widget Article​

GET /api/v1/widget/news/:id

Path Parameters

ParameterTypeDescription
idstringArticle ID

Response — A single Article object. Returns 404 if not found.


Data Reference​

Article Object​

FieldTypeDescription
idstringUnique article ID
titlestringArticle headline
summarystringShort excerpt / summary
contentstring | nullFull HTML content (null if unavailable)
imageobject | nullImage object with size variants
languagestringISO language code (e.g. es, zh)
publishedAtstringPublication timestamp (ISO-8601)
topicsstring[]Topic tags (e.g. ["markets", "crypto"])

Image Object​

Each article can have an image served in multiple sizes for responsive loading.

FieldTypeDescription
originalstringFull-resolution image URL
largestringLarge variant (approximately 1/2 original size)
mediumstringMedium variant (approximately 1/3 original size)
thumbnailstringThumbnail variant (approximately 1/4 original size)

URL Pattern: Variant URLs are derived from the original by appending a size suffix before the extension.

Original:  https://cdn.example.com/images/abc123.jpg
Large: https://cdn.example.com/images/abc123-large.jpg
Medium: https://cdn.example.com/images/abc123-medium.jpg
Thumbnail: https://cdn.example.com/images/abc123-thumbnail.jpg

Pagination Object​

All list endpoints return pagination metadata alongside results.

{
"items": [],
"pagination": {
"cursor": "cm6xk9abc000208l4",
"hasMore": true,
"total": 245
}
}
FieldTypeDescription
cursorstring | nullToken to fetch the next page (null if no more pages)
hasMorebooleanWhether additional pages exist
totalnumberTotal number of matching articles

Cursor Pagination — Pass the cursor value as the cursor query parameter in the next request. Ideal for infinite-scroll UIs.

Offset Pagination — Pass a numeric offset to skip that many records. Ideal for numbered-page UIs. Do not combine with cursor.

Language Codes​

Supported languages:

CodeLanguage
arArabic
deGerman
esSpanish
frFrench
huHungarian
idIndonesian
itItalian
jaJapanese
ptPortuguese
ruRussian
trTurkish
viVietnamese
zhChinese

Use GET /api/news/cultures for the current, complete list.

Error Responses​

All error responses use a consistent shape:

{
"statusCode": 401,
"message": "Invalid API key",
"error": "Unauthorized"
}
StatusErrorCommon Cause
400Bad RequestInvalid query parameter (e.g. bad date format)
401UnauthorizedMissing, invalid, expired, or inactive API key
403ForbiddenDomain not in API key's whitelist
404Not FoundArticle ID doesn't exist or isn't published yet
429Too Many RequestsRate limit exceeded — wait and retry
503Service UnavailableInternal service temporarily down