ahmeti/bank-exchange-rates

1.8 2023-01-15 22:14 UTC

This package is auto-updated.

Last update: 2024-09-16 01:59:40 UTC


README

使用此包,您可以获取以下银行的公开汇率信息:

使用Composer安装

composer require ahmeti/bank-exchange-rates
require __DIR__ . '/vendor/autoload.php';

try {
    $rates = (new \Ahmeti\BankExchangeRates\Service)->get();
    print_r($rates);
    
}catch (\Exception $exception){
    print_r($exception);
}

银行列表

  • 担保银行
  • 建设银行
  • 人民银行
  • Enpara
  • 安银行
  • 工商银行
  • 科威特银行
  • 农业银行
  • 手机TEB

示例数据

[
  "USD/TRY" => [
    [
      "name" => "Garanti",
      "symbol" => "USD/TRY"
      "buy" => 18.463
      "sell" => 19.063
      "time" => "2023-01-06 00:00:37"
      "description" => "Amerikan Doları (us/tr)"
    ],
    [
      "name" => "Yapı Kredi",
      "symbol" => "USD/TRY"
      "buy" => 18.70675
      "sell" => 18.94574
      "time" => "2023-01-06 00:16:08"
      "description" => null
    ]
  ]
  
  "EUR/TRY" => [
    [
      "name" => "Garanti",
      "symbol" => "EUR/TRY"
      "buy" => 19.427
      "sell" => 20.059
      "time" => "2023-01-06 00:00:37"
      "description" => "Avrupa Para Birimi (eu/tr)"
    ],
    [
      "name" => "Yapı Kredi",
      "symbol" => "EUR/TRY"
      "buy" => 19.70949
      "sell" => 19.96007
      "time" => "2023-01-06 00:16:08"
      "description" => null
    ]
  ]
]
...