PHPackages                             kenzal/metals-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. kenzal/metals-api

ActiveLibrary[API Development](/categories/api)

kenzal/metals-api
=================

Laravel Package for accessing the metals-api.com api

v1.1.0(3y ago)06MITPHPPHP ^8.1

Since Jan 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/kenzal/metals-api)[ Packagist](https://packagist.org/packages/kenzal/metals-api)[ Docs](https://github.com/kenzal/metals-api)[ GitHub Sponsors](https://github.com/sponsors/kenzal)[ Fund](https://tidelift.com/lifter/search/packagist/kenzal%2Fmetals-api)[ RSS](/packages/kenzal-metals-api/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (9)Versions (4)Used By (0)

Laravel Package for accessing the metals-api.com api
====================================================

[](#laravel-package-for-accessing-the-metals-apicom-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/205c7d1f562a6b09fc2500af5d21eb53bdbbaa3560200b3a44df878cf682399f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b656e7a616c2f6d6574616c732d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kenzal/metals-api)[![GitHub Tests Action Status](https://camo.githubusercontent.com/64606239574b2cd9cdd0100338e0eb47ee93821950f6aae0330fc294865e5c01/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b656e7a616c2f6d6574616c732d6170692f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/kenzal/metals-api/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d6094064026bc4b33c8b5109d730141433822e76b8d99c78ba22b494e9bb2982/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b656e7a616c2f6d6574616c732d6170692f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/kenzal/metals-api/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/c3daff80b2fc9028a6371d95f8b9e1dca120dffabadf0f1d0f9dd40792709b0d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b656e7a616c2f6d6574616c732d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kenzal/metals-api)

A laravel package for accessing the api at

Requirements
------------

[](#requirements)

In order to use this package, you will need an account with [Metals-API.com](https://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
------------

[](#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
-----

[](#usage)

```
$metalsApi = new Kenzal\MetalsApi($config);
echo $metalsApi->latest(symbols:['XAG','XAU'], base:'USD');
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](SECURITY.md) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Kenzal Hunter](https://github.com/kenzal)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1254d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f421d21816ff4060beb5248cd10094f7a76a3b4476f629349225f0cc770fb685?d=identicon)[kenzal](/maintainers/kenzal)

---

Top Contributors

[![kenzal](https://avatars.githubusercontent.com/u/2412533?v=4)](https://github.com/kenzal "kenzal (17 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelkenzalmetals-api

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/kenzal-metals-api/health.svg)

```
[![Health](https://phpackages.com/badges/kenzal-metals-api/health.svg)](https://phpackages.com/packages/kenzal-metals-api)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M164](/packages/spatie-laravel-health)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k91](/packages/nativephp-mobile)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
