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 example acquirer or target) and a relevance from 0 to 1. See Companies & roles.
  • Events. Articles carry the business events they report, such as earnings or mna, with a direction and an importance. See Events.
  • Source types. Every source has a type such as newswire or press_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/companies resolves tickers, ISINs and names to a company id, and /v3/sources lists every source with its type.
  • New timestamps. availableAt tells 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-KEY header.
  • 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 on wss://wss.finlight.me and wss://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: and sourceType:. See Query syntax.

Checklist

  1. 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.
  2. Rename the request fields and the article fields with the field mapping.
  3. Replace page numbers with the cursor.
  4. Handle errors by their code in the problem+json body.
  5. Add "payloadVersion": 3 to every WebSocket subscribe and handle the new frames.
  6. Switch each webhook to v3 in the dashboard, after your receiver understands the v3 envelope.
  7. Check the credit changes: lookups on /v3/companies and /v3/sources now cost credits, and events need Pro Standard or higher.

Field mapping

Articles

v2v3Notes
(none)idNew. A stable article id, the same in every channel. Use it with GET /v3/articles/{id}.
linklinkUnchanged.
source (string)source.domainsource is now an object. source.type holds the source type, or null when the source is not classified.
publishDatepublishedAt
createdAtfirstSeenAtAlways present in v3 (it can be null). v2 sent it only for some requests.
revisedDaterevisedAtAlways present in v3. null when the source reports no revision, or when it equals publishedAt.
(none)availableAtNew. When the enriched article became available on finlight.
imagesmedia[].urlA list of objects. At most 3 images.
sentiment + confidencesentiment.label + sentiment.confidenceOne object. confidence is a number in v3 (v2 could send it as a string).
summarysummaryNever "" in v3: empty text arrives as null.
language, countries, categoriessame namesUnchanged.
companiescompaniesNew shape, see the companies table below. Requested with include: ["companies"].
(none)eventsNew. Requested with include: ["events"]. See Events.
isUpdate: truearticle.updatedThe 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 companyv3Notes
companyIdcompanyIdThe join key to /v3/companies/{companyId}.
namename
isinisinThe company's ISIN, or null.
confidence (string)confidence (number)
ticker, exchangeprimaryListing.ticker, primaryListing.mic
primaryListing.exchangeCodeprimaryListing.mic
primaryListing.exchangeCountryprimaryListing.countryprimaryListing is null for a company without a listing.
country, sector, industry, isins, otherListingsGET /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, relevanceNew. See Companies & roles.

Requests

v2v3Notes
POST /v2/articlesPOST /v3/articles/search
GET /v2/articles/by-linkGET /v3/articles/by-linkNew: GET /v3/articles/{id}.
GET /v2/sourcesGET /v3/sourcesSee the sources table below.
(none)GET /v3/companies, GET /v3/companies/{companyId}New lookups.
includeEntitiesincludeinclude: ["companies", "events"], any subset.
page, pageSizecursor, limitSee 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, querysame names
(none)sourceTypes, excludeSourceTypes, roles, minRelevance, eventTypes, eventDirections, minImportance, sectors, companyCountries, exchangesNew 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.
domaindomainThe join key to article.source.domain.
isDefaultSourceisDefault
isCustomSourceisCustomv2 sent it only when true. v3 always sends a boolean.
originCountrycountry
languageslanguagesMost common language first.
(none)type, nameNew. 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

POST
/v2/articles
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

POST
/v3/articles/search
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.

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 (burst or monthly). A burst 429 also sends Retry-After.
  • Send an X-Request-Id header and it comes back as requestId in 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. from and to apply to the orderBy timestamp, as in v2. Articles without that timestamp never appear. With orderBy: "availableAt" you only get articles from after availableAt was introduced.
  • Enum values are strict. Values such as eventTypes or orderBy must come from the list. A wrong value is a 400 that names the allowedValues.

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 keys includeEntities and extended are an error. The server answers VALIDATION_FAILED and closes the connection.
  • language stays a single value on WebSocket.
  • New on v3: sourceTypes and excludeSourceTypes.
  • 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 actionv3 event
sendArticlearticle.created
sendArticle with isUpdate: truearticle.updated
admitconnection.admitted
pongconnection.pong
preemptedconnection.preempted
errorconnection.error
  • Send the ping as {"action":"ping","t":<number>} about every 25 seconds. The pong echoes t.
  • 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 event as 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" }
}
  • data is the same article object as in REST and WebSocket.
  • event replaces isUpdate. changedFields tells you what changed on an update.
  • eventId stays the same on every retry of a delivery. Deliveries can repeat, so dedupe on eventId.
  • The headers X-Webhook-Signature and X-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:

  1. Deploy a receiver that understands v3. With an SDK, that is the new major version.
  2. Let the receiver answer a v2 body with a 2xx too. The SDKs report it as WrongPayloadVersion and keep the raw JSON, so you can still use the data.
  3. Switch the webhook to v3 in the dashboard.
  4. 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, categories and includeUpdates. optInSources is 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: sourceTypes and excludeSourceTypes. The dashboard cannot set them yet. Until it can, filter by source type in the query, for example sourceType:press_release or ticker:NVDA -sourceType:aggregator. A query that only excludes, such as -sourceType:aggregator alone, is rejected. The sourceType: 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.

LanguagePackagev2 major (old)v3 major (new)Migration notes
TypeScript / JavaScriptfinlight-client3.x4.0.0README
Pythonfinlight-client2.x3.0.0README
Gogithub.com/callbk/finlight-client-gov1.xv2.0.0 (module path ends in /v2)README
.NETFinlight.Client1.x2.0.0README
Java / Kotlinme.finlight:finlight-client0.1.x1.0.0README
PHPfinlight/client1.x2.0.0README
Rubyfinlight-client0.x1.0.0README
Rustfinlight-client0.1.x0.2.0README
  • 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/sources costs 1 credit, the same as an article request. GET /v2/sources costs 1 credit too, like every request. Its answer is not changed by v3. Get-many costs 1 credit per request, not per company. A 304 Not Modified answer and error responses cost 1 credit too, as on the article routes. Not charged: 401, 403 and the monthly 429 itself. 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 events block is part of the Pro Standard plan and every higher plan. On lower plans, include: ["events"] is accepted, but the events key 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?