Skip to content

Laravel Package for accessing the metals-api.com api

License

Notifications You must be signed in to change notification settings

kenzal/metals-api

Repository files navigation

Laravel Package for accessing the metals-api.com api

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.

About

Laravel Package for accessing the metals-api.com api

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages