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.

101PHP

Since Jun 7Pushed 2y 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 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

![PHP 7.4](https://camo.githubusercontent.com/b955874d3e9269aa5e72f9d11ea2f4a1c9d907cd5d5a9c2361d646b962a91584/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342d3838393242462e737667) [![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->getHeight() - 1;
```

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

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

$lastBlockHeight = $explorer->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: some types are incomplete, some are deserialized as 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/) | [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)

The required libraries were chosen due to their robust code coverage:

- [miWebb/JSend](https://github.com/miWebb/JSend) - 100% coverage
- [JsonMapper/JsonMapper](https://github.com/JsonMapper/JsonMapper) | [JsonMapper.net](https://jsonmapper.net) - 100% coverage

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

[](#acknowledgements)

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

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity22

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://www.gravatar.com/avatar/3541a510f89dedd04f0e7103201e411f6f22685a13e941b3384d97d4c7d32b09?d=identicon)[BrianHenryIE](/maintainers/BrianHenryIE)

---

Top Contributors

[![BrianHenryIE](https://avatars.githubusercontent.com/u/4720401?v=4)](https://github.com/BrianHenryIE "BrianHenryIE (33 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

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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