定制 aveiv/open-exchange-rates-api 二次开发

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

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

aveiv/open-exchange-rates-api

最新稳定版本:v2.1.1

Composer 安装命令:

composer require aveiv/open-exchange-rates-api

包简介

PHP wrapper for Open Exchange Rates API

README 文档

README

Latest Stable Version Total Downloads License

Installation

composer require aveiv/open-exchange-rates-api

Usage example

$api = new OpenExchangeRates('YOUR_APP_ID');
// or $client = new OpenExchangeRates('YOUR_APP_ID', new YourHttpClient());


// Getting currencies

$api->currencies(); // returns ["USD" => "United States Dollar", ...]

$api->currencies([
    'show_alternative' => true, // include alternative currencies
    'show_inactive' => true,    // include historical/inactive currencies
]);


// Getting latest rates

$api->latest(); // returns ["USD" => 1.0, ...]

$api->latest([
    'base' => 'EUR',             // base currency
    'symbols' => ['CNY', 'USD'], // limit results to specific currencies
    'show_alternative' => true,  // include alternative currencies
]);


// Getting historical rates

$api->historical(new \DateTime('2020-01-01')); // ["USD" => 1.0, ...]

$api->historical(new \DateTime('2020-01-01'), [
    'base' => 'EUR',             // base currency
    'symbols' => ['CNY', 'USD'], // limit results to specific currencies
    'show_alternative' => true,  // include alternative currencies
]);


// Currency conversion

$api->convert(99.99, 'USD', 'EUR'); // returns the converted value (from USD to EUR)

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-23