A laravel package for accessing the api at https://metals-api.com/
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.
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),
];
$metalsApi = new Kenzal\MetalsApi($config);
echo $metalsApi->latest(symbols:['XAG','XAU'], base:'USD');
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.