定制 bukku-accounting/open-exchange-rates-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固