kenzal / metals-api
Laravel Package for accessing the metals-api.com api
v1.1.0
2023-01-26 19:27 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.5
- illuminate/contracts: ^9.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpunit/phpunit: ^9.5
README
A laravel package for accessing the api at https://metals-api.com/
Requirements
In order to use this package, you will need an account with Metals-API.com as this is just a wrapper for their service. Please note that all requests count towards a monthly quota determined by your account level.
Installation
You can install the package via composer:
composer require kenzal/metals-api
You can publish the config file with:
php artisan vendor:publish --tag="metals-api-config"
This is the contents of the published config file:
return [ 'access_key' => env('METALS_API_ACCESS_KEY'), 'host' => env('METALS_API_HOST', 'https://metals-api.com'), 'port' => env('METALS_API_PORT', null), 'base' => env('METALS_API_BASE', 'USD'), 'symbols' => env('METALS_API_SYMBOLS', null), ];
Usage
$metalsApi = new Kenzal\MetalsApi($config); echo $metalsApi->latest(symbols:['XAG','XAU'], base:'USD');
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.