Download the PHP package finlight/client without Composer

On this page you can find all versions of the php package finlight/client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package client

finlight PHP Client

English | 한국어

CI Packagist Version PHP Version

PHP client for the finlight.me financial news API. Search market news enriched with sentiment scores and entity tags (tickers, ISIN, OpenFIGI), and verify inbound finlight webhooks.

Full API reference: docs.finlight.me · Get an API key: app.finlight.me

Requirements

Installation

If your project has no PSR-18 client yet, add one:

Quick start

Searching articles

Every filter is optional — pass only what you need, as named arguments.

Parameter Type Notes
query string Boolean operators, field filters (ticker:, source:, isin:) and quoted phrases
tickers string[] e.g. ['AAPL', 'NVDA']
sources string[] Replaces the default source set
optInSources string[] Added on top of the default set
excludeSources string[] Removed from results
countries string[] ISO 3166-1 alpha-2
categories ArticleCategory[] Topic filter
from / to string YYYY-MM-DD or ISO 8601
language string ISO 639-1, defaults to en server-side
includeContent bool Full article body
includeEntities bool Tagged company data
excludeEmptyContent bool Skip articles without content
orderBy / order OrderBy / SortOrder Sorting
page / pageSize int pageSize accepts 1–100

ArticleResponse is Countable and IteratorAggregate, so count($response) and foreach ($response as $article) both work. The raw list stays available as $response->articles.

A single article by URL

Sources

Webhooks

finlight signs every delivery with HMAC-SHA256. WebhookService verifies the signature, enforces a five-minute replay window when a timestamp header is present, and hands back a parsed Article.

It is static — no client instance and no API key required.

The body must be the raw, unparsed request bytes. Any middleware that decodes and re-encodes JSON before you read it will invalidate the signature.

Plain PHP

Laravel

Symfony

Configuration

Option Default Meaning
apiKey — Required. Sent as the X-API-KEY header
baseUrl https://api.finlight.me API base URL
timeoutMs 5000 Applies to the HTTP client this library creates for you
retryCount 3 Total attempts, so the default is one call plus two retries

Bringing your own HTTP client

Any PSR-18 client works. Inject it to control timeouts, proxies, middleware or logging:

When you inject a client, timeoutMs no longer applies — PSR-18 has no portable timeout setting, so configure it on your own client.

Errors

Everything this library throws implements Finlight\Exception\FinlightException, so one catch block covers the lot.

Exception When
AuthenticationException HTTP 401 / 403 — key invalid or plan lacks access
NotFoundException HTTP 404
RateLimitException HTTP 429 after retries; carries retryAfterSeconds
ApiException Any other non-2xx; carries statusCode and responseBody
TransportException No response at all — DNS, connection, TLS, timeout
MalformedResponseException A 2xx body missing a required field
WebhookVerificationException Signature, timestamp or payload rejected
ConfigurationException No PSR-18 client or PSR-17 factory available at construction

Retries

HTTP 429, 500, 502, 503 and 504 are retried automatically with exponential backoff (500 ms, 1 s, 2 s, …, capped at 30 s per pause), matching the official TypeScript client. Transport failures are not retried — they surface immediately as a TransportException.

Scope

This client covers the REST API and webhook verification.

WebSocket streaming is intentionally not included. PHP's request-response model is a poor fit for a long-lived stream, and doing it properly would require ReactPHP or Ratchet plus a supervised worker process. If you need the live stream, use the TypeScript, Go, Python or .NET clients — see docs.finlight.me. For push delivery into a PHP application, webhooks are the supported path.

Development

CI runs the suite against PHP 8.1 through 8.4.

Releasing

The package is distributed through Packagist, which reads this repository directly — there is no upload step.

  1. Bump FinlightClient::VERSION and update CHANGELOG.md.
  2. Tag the release: git tag v1.0.1 && git push --tags.
  3. Packagist picks up the tag automatically once the GitHub integration is enabled (Packagist → your profile → Settings → GitHub integration, or the package's Update button for a manual sync).

License

MIT — see LICENSE.


All versions of client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
php-http/discovery Version ^1.19
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package finlight/client contains the following files

Loading the files please wait ...