Before you start
- Get an API keySign up for 100 free credits, no card. Keys start with
gs_live_. - Put it in the environmentEvery example reads it from
GROUNDSOCIAL_API_KEY:export GROUNDSOCIAL_API_KEY=gs_live_… - Set up TypeScript
npm init -y && npm pkg set type=module && npm i -D tsx typescript @types/node
Call Finance news API from TypeScript
GET /v1/finance/news. Save this as main.ts and run npx tsx main.ts. It reads the items in news and prints title for each.
// The fields this script reads, as the recorded response has them.
interface Page {
news: {
title: string
}[]
}
class ApiError extends Error {
constructor(
readonly code: string,
readonly hint: string,
readonly retryable: boolean,
) {
super(`${code}: ${hint}`)
}
}
async function call<T>(path: string, params: Record<string, string> = {}): Promise<T> {
const url = new URL(path, 'https://api.groundsocial.dev')
for (const [k, v] of Object.entries(params)) url.searchParams.set(k, v)
const res = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}`,
},
signal: AbortSignal.timeout(60_000),
})
if (!res.ok) {
const { error } = (await res.json()) as {
error: { code: string; message: string; hint?: string; retryable: boolean }
}
throw new ApiError(error.code, error.hint ?? error.message, error.retryable)
}
return (await res.json()) as T
}
const data = await call<Page>('/v1/finance/news', { keyword: 'Tesla' })
for (const item of data.news) {
console.log(item.title)
}The response
A real Finance response to this call, recorded from the live API on 27 Nov 2026 and shortened for display: arrays keep their first items and … marks every cut. The recorded page had 10 items in news. Live calls return current data in the same shape.
{
"news": [
{
"uuid": "da75dfce-6c21-32a8-a4e1-bce9d061221a",
"title": "Should You Buy Tesla Stock Before December?",
"publisher": "Motley Fool",
"link": "https://finance.yahoo.com/markets/stocks/articles/buy-tesla-stock-december-223502338.html",
"providerPublishTime": 1795732502,
"type": "STORY",
"relatedTickers": [
"TSLA",
"SPCX",
"… 2 more"
],
"thumbnail": {
"resolutions": [
{
"url": "https://media.zenfs.com/en/motleyfool.com/d3118b8cdfe0060ce263d8bfa8eb470f.png",
"width": 1290,
"height": 860,
"tag": "original"
},
{
"url": "https://s.yimg.com/lo/mysterio/api/181C80250B093EBAFECCE0EE644BB3E19E15F03F846B1ED0461B52A8AA8E2E60/subgraphmysterio/res…",
"width": 140,
"height": 140,
"tag": "140x140"
}
]
}
},
{
"uuid": "e9c69e2f-0f71-3e45-b0c2-71bf9c7f798f",
"title": "Tesla Stocks Slip 1.18% as EU Delays Self-Driving Vote to December 15",
"publisher": "GuruFocus.com",
"link": "https://finance.yahoo.com/markets/stocks/articles/tesla-stocks-slip-1-18-190357031.html",
"providerPublishTime": 1795719837,
"type": "STORY",
"relatedTickers": [
"TSLA"
]
},
"… 8 more"
]
}Top-level fields
| Field | Type | Description |
|---|---|---|
news | FinanceNews[] | – |
Parameters
| Name | In | Type | Description |
|---|---|---|---|
keyword (required) | query | string | A ticker (AAPL, ^GSPC, EURUSD=X, BTC-USD) or a company name. Example: AAPL. |
limit | query | integer | Stories per page, 1 to 50. Defaults to 10. |
since | query | string | Only rows published on or after this date: YYYY-MM-DD (midnight UTC) or an ISO 8601 timestamp. Example: 2026-01-01. |
until | query | string | Only rows published on or before this date: YYYY-MM-DD (that whole UTC day) or an ISO 8601 timestamp. Example: 2026-12-31. |
Errors and retries
Every error is JSON with error.code (stable: branch on it), message, hint (what to do next), docs_url and retryable. A failed call is never charged. Retry only when retryable is true, after the Retry-After header.
try {
const data = await call<Page>('/v1/finance/news', { keyword: 'Tesla' })
} catch (err) {
if (!(err instanceof ApiError)) throw err
if (err.code === 'insufficient_credits') console.error('Top up:', err.hint)
else if (err.code === 'target_not_found') console.error('Nothing there (not charged).')
else if (err.retryable) console.error('Try again after Retry-After:', err.hint)
else throw err
}| Status | Meaning |
|---|---|
200 | News stories, newest first. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | No ticker or data matches. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Finance is temporarily unavailable. Retryable; nothing was charged. |
Every error code and what to do about it.
Pricing
| Cost | |
|---|---|
| Per call | 1 credit per call |
| 1,000 calls | $1.00 on the starter pack, $0.40 at volume |
| No key (MPP or x402) | $0.01 per call |
| Failed call | Refunded, never charged |
Every response has x-credits-charged and x-credits-remaining headers. Credits never expire. Packs and calculator.
From an AI agent (MCP)
The same call is the finance_news_get tool on the hosted MCP server, so Claude, Cursor or any MCP client can make it without code. Add the server once:
claude mcp add --transport http groundsocial https://api.groundsocial.dev/mcpThen ask for it in words (“Finance news about a company or topic”), or call the tool directly:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "finance_news_get",
"arguments": {
"keyword": "Tesla"
}
}
}MCP setup for Claude Desktop, Cursor, VS Code and ChatGPT.
Follow a company
Poll it and keep unseen uuids.
Questions
How many stories?
Up to 50.
Keep going
- This call in Python, JavaScript, Go, PHP, cURL.
- Finance news API reference: every field and status code.
- Finance tutorials and all TypeScript tutorials.
- Finance API: every endpoint and price.
- How to scrape market overview with TypeScript: Market overview: major indices, currencies, commodities and crypto.
- How to scrape stock price history with TypeScript: Price history between two dates, daily to quarterly.
- How to scrape stock quote with TypeScript: A live quote: price, change, volume, ranges, market cap, ratios.
- How to scrape ticker search with TypeScript: Find tickers by name or symbol: stocks, indices, funds, currencies, futures.
- How to scrape financial statements with TypeScript: Income statement, balance sheet and cash flow, annual, quarterly or trailing.
- How to scrape options chain with TypeScript: An option chain: calls and puts for an expiry.
Run it on your own data
One key for Finance and 76 more platforms, over REST or MCP. Free credits on signup, no card.
Finance is a trademark of Yahoo Inc. We are not affiliated with or endorsed by Yahoo Inc.