bukku-accounting/open-exchange-rates-php
Composer 安装命令:
composer require bukku-accounting/open-exchange-rates-php
包简介
Open Exchange Rates PHP SDK
README 文档
README
About the Open Exchange Rates API
Open Exchange Rates provides a simple, lightweight and portable JSON API with live and historical foreign exchange (forex) rates for over 200 worldwide and digital currencies, via a simple and easy-to-integrate API, in JSON format. Data are tracked and blended algorithmically from multiple reliable sources, ensuring fair and unbiased consistency.
Exchange rates published through the Open Exchange Rates API are collected from multiple reliable providers, blended together and served up in JSON format for everybody to use. There are no complex queries, confusing authentication methods or long-term contracts.
Features
- Latest up-to-date Exchange Rates
- Historical Exchange Rates back to 1st January 1999
- Time Series Exchange Rates for a given time period
- Currency Converstion
- Historical Open, High Low and Close
Website: https://openexchangerates.org/
Installation
With Composer
composer require bukku-accounting/open-exchange-rates-php
Getting Started
Use it as a class
use BukkuAccounting\OpenExchangeRates\OerClient; $oerClient = new OerClient('YOUR_APP_ID');
Available functions
- All the API endpoints listed in https://docs.openexchangerates.org/reference/api-introduction are made available to use
- Methods can be chained
- All functions return an object
- Will throw an exception with the message and status code if there is an error
Example: Request latest rates via "latest" endpoint
$res = $oerClient ->base('SGD') ->symbols('USD,EUR,GBP') ->latest();
Example: Request historical rates via "historical" endpoint
$res = $oerClient ->date('2022-01-01') ->base('SGD') ->symbols('USD,EUR,GBP') ->historical();
Example: Request the list of currency symbols available via "currencies" endpoint
$res = $oerClient ->currencies();
Example: Request historical rates for a given time period via "time_series" endpoint
$res = $oerClient ->start('2000-01-01') ->end('2000-12-31') ->base('SGD') ->symbols('USD,EUR,GBP') ->time_series();
Example: Convert any value from one currency to another via "convert" endpoint
$res = $oerClient ->value(10000) ->from('SGD') ->to('MYR') ->convert();
Example: Request the historical Open, High Low, Close and Average for a given time period via "ohlc" endpoint
$res = $oerClient ->start_time('2017-07-17T00:00:00Z') ->period('1w') ->base('SGD') ->symbols('USD,EUR,GBP') ->ohlc();
Example: Request the plan information and usage statistics via "usage" endpoint
$res = $oerClient ->usage();
Reference API Documentation
Visit https://docs.openexchangerates.org/reference/api-introduction for more details on each function
bukku-accounting/open-exchange-rates-php 适用场景与选型建议
bukku-accounting/open-exchange-rates-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 88 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 01 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 bukku-accounting/open-exchange-rates-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bukku-accounting/open-exchange-rates-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 88
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-18