承接 fastforex/fastforex-php-client 相关项目开发

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

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

fastforex/fastforex-php-client

Composer 安装命令:

composer require fastforex/fastforex-php-client

包简介

PHP client for fastFOREX.io Currency Exchange Rate API

README 文档

README

Tests Version

You'll need an API key to use the API client. Get a Free Trial API Key.

  • 160+ Currencies
  • 500+ Crypto Currencies
  • 2,300+ FX trading pairs
  • Up 55 years of historical data

Installation

With Composer:

composer require fastforex/fastforex-php-client

Quick Start

Set the API key once in your bootstrap code, or in the constructor:

\FastForex\Client::setApiKey('YOUR_API_KEY');
new \FastForex\Client('YOUR_API_KEY');

Fetch all currencies, with USD base:

$response = (new FastForex\Client())->fetchAll('USD');
print_r($response);
stdClass Object
(
    [base] => USD
    [results] => stdClass Object
        (
            [AED] => 3.67246
            [AFN] => 77.19882
            [ALL] => 101.68772
            ...
        )

    [updated] => 2021-02-15 22:13:51
    [ms] => 5
)

More Examples

Fetch GBP, with USD base:

$response = (new FastForex\Client())->fetchOne('USD', 'GBP');
echo $response->result->GBP;

Fetch several currencies with USD base:

$response = (new FastForex\Client())->fetchMulti('USD', ['GBP', 'EUR', 'CHF']);

Convert 200 USD to GBP:

$response = (new FastForex\Client())->convert('USD', 'GBP', 199.99);

Fetch a list of supported currencies

$response = (new FastForex\Client())->currencies();

Fetch recent API usage

$response = (new FastForex\Client())->usage();

Get all the historical exchange rates for 1st April 2021, with USD base:

$response = (new FastForex\Client())->historical(new \DateTime('2021-04-01'), 'USD');

Get a subset of historical exchange rates for 1st April 2021, with USD base:

$response = (new FastForex\Client())->historical(new \DateTime('2021-04-01'), 'USD', ['EUR', 'GBP', 'CHF']);

Get a 7-day time-series dataset for EUR to CHF

$response = (new FastForex\Client())->timeSeries(
        new \DateTime('2021-04-01'),
        new \DateTime('2021-04-07'),
        'EUR',
        'CHF'
    );

Error Handling

We throw the following Exceptions:

\InvalidArgumentException

Usually when input parameters to the client are wrong

\FastForex\Exception\APIException

When there is problem making the API call, or when there is an error response from the server.

We include the HTTP response code and error message wherever possible:

try {
    $response = (new FastForex\Client('INVALID_API_KEY'))->fetchAll('USD');
} catch (\FastForex\Exception\APIException $exception) {
    echo $exception->getMessage(), PHP_EOL;
}

Free Trial

Our 7-day free trial API keys are unrestricted. All features and full API quota.

API Documentation

fastFOREX API Documentation

OpenAPI Spec

https://github.com/fastforex/openapi

fastforex/fastforex-php-client 适用场景与选型建议

fastforex/fastforex-php-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12.96k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 02 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-15