Migrate from v2 to v3
This guide takes an existing v2 integration to v3. It lists every renamed field, every changed request, and the steps for REST, WebSocket and webhooks. You can move one channel at a time.
Why v3
v3 gives you one article format for every channel. REST, WebSocket and webhooks send the same object, so you write one parser. On top of that, v3 adds:
- Company roles. Each tagged company has a
role(for exampleacquirerortarget) and arelevancefrom 0 to 1. See Companies & roles. - Events. Articles carry the business events they report, such as
earningsormna, with a direction and an importance. See Events. - Source types. Every source has a type such as
newswireorpress_release, and you can filter on it. See Source types. - Cursor pagination. Pages come with an opaque cursor instead of page numbers. Deep paging stays fast and stable.
- Clear errors. Every REST error has the same JSON shape with a stable
code. See Errors. - Lookups.
/v3/companiesresolves tickers, ISINs and names to a company id, and/v3/sourceslists every source with its type. - New timestamps.
availableAttells you when an article became available on finlight, which is the right field for polling.
What stays the same
- v2 keeps working. v2 is deprecated and frozen: it gets no new features, but nothing is switched off. You can migrate at your own pace.
- Your API key. The same key works for v2 and v3, with the same
X-API-KEYheader. - Your plan and quota. v3 requests use the same monthly counter as v2 requests. See Rate limits & credits.
- The hosts. REST stays on
https://api.finlight.me. WebSocket stays onwss://wss.finlight.meandwss://wss.finlight.me/raw. You pick v3 per subscription, not with a new URL. - Webhook security. Headers, secret and HMAC signature work exactly as in v2.
- The query language. The syntax you know still works. v3 adds fields such as
role:,eventType:andsourceType:. See Query syntax.
Checklist
- Upgrade your client library to its new major version (see Client library upgrades). If you call the API directly, follow the REST, WebSocket and webhook sections below.
- Rename the request fields and the article fields with the field mapping.
- Replace page numbers with the cursor.
- Handle errors by their
codein the problem+json body. - Add
"payloadVersion": 3to every WebSocket subscribe and handle the new frames. - Switch each webhook to v3 in the dashboard, after your receiver understands the v3 envelope.
- Check the credit changes: lookups on
/v3/companiesand/v3/sourcesnow cost credits, and events need Pro Standard or higher.
v3 drops unknown request fields silently. If you send a v2 field name such as pageSize, page,
language or includeEntities to /v3/articles/search, the request still succeeds, but the field
has no effect. Rename every field before you switch.
Field mapping
Articles
| v2 | v3 | Notes |
|---|---|---|
| (none) | id | New. A stable article id, the same in every channel. Use it with GET /v3/articles/{id}. |
link | link | Unchanged. |
source (string) | source.domain | source is now an object. source.type holds the source type, or null when the source is not classified. |
publishDate | publishedAt | |
createdAt | firstSeenAt | Always present in v3 (it can be null). v2 sent it only for some requests. |
revisedDate | revisedAt | Always present in v3. null when the source reports no revision, or when it equals publishedAt. |
| (none) | availableAt | New. When the enriched article became available on finlight. |
images | media[].url | A list of objects. At most 3 images. |
sentiment + confidence | sentiment.label + sentiment.confidence | One object. confidence is a number in v3 (v2 could send it as a string). |
summary | summary | Never "" in v3: empty text arrives as null. |
language, countries, categories | same names | Unchanged. |
companies | companies | New shape, see the companies table below. Requested with include: ["companies"]. |
| (none) | events | New. Requested with include: ["events"]. See Events. |
isUpdate: true | article.updated | The update flag moved to the frame or envelope: event is article.created or article.updated. |
In v3 a missing key, null and [] mean different things. A missing key means not requested, not in your plan, or not available in the channel. null means there is no value. [] is a real empty list. See The article object.
Companies
| v2 company | v3 | Notes |
|---|---|---|
companyId | companyId | The join key to /v3/companies/{companyId}. |
name | name | |
isin | isin | The company's ISIN, or null. |
confidence (string) | confidence (number) | |
ticker, exchange | primaryListing.ticker, primaryListing.mic | |
primaryListing.exchangeCode | primaryListing.mic | |
primaryListing.exchangeCountry | primaryListing.country | primaryListing is null for a company without a listing. |
country, sector, industry, isins, otherListings | GET /v3/companies/{companyId} | Company master data moved to the Companies lookup, which you can cache. |
openfigi | (removed) | Not part of the v3 company. |
| (none) | role, relevance | New. See Companies & roles. |
Requests
| v2 | v3 | Notes |
|---|---|---|
POST /v2/articles | POST /v3/articles/search | |
GET /v2/articles/by-link | GET /v3/articles/by-link | New: GET /v3/articles/{id}. |
GET /v2/sources | GET /v3/sources | See the sources table below. |
| (none) | GET /v3/companies, GET /v3/companies/{companyId} | New lookups. |
includeEntities | include | include: ["companies", "events"], any subset. |
page, pageSize | cursor, limit | See Pagination. |
order: "ASC" / "DESC" | order: "asc" / "desc" | Lowercase only. Uppercase is a 400. |
orderBy: "publishDate" | orderBy: "publishedAt" | |
orderBy: "createdAt" | orderBy: "firstSeenAt" | |
orderBy: "revisedDate" | orderBy: "revisedAt" | |
| (none) | orderBy: "availableAt" | New. Best for polling. |
language (one string) | languages (a list) | Default ["en"]. WebSocket and webhook criteria keep the single language. |
sources, excludeSources, optInSources, tickers, countries, categories, from, to, query | same names | |
| (none) | sourceTypes, excludeSourceTypes, roles, minRelevance, eventTypes, eventDirections, minImportance, sectors, companyCountries, exchanges | New filters. See Search articles. |
Sources
v2 (GET /v2/sources) | v3 (GET /v3/sources) | Notes |
|---|---|---|
| a JSON array | {"sources": [...]} | The list is wrapped in an object. |
domain | domain | The join key to article.source.domain. |
isDefaultSource | isDefault | |
isCustomSource | isCustom | v2 sent it only when true. v3 always sends a boolean. |
originCountry | country | |
languages | languages | Most common language first. |
| (none) | type, name | New. type is the source type. |
REST
Search
The search moved from POST /v2/articles to POST /v3/articles/search. Here is the same search in both versions.
Before: v2
curl -X POST 'https://api.finlight.me/v2/articles' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: YOUR_API_KEY' \
-d '{
"query": "ticker:NVDA",
"language": "en",
"includeEntities": true,
"order": "DESC",
"pageSize": 20,
"page": 1
}'
After: v3
curl -X POST 'https://api.finlight.me/v3/articles/search' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: YOUR_API_KEY' \
-d '{
"query": "ticker:NVDA",
"languages": ["en"],
"include": ["companies"],
"order": "desc",
"limit": 20
}'
The response changes from {status, page, pageSize, articles} to {articles, pagination}. This is one article from both answers, shortened:
v2 article
{
"link": "https://www.reuters.com/markets/amd-zt-systems",
"source": "www.reuters.com",
"title": "AMD to buy ZT Systems",
"publishDate": "2026-09-18T12:01:03.000Z",
"language": "en",
"sentiment": "positive",
"confidence": "0.98",
"images": ["https://www.reuters.com/images/lead.jpg"],
"companies": [
{
"companyId": 13,
"name": "Advanced Micro Devices, Inc.",
"ticker": "AMD",
"exchange": "XNAS",
"confidence": "0.970",
"primaryListing": { "ticker": "AMD", "exchangeCode": "XNAS", "exchangeCountry": "US" }
}
]
}
v3 article
{
"id": "pXhK9f2aQ1mZ0bT7cY3rLw",
"link": "https://www.reuters.com/markets/amd-zt-systems",
"source": { "domain": "www.reuters.com", "type": "newswire" },
"title": "AMD to buy ZT Systems",
"summary": "AMD agreed to buy ZT Systems.",
"language": "en",
"media": [{ "url": "https://www.reuters.com/images/lead.jpg" }],
"publishedAt": "2026-09-18T12:01:03.000Z",
"firstSeenAt": "2026-09-18T12:01:41.000Z",
"revisedAt": null,
"availableAt": "2026-09-18T12:03:05.000Z",
"countries": ["US"],
"categories": ["markets"],
"sentiment": { "label": "positive", "confidence": 0.98 },
"companies": [
{
"companyId": 13,
"name": "Advanced Micro Devices, Inc.",
"isin": "US0079031078",
"primaryListing": { "ticker": "AMD", "mic": "XNAS", "country": "US" },
"confidence": 0.97,
"role": "acquirer",
"relevance": 0.95
}
]
}
Pagination
v2 counted pages. v3 hands you a cursor:
pagination
{ "limit": 20, "returned": 20, "hasMore": true, "nextCursor": "eyJ2IjoxLCJrIjpb..." }
To get the next page, send the same body again and add "cursor": "<nextCursor>". Only cursor, limit and include may change between pages. When hasMore is false and nextCursor is null, you have everything. There is no total count. The SDKs page for you with searchAll (Python, Ruby and Rust: search_all; Go: SearchAll; .NET: SearchAllAsync). See Pagination.
Do not compute to = now again for each page. A changed filter gives a CURSOR_MISMATCH error.
Fix the time range once, at the first page.
Errors
v2 answered field errors with a 422 ({status, errors}), query errors with a 400 and other errors with {statusCode, message}. v3 answers every error with application/problem+json, the same fields every time, and a stable code:
400 Validation failed
{
"type": "https://docs.finlight.me/errors/validation-failed",
"title": "Validation failed",
"status": 400,
"detail": "1 request field is not valid.",
"code": "VALIDATION_FAILED",
"requestId": "req_83e04b41-71c8-4d92-b555-4042e89d508b",
"errors": [
{
"field": "order",
"issue": "order must be one of the following values: asc, desc",
"allowedValues": ["asc", "desc"]
}
]
}
- Branch on
code, not on the text. The codes are listed on Errors. - A validation error is a 400 in v3, not a 422.
- A rate limit is a 429 with
limitType(burstormonthly). A burst 429 also sendsRetry-After. - Send an
X-Request-Idheader and it comes back asrequestIdin the error body. Quote it when you contact support.
Stricter queries
The query language is the same, but REST v3 is strict about field names. In v2 an unknown field such as foo:bar was searched as plain text. In v3 it is a 400:
400 Unknown query field
{
"field": "badQuery",
"issue": "Unknown field \"foo\". Allowed fields: category, companyCount, ... To search for the literal text, quote it: \"foo:bar\"."
}
Free text that contains a colon must be quoted, for example "foo:bar" in quotes. WebSocket subscriptions and webhook criteria keep the lenient v2 rules. See Query syntax.
Other REST changes
- Get an article by id. Every v3 article has an
id.GET /v3/articles/{id}returns it. Articles indexed before ids existed are found only by link. See Get an article. - Date range and sort field.
fromandtoapply to theorderBytimestamp, as in v2. Articles without that timestamp never appear. WithorderBy: "availableAt"you only get articles from afteravailableAtwas introduced. - Enum values are strict. Values such as
eventTypesororderBymust come from the list. A wrong value is a 400 that names theallowedValues.
WebSocket
The WebSocket URLs stay the same. You choose v3 in the subscribe message.
Subscribe
Add "payloadVersion": 3 (the JSON number 3) and replace the include switches with include:
v2 subscribe
{
"query": "ticker:NVDA",
"language": "en",
"includeEntities": true,
"includeUpdates": true
}
v3 subscribe
{
"payloadVersion": 3,
"query": "ticker:NVDA",
"language": "en",
"include": ["companies"],
"includeUpdates": true
}
- Anything other than the number
3(for example the string"3") silently means v2. - With
payloadVersion: 3, the keysincludeEntitiesandextendedare an error. The server answersVALIDATION_FAILEDand closes the connection. languagestays a single value on WebSocket.- New on v3:
sourceTypesandexcludeSourceTypes. - There are no flat role or event filters on WebSocket. Use the query instead, for example
eventType:mna.
See Subscribe for every field.
Frames
Every v3 frame has event, payloadVersion and data. The old action field is gone:
v2 article frame
{
"action": "sendArticle",
"data": { "link": "https://www.reuters.com/markets/amd-zt-systems", "title": "AMD to buy ZT Systems", "isUpdate": false }
}
v3 article frame
{
"event": "article.created",
"payloadVersion": 3,
"data": { "id": "pXhK9f2aQ1mZ0bT7cY3rLw", "link": "https://www.reuters.com/markets/amd-zt-systems", "title": "AMD to buy ZT Systems" }
}
v2 action | v3 event |
|---|---|
sendArticle | article.created |
sendArticle with isUpdate: true | article.updated |
admit | connection.admitted |
pong | connection.pong |
preempted | connection.preempted |
error | connection.error |
- Send the ping as
{"action":"ping","t":<number>}about every 25 seconds. The pong echoest. - A connection that has not sent its v3 subscribe yet still gets v2 frames (for example a pong for a ping sent before the subscribe).
- Treat
eventas an open list. Ignore events you do not know.
See Frames and Lifecycle & limits.
Webhooks
The envelope
A v2 webhook body was the article itself. A v3 body is an envelope around the article (data is shortened here):
v3 webhook body
{
"eventId": "evt_Q2x9k3LmN8pR4tV7wZ1aBc",
"event": "article.updated",
"occurredAt": "2026-09-18T14:31:10.000Z",
"payloadVersion": 3,
"subscriptionId": "3b9f0c2e-6d1a-4c7e-9a52-0f1e2d3c4b5a",
"changedFields": ["title"],
"data": { "id": "pXhK9f2aQ1mZ0bT7cY3rLw", "title": "AMD to buy ZT Systems for $4.9 billion" }
}
datais the same article object as in REST and WebSocket.eventreplacesisUpdate.changedFieldstells you what changed on an update.eventIdstays the same on every retry of a delivery. Deliveries can repeat, so dedupe oneventId.- The headers
X-Webhook-SignatureandX-Webhook-Timestamp, the secret and the HMAC recipe do not change.
See Payload and Signature verification.
Switch a webhook to v3
Each webhook has its own payload format. You switch it in the dashboard: open the webhook and choose Switch to v3. Do it in four steps:
- Deploy a receiver that understands v3. With an SDK, that is the new major version.
- Let the receiver answer a v2 body with a 2xx too. The SDKs report it as
WrongPayloadVersionand keep the raw JSON, so you can still use the data. - Switch the webhook to v3 in the dashboard.
- Wait about 2 hours. Retries that were already queued before the switch still arrive in the v2 format.
When you switch, companies carry over from your v2 settings. Events start off; turn them on with Edit after the switch. New webhooks offer v3 directly; v2 is still offered there, marked as deprecated.
Before: v2 webhook handler
import express from 'express'
import { WebhookService } from 'finlight-client' // 3.x
const app = express()
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
try {
const article = WebhookService.constructEvent(
req.body.toString(),
req.headers['x-webhook-signature'] as string,
process.env.FINLIGHT_WEBHOOK_SECRET!,
req.headers['x-webhook-timestamp'] as string,
)
console.log(article.isUpdate ? 'updated' : 'new', article.title)
res.sendStatus(200)
} catch {
res.sendStatus(400)
}
})
After: v3 webhook handler
import express from 'express'
import { Webhooks, WrongPayloadVersion, WebhookVerificationError } from 'finlight-client' // 4.x
const app = express()
// Keep the body raw: never verify re-serialized JSON.
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
let result
try {
result = Webhooks.constructEvent(req.body, req.headers, process.env.FINLIGHT_WEBHOOK_SECRET!)
} catch (err) {
return res.sendStatus(err instanceof WebhookVerificationError ? 400 : 500)
}
if (result instanceof WrongPayloadVersion) return res.sendStatus(204) // a v2 body during the switch
res.sendStatus(204) // answer within 5 s, work afterwards
console.log(result.event, result.eventId, result.data.title) // dedupe on eventId
})
Criteria and blocks
- The webhook criteria keep the v2 field names:
query,sources,excludeSources,language,tickers,countries,categoriesandincludeUpdates.optInSourcesis still stored, but it has no effect on webhook deliveries. - The blocks you receive come from the webhook's included blocks (companies, events), not from switches in the criteria.
- New for v3 webhooks:
sourceTypesandexcludeSourceTypes. The dashboard cannot set them yet. Until it can, filter by source type in the query, for examplesourceType:press_releaseorticker:NVDA -sourceType:aggregator. A query that only excludes, such as-sourceType:aggregatoralone, is rejected. ThesourceType:query field works on v2 and v3 webhooks.
See Criteria.
Retries
Failed deliveries are retried up to 3 times, after 10, 30 and 60 minutes. A retry keeps the same eventId. Retries do not count against your webhook quota, but every failed attempt counts toward the automatic disable after 10 failures in a row. This applies to v2 webhooks too. See Delivery & retries.
Client library upgrades
Every official client library has a new major version for v3. The old majors keep speaking v2 and get no further releases. The new majors are published on the package registries. The table shows the versions to move to.
| Language | Package | v2 major (old) | v3 major (new) | Migration notes |
|---|---|---|---|---|
| TypeScript / JavaScript | finlight-client | 3.x | 4.0.0 | README |
| Python | finlight-client | 2.x | 3.0.0 | README |
| Go | github.com/callbk/finlight-client-go | v1.x | v2.0.0 (module path ends in /v2) | README |
| .NET | Finlight.Client | 1.x | 2.0.0 | README |
| Java / Kotlin | me.finlight:finlight-client | 0.1.x | 1.0.0 | README |
| PHP | finlight/client | 1.x | 2.0.0 | README |
| Ruby | finlight-client | 0.x | 1.0.0 | README |
| Rust | finlight-client | 0.1.x | 0.2.0 | README |
- Pin the major version. Ranges such as
^3(npm),~> 0.1(Ruby) or"0.1"(Cargo) never pull in the new major, but open ranges such as*or>=do. - Do not run old and new streams side by side on one API key. They share your WebSocket connection limit.
- In Go, the new major has a new import path:
github.com/callbk/finlight-client-go/v2. - See Client Libraries for install commands and requirements.
Credits and plans
Two things change on the billing side:
- Lookups cost credits. A request to
/v3/companies(search and get-many),/v3/companies/{companyId}or/v3/sourcescosts 1 credit, the same as an article request.GET /v2/sourcescosts 1 credit too, like every request. Its answer is not changed by v3. Get-many costs 1 credit per request, not per company. A304 Not Modifiedanswer and error responses cost 1 credit too, as on the article routes. Not charged:401,403and the monthly429itself. Keep the company records and the source list for a day before you ask again (a revalidation is a request and costs 1 credit). - Events need Pro Standard or higher. The
eventsblock is part of the Pro Standard plan and every higher plan. On lower plans,include: ["events"]is accepted, but theeventskey is missing from the answer. Filtering on events works on every plan.
Everything else stays: one credit per request, and the same monthly counter for v2 and v3. See Rate limits & credits and Plans & entitlements.
What's next?
- Make a first v3 call with the Quickstart
- Read the article object field by field
- Learn the new query fields in Companies & events
- Set up webhooks or a WebSocket stream
- Questions about your migration? Reach out via Support