PHPackages                             brianhenryie/bh-php-monero-explorer - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. brianhenryie/bh-php-monero-explorer

ActiveLibrary[HTTP &amp; Networking](/categories/http)

brianhenryie/bh-php-monero-explorer
===================================

Monero HTTP client.

101[1 PRs](https://github.com/BrianHenryIE/bh-php-monero-explorer/pulls)PHPCI passing

Since Jul 18Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/BrianHenryIE/bh-php-monero-explorer)[ Packagist](https://packagist.org/packages/brianhenryie/bh-php-monero-explorer)[ RSS](/packages/brianhenryie-bh-php-monero-explorer/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (3)Used By (0)

![PHP 8.4](https://camo.githubusercontent.com/4521de29291641d6ce58dbde10672877901c3ea42942780871f81de8d3ba939f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342d3838393242462e737667) [![PHPCS PSR-12](https://camo.githubusercontent.com/56b8d0e30cdddaac2db778a2ac2ecd4339ba90ee5ee2f0e416977b514d2cb661/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50485043532d50535225453225383025393331322d3232363134362e737667)](https://www.php-fig.org/psr/psr-12/) [![PHPUnit ](.github/coverage.svg)](https://brianhenryie.github.io/bh-php-monero-explorer/) [![PHPStan ](.github/phpstan.svg)](https://phpstan.org/)

Monero Explorer PHP Client
==========================

[](#monero-explorer-php-client)

A thin, strongly typed PHP SDK for [Onion Monero Blockchain Explorer](https://github.com/moneroexamples/onion-monero-blockchain-explorer/) instances' HTTP API, e.g. [xmrchain.net](https://xmrchain.net/).

> [Monero](https://www.getmonero.org/) (XMR) is a private, decentralized cryptocurrency, developed with the goals of privacy and security first, ease of use and efficiency second.

Fetching and parsing JSON is very easy with PHP, so this library's value comes from the typed classes and the documentation in PhpDoc. Please contribute clarifications to functions' purposes.

Use
---

[](#use)

Before v1.0, function signatures are expected to change as they are properly documented.

```
composer require --fixed brianhenryie/bh-php-monero-explorer@dev
```

You also need a [PSR-7 implementation](https://packagist.org/providers/psr/http-client-implementation) and a [PSR-17 implementation](https://packagist.org/providers/psr/http-factory-implementation), the most popular being `guzzlehttp/guzzle`.

`ExplorerApi` is a direct mapping of [API endpoints](https://github.com/moneroexamples/onion-monero-blockchain-explorer/blob/aa96ce2927c050fabe17154a3bdfb09be83a632f/main.cpp#L656-L837) to PHP functions.

```
/** @var Psr\Http\Message\RequestFactoryInterface $requestFactory */
$requestFactory = new \GuzzleHttp\Psr7\HttpFactory();
/** @var Psr\Http\Client\ClientInterface $client */
$client = new \GuzzleHttp\Client();

$explorerApi = new \BrianHenryIE\MoneroExplorer\ExplorerApi( $requestFactory, $client );

/** @var \BrianHenryIE\MoneroExplorer\Model\NetworkInfo $networkInfo */
$networkInfo = $explorerApi->getNetworkInfo();

$lastBlockHeight = $networkInfo->height - 1;
```

Models are `final readonly` classes with public properties (PHP &gt;= 8.4 is required).

> **Privacy:** `getOutputs()`/`getOutputsBlocks()` send an address and view key to the explorer server, permanently disclosing that wallet's incoming transactions to its operator. Prefer a self-hosted instance — this repository ships one:

```
make integration-up   # monerod (regtest) + monero-wallet-rpc + xmrblocks; first run compiles monerod + xmrblocks from source (~20 min)
make integration-seed # deterministic test chain: 131 blocks, two seeded payments
composer test-integration
make integration-down
```

`ExplorerTools` extends `ExplorerApi` to add convenience functions.

```
$explorerTools = new \BrianHenryIE\MoneroExplorer\ExplorerTools( $requestFactory, $client );

$lastBlockHeight = $explorerTools->getLastBlockHeight();
```

### Accept a Monero payment

[](#accept-a-monero-payment)

To accept a payment with Monero...

1. Share payment address with customer
2. Note the blockchain height at that time
3. Periodically/progressively check new blocks since then inspecting for payment

See: [`examples/VerifyingPaymentsReceived.php`](https://github.com/BrianHenryIE/bh-php-monero-explorer/blob/master/examples/VerifyingPaymentsReceived.php).

Implementation
--------------

[](#implementation)

Initial `class-monero-explorer-tools.php` extracted from [monero-integrations/monerowp](https://github.com/monero-integrations/monerowp/blob/9ba2b640f7bd31441f9994dd66916bf480ed9016/include/class-monero-explorer-tools.php).

### Goals:

[](#goals)

- Strongly typed: nested objects now map to models; a few responses (raw miner tx, detailed transaction) remain `stdClass`/arrays
- Unit tested: 100% should be achievable on what is just a thin wrapper
- Use [PSR-7 HTTP client](https://www.php-fig.org/psr/psr-7/) &amp; [PSR-17 HTTP factory](https://www.php-fig.org/psr/psr-17/)
- PhpDoc
- Short tutorial

### Notes

[](#notes)

- API is read-only
- API responses are JSON formatted using the [JSend](https://github.com/omniti-labs/jsend) convention

### Composer

[](#composer)

Runtime dependencies are minimal: [JsonMapper/JsonMapper](https://github.com/JsonMapper/JsonMapper) ([JsonMapper.net](https://jsonmapper.net)) hydrates responses into the typed models, plus a consumer-supplied PSR-7/PSR-17 HTTP implementation. The [JSend](https://github.com/omniti-labs/jsend) response envelope is unwrapped directly in `ExplorerApi::callApi()` — no JSend library is required.

Acknowledgements
----------------

[](#acknowledgements)

- [Monero Onion Blockchain Explorer](https://github.com/moneroexamples/onion-monero-blockchain-explorer/graphs/contributors)
- [SerHack](https://github.com/serhack)

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance61

Regular maintenance activity

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4720401?v=4)[Brian Henry](/maintainers/BrianHenryIE)[@BrianHenryIE](https://github.com/BrianHenryIE)

---

Top Contributors

[![BrianHenryIE](https://avatars.githubusercontent.com/u/4720401?v=4)](https://github.com/BrianHenryIE "BrianHenryIE (53 commits)")

### Embed Badge

![Health badge](/badges/brianhenryie-bh-php-monero-explorer/health.svg)

```
[![Health](https://phpackages.com/badges/brianhenryie-bh-php-monero-explorer/health.svg)](https://phpackages.com/packages/brianhenryie-bh-php-monero-explorer)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25026.8M85](/packages/php-http-cache-plugin)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

85997.3k131](/packages/httpsoft-http-message)[thesis/nats

Async (fiber based) client for Nats.

758.3k](/packages/thesis-nats)

PHPackages © 2026

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