PHPackages                             humanmade/mercator-rest-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. humanmade/mercator-rest-api

ActiveWordpress-muplugin[API Development](/categories/api)

humanmade/mercator-rest-api
===========================

REST API endpoint for Mercator.

212[2 issues](https://github.com/humanmade/Mercator-REST-API/issues)[2 PRs](https://github.com/humanmade/Mercator-REST-API/pulls)PHP

Since Dec 4Pushed 7y ago21 watchersCompare

[ Source](https://github.com/humanmade/Mercator-REST-API)[ Packagist](https://packagist.org/packages/humanmade/mercator-rest-api)[ RSS](/packages/humanmade-mercator-rest-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Mercator REST API
=================

[](#mercator-rest-api)

REST API for working with domain mappings.

Requires WordPress 4.5+ or the [WP REST API plugin](https://github.com/WP-API/WP-API)

Usage
-----

[](#usage)

You need to include and instantiate the controller:

```
add_action( 'rest_api_init', function() {
    include 'class-rest-api.php';
    $api = new Mercator\REST_API;
    $api->register_routes();
} );
```

The controller adds two API routes:

```
/wp-json/mercator/v1/mappings       // accepts GET, POST
/wp-json/mercator/v1/mappings/:id   // accepts PUT, PATCH, DELETE

```

You can additionally specify a blog ID by passing in a `GET` parameter:

```
/wp-json/mercator/v1/mappings?blog=1

```

### Data structure

[](#data-structure)

Mappings are very simple. The example JSON object for a mapping is as follows:

```
{
    "id": 1                       // integer
    "domain": "example.com",      // string
    "active": true                // boolean
}

```

When creating a mapping using `POST` you only need to send the `domain` and `active` values.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90.9% 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/77dbeefb7745010589603f2ffc6ff310d8f700b58e08d52af190744c43342526?d=identicon)[roborourke](/maintainers/roborourke)

---

Top Contributors

[![roborourke](https://avatars.githubusercontent.com/u/23417?v=4)](https://github.com/roborourke "roborourke (10 commits)")[![joehoyle](https://avatars.githubusercontent.com/u/161683?v=4)](https://github.com/joehoyle "joehoyle (1 commits)")

### Embed Badge

![Health badge](/badges/humanmade-mercator-rest-api/health.svg)

```
[![Health](https://phpackages.com/badges/humanmade-mercator-rest-api/health.svg)](https://phpackages.com/packages/humanmade-mercator-rest-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

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

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

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

PHP wrapper for the Meilisearch API

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

Google API Core for PHP

263103.1M453](/packages/google-gax)

PHPackages © 2026

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