承接 finazon/finazon-grpc-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

finazon/finazon-grpc-php

Composer 安装命令:

composer require finazon/finazon-grpc-php

包简介

Finazon gRPC client library for PHP

README 文档

README

This is the official PHP library for Finazon, offering access to:

  • Lists of datasets, publishers, markets, and tickers.
  • Market data: ticker snapshots, time series, trades, and technical indicators.
  • Data from specific datasets such as Benzinga, Binance, Crypto, Forex, SEC, and SIP.

🔑 API key is essential. If you haven't got one yet, sign up here.

Requirements

Ensure you have PHP 7.4 or later.

Installation

Install gRPC for PHP

Add package using Composer

composer require finazon/finazon-grpc-php

🔗 View the package on Packagist.

Updating to last version

composer update finazon/finazon-grpc-php

Quick start

1. Set up a new project

mkdir hello-finazon && cd hello-finazon
composer init --name="example/hello-finazon" --no-interaction
composer require finazon/finazon-grpc-php

2. Create time_series.php script

<?php
require 'vendor/autoload.php';

use Finazon\Grpc\Api\GetTimeSeriesRequest;
use Finazon\Grpc\Api\TimeSeries;
use Finazon\Grpc\Exception\RequestException;
use Finazon\Grpc\Service\TimeSeriesService;


// Load last OHLCV candles for AAPL
$service = new TimeSeriesService('your_api_key');
$request = new GetTimeSeriesRequest();
$request->setDataset('sip_non_pro')
    ->setTicker('AAPL')
    ->setInterval('1h')
    ->setPageSize(10);

try {
    $response = $service->getTimeSeries($request);
    echo 'Last AAPL OHLCV data' . PHP_EOL;
    foreach ($response->getResult() as $t) {
        /** @var Timeseries $t */
        echo sprintf(
            '%s - %s, %s, %s, %s, %s %s',
            $t->getTimestamp(), $t->getOpen(), $t->getHigh(), $t->getLow(), $t->getClose(),
            $t->getVolume(), PHP_EOL,
        );
    }
} catch (RequestException $e) {
    echo sprintf('Received error, code: %s, message: %s%s', $e->getCode(), $e->getMessage(), PHP_EOL);
}

3. Input your API key

Replace 'your_api_key' with your actual key.

4. Run script

php time_series.php

📝 Expected output:

Last AAPL OHLCV data
1709582400 - 175.325, 175.5, 174.95, 175.1, 14962271
1709578800 - 174.2, 175.645, 173.98, 175.325, 8209663
1709575200 - 174.05, 174.505, 173.79, 174.205, 7869144
1709571600 - 174.1112, 174.7, 174.01, 174.05, 7365810
1709568000 - 174.835, 175.895, 174.1, 174.1201, 8672800
1709564400 - 174.96, 175.929, 173.9, 174.83, 14265584
1709560800 - 176.15, 176.9, 174.62, 174.97, 13824038
1709323200 - 179.9312, 179.97, 179.415, 179.695, 7701993
1709319600 - 179.315, 180.22, 179.31, 180.005, 6668926
1709316000 - 178.515, 179.39, 178.33, 179.32, 6103415

👀 Check the full example and other examples here

RPC support

The following table outlines the supported rpc calls:

Service rpc Description
ApiUsageService getApiUsage Get a list of products with quota limit/usage
BenzingaService getDividentsCalendar Returns the dividends calendar from Benzinga
BenzingaService getEarningsCalendar Returns the earnings calendar from Benzinga
BenzingaService getNews Returns the news articles from Benzinga
BenzingaService getIPO Returns IPO data from Benzinga
BinanceService getTimeSeries Get time series data without technical indicators
CryptoService getTimeSeries Get time series data for any given ticker
DatasetsService getDatasets Get a list of all datasets available at Finazon.
ExchangeService getMarketsCrypto Returns a list of supported crypto markets
ExchangeService getMarketsStocks Returns a list of supported stock markets
ForexService getTimeSeries Get time series data for any given ticker
PublisherService getPublishers Get a list of all publishers available at Finazon.
SecService getFilings Real-time and historical access to all forms, filings, and exhibits directly from the SEC's EDGAR system.
SipService getTrades Returns detailed information on trades executed through the Securities Information Processor (SIP)
SipService getMarketCenter Returns a list of market centers
SnapshotService getSnapshot This endpoint returns a combination of different data points, such as daily performance, last quote, last trade, minute data, and previous day performance.
TickersService findTickersStocks This API call returns an array of stocks tickers available at Finazon Data API. This list is updated daily.
TickersService findTickersCrypto This API call returns an array of crypto tickers available at Finazon Data API. This list is updated daily.
TickersService findTickersForex This API call returns an array of forex tickers available at Finazon Data API. This list is updated daily.
TickersService findTickersUS This API call returns an array of US tickers available at Finazon Data API. This list is updated daily.
TimeSeriesService getTimeSeries Get time series data without technical indicators
TimeSeriesService getTimeSeriesAtr Get time series data for ATR technical indicator.
TimeSeriesService getTimeSeriesBBands Get time series data for BBands technical indicator.
TimeSeriesService getTimeSeriesIchimoku Get time series data for Ichimoku technical indicator.
TimeSeriesService getTimeSeriesMa Get time series data for Ma technical indicator.
TimeSeriesService getTimeSeriesMacd Get time series data for Macd technical indicator.
TimeSeriesService getTimeSeriesObv Get time series data for Obv technical indicator.
TimeSeriesService getTimeSeriesRsi Get time series data for Rsi technical indicator.
TimeSeriesService getTimeSeriesSar Get time series data for Sar technical indicator.
TimeSeriesService getTimeSeriesStoch Get time series data for Stoch technical indicator.
TradeService getTrades Returns general information on executed trades

Here's how you can use service and request objects:

<?php
require 'vendor/autoload.php';

use Finazon\Grpc\Api\RpcNameRequest;
use Finazon\Grpc\Service\ServiceNameService;

# ...

$service = new ServiceNameService('your_api_key');
$request = new RpcNameRequest();
$response = service->rpcName($request);

Documentation

Delve deeper with our official documentation.

Examples

Explore practical scenarios in the examples directory.

Support

Stay updated

Contributing

  1. Fork and clone: $ git clone https://github.com/finazon-io/finazon-grpc-php.git.
  2. Branch out: $ cd finazon-grpc-php && git checkout -b my-feature.
  3. Commit changes and test.
  4. Push your branch and open a pull request with a comprehensive description.

For more guidance on contributing, see the GitHub Docs on GitHub.

License

This project is licensed under the MIT License. See the LICENSE.txt file in this repository for more details.

finazon/finazon-grpc-php 适用场景与选型建议

finazon/finazon-grpc-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 03 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「api」 「financial data」 「finazon」 「finazon grpc」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 finazon/finazon-grpc-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 finazon/finazon-grpc-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 finazon/finazon-grpc-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 17
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-05