PHPackages                             wp-api/discovery - 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. wp-api/discovery

ActiveLibrary[API Development](/categories/api)

wp-api/discovery
================

412.2k3[2 issues](https://github.com/WP-API/discovery-php/issues)[2 PRs](https://github.com/WP-API/discovery-php/pulls)PHP

Since Dec 8Pushed 8y ago6 watchersCompare

[ Source](https://github.com/WP-API/discovery-php)[ Packagist](https://packagist.org/packages/wp-api/discovery)[ RSS](/packages/wp-api-discovery/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

WordPress API Discovery
=======================

[](#wordpress-api-discovery)

This library allows autodiscovery of the WordPress REST API shipping in WordPress 4.4.

Installing
----------

[](#installing)

This library should be installed via Composer as `wp-api/discovery`.

If manually installing (i.e. via `git clone`), be sure to run `composer install` after cloning the code.

Using
-----

[](#using)

The main entry point is the `WordPress\Discovery\discover()` function. Simply pass in a URL to discover the API.

```
/**
 * Discover the WordPress API from a URI.
 *
 * @param string $uri URI to start the search from.
 * @param bool $legacy Should we check for the legacy API too?
 * @return Site|null Site data if available, null if not a WP site.
 */
function discover( $uri, $legacy = false ) {
```

This project also includes a demo web install:

```
php -S 0.0.0.0:9000 www/index.php
```

Then access  to view the demo. It looks something like this:

[![](https://camo.githubusercontent.com/19f18b1c8bf4bcbada144fa608aae43431df4d2a9e2c6a2b3f5e63337a0535cf/687474703a2f2f692e696d6775722e636f6d2f734b44304646742e706e67)](https://camo.githubusercontent.com/19f18b1c8bf4bcbada144fa608aae43431df4d2a9e2c6a2b3f5e63337a0535cf/687474703a2f2f692e696d6775722e636f6d2f734b44304646742e706e67)

License
-------

[](#license)

This project is licensed under the MIT license. See [LICENSE.md](LICENSE.md) for the full license.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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/21655?v=4)[Ryan McCue](/maintainers/rmccue)[@rmccue](https://github.com/rmccue)

---

Top Contributors

[![rmccue](https://avatars.githubusercontent.com/u/21655?v=4)](https://github.com/rmccue "rmccue (6 commits)")

### Embed Badge

![Health badge](/badges/wp-api-discovery/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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