Client Libraries
finlight has official client libraries for eight languages. Each library has a new major version that speaks API v3. It covers search, lookups, live streams and webhook verification, so you do not have to write the HTTP and WebSocket code yourself.
The v3 versions below are published on the package registries. The previous majors stay there and keep speaking API v2.
| Language | Package | Version | Requires | Streaming | Repository |
|---|---|---|---|---|---|
| TypeScript / JavaScript | finlight-client (npm), @finlight/client (JSR) | 4.0.0 | Node.js 20+ | Yes | jubeiargh/finlight-client |
| Python | finlight-client (PyPI) | 3.0.0 | Python 3.10+ | Yes | jubeiargh/finlight-client-py |
| Go | github.com/callbk/finlight-client-go/v2 | v2.0.0 | Go 1.24+ | Yes | callbk/finlight-client-go |
| .NET / C# | Finlight.Client (NuGet) | 2.0.0 | .NET 8+ | Yes | callbk/finlight-client-dotnet |
| Java / Kotlin | me.finlight:finlight-client (Maven Central) | 1.0.0 | Java 17+ | Yes | callbk/finlight-client-java |
| PHP | finlight/client (Packagist) | 2.0.0 | PHP 8.2+ (64-bit), a PSR-18 HTTP client | No (message helpers only) | callbk/finlight-client-php |
| Ruby | finlight-client (RubyGems) | 1.0.0 | Ruby 3.2+ | Yes | callbk/finlight-client-ruby |
| Rust | finlight-client (crates.io) | 0.2.0 | Rust 1.85+, tokio | Yes | callbk/finlight-client-rust |
Every library is open source under the MIT license. Each README lists all requirements and the full API.
Install
Every client takes your API key in its constructor and sends it as the X-API-KEY header. Get a key in the finlight Dashboard.
Install
# cURL needs no client library. Every request on these pages
# has a cURL example.
curl --version
If you build with Maven rather than Gradle, use the same coordinate:
<dependency>
<groupId>me.finlight</groupId>
<artifactId>finlight-client</artifactId>
<version>1.0.0</version>
</dependency>
The PHP client finds any PSR-18 HTTP client. Guzzle is used automatically when it is installed, which is why the command above adds it.
What every client gives you
All eight libraries follow the same rules, so the concepts do not change when you switch languages.
- Search.
searchreturns one page.searchAll(Python, Ruby and Rust:search_all; Go:SearchAll; .NET:SearchAllAsync) walks the cursor for you. It sends the same request body on every page, so the cursor stays valid. It stops after a set number of pages, because every page costs a credit. See Pagination. - Lookups. Get an article by id or by link, search and resolve companies, and list sources. The SDKs keep no cache of company records. To save credits, keep the records yourself for a day. You can pass a stored
ETagasifNoneMatch. An unchanged record then comes back as "not modified" (null). That304is a request and costs 1 credit, like every request. See Companies and Sources. - Streams. Enriched and raw WebSocket streams in the usual style of each language (async iterators, Go iterators,
IAsyncEnumerable, RustStreams). The client pings every 25 seconds, reconnects when no pong comes for 60 seconds, opens a fresh connection before the 2 hour limit, subscribes again after every reconnect and drops duplicates. See WebSocket. - Webhook verification. One call checks the signature on the raw body and the timestamp (300 seconds tolerance), then reads the v3 envelope. A correctly signed v2 body is reported as
WrongPayloadVersion, so you can switch a webhook without losing deliveries. See Signature verification. - Typed errors. API errors carry
status,code,detail,requestIdand the field errors. Each known error code has its own error type or kind, and codes the library does not know yet still arrive as a general API error. - Retries. 5xx answers, network errors and timeouts are retried up to 3 times with growing waits. A burst 429 waits for
Retry-Afterand tries once more. 400, 401, 403, 404 and a monthly 429 are never retried. See Rate limits & credits. - Forward compatibility. New fields and new values from the server do not break the clients. Values such as
role,eventtypes orsource.typeare open strings with known constants, not closed enums. - Missing, null and empty stay apart. A block that is missing (not requested, not in your plan, or the raw channel) is not turned into
nullor[]. Helpers such ascompaniesPresenttell you which case you have. See The article object.
The PHP client has no WebSocket transport, because PHP's request model is a poor fit for a long connection. It builds the subscribe message and reads the frames for a socket loop you run yourself. For push delivery into a PHP application, use webhooks.
Nothing in the libraries is special: everything they do works over plain HTTP and WebSocket. cURL or any HTTP client stays a fully supported option.
Versions
The SDK version and the API version are separate numbers. Each library has one major version for API v3 and one older major version for v1 and v2:
| Language | Speaks API v3 | Speaks API v2 |
|---|---|---|
| TypeScript / JavaScript | 4.x | 3.x, no further releases |
| Python | 3.x | 2.x, no further releases |
| Go | v2.x (github.com/callbk/finlight-client-go/v2) | v1.x (github.com/callbk/finlight-client-go), no further releases |
| .NET | 2.x | 1.x, no further releases |
| Java / Kotlin | 1.x | 0.1.x, no further releases |
| PHP | 2.x | 1.x, no further releases |
| Ruby | 1.x | 0.x, no further releases |
| Rust | 0.2.x | 0.1.x, no further releases |
- New fields and new values in API v3 arrive as compatible releases of the v3 major (for Rust, as 0.2.x releases).
- The old majors stay on the registries and keep working against API v2. API v2 is deprecated, but it is not switched off.
- A new major does not run code written for the old one. The README of each library has a "Migrating" section, and the migration guide covers the API side.
Pin a major version
Pin the major version you use, so a routine dependency update never moves you to an incompatible client:
| Language | Stays on the v2 client | Moves to the v3 client |
|---|---|---|
| TypeScript | finlight-client@^3 | finlight-client@^4 |
| Python | finlight-client<3 | finlight-client>=3,<4 |
| Go | import github.com/callbk/finlight-client-go | import github.com/callbk/finlight-client-go/v2 |
| .NET | [1.0.0,2.0.0) | [2.0.0,3.0.0) |
| Java / Kotlin | 0.1.0 | 1.0.0 |
| PHP | finlight/client:^1.0 | finlight/client:^2.0 |
| Ruby | "~> 0.1.0" | "~> 1.0" |
| Rust | finlight-client = "0.1" | finlight-client = "0.2" |
The usual compatible ranges (^, ~, ~>, the Cargo default) never pull in the next major. Open ranges such as * or >= do, so avoid them.
Old and new clients share your plan's WebSocket connection limit. Do not run an old stream and a new stream side by side on one key.
What's next?
- Make your first call with the Quickstart
- Coming from v2? Read Migrate from v2 to v3
- Search articles with Search articles
- Stream articles live with the WebSocket overview
- Receive pushed articles with Webhooks
- Found a bug or need a language that is missing? Reach out via Support