samiax/bank-exchange-rates

银行外汇汇率 - Api

0.6.0 2024-07-02 08:47 UTC

This package is auto-updated.

Last update: 2024-10-02 09:21:21 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
    ]
  ]
]
...