PHPackages                             masonitedoors/searchwp-api-route - 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. masonitedoors/searchwp-api-route

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

masonitedoors/searchwp-api-route
================================

Adds an endpoint to the WordPress REST API for searching via SearchWP.

1.2.0(6y ago)0979gplv2+PHP

Since Jun 25Pushed 6y agoCompare

[ Source](https://github.com/masonitedoors/searchwp-api-route)[ Packagist](https://packagist.org/packages/masonitedoors/searchwp-api-route)[ RSS](/packages/masonitedoors-searchwp-api-route/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (7)Used By (0)

[![Banner](https://camo.githubusercontent.com/a146c109add8582e05d0a11f14b7941c0f64c3ffde2285663cacc7fa67940d8c/68747470733a2f2f63616c6465726177702e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031352f30362f57504f52475f53656172636857502e706e67)](https://camo.githubusercontent.com/a146c109add8582e05d0a11f14b7941c0f64c3ffde2285663cacc7fa67940d8c/68747470733a2f2f63616c6465726177702e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031352f30362f57504f52475f53656172636857502e706e67)

SearchWP API
============

[](#searchwp-api)

Adds an endpoint to the WordPress REST API for searching via [SearchWP](https://searchwp.com/?ref=121) -- the best tool for improving the usefulness and performance of WordPress search.

This plugin is a free plugin by [CalderaWP](https://CalderaWP.com). It is not an official add-on for SearchWP and is no way associated with SearchWP or the National Football League.

- Requires WordPress REST API (WP-API) 2.0-beta9 or later or WordPress 4.4 or later.
- Requires SearchWP Version 2.6 or later

Technically will work without SearchWP, but queries will run through WP\_Query.

### Example Queries

[](#example-queries)

For a complete list of possible queries, see:

- `wp-json/swp_api/search?s=jedi&engine=star-wars`
- `wp-json/swp_api/search?&tax_query[field]=slug&tax_query[taxonomy]=categories&tax_query[terms]=1`
- `wp-json/swp_api/search?meta_query[key]=jedi&meta_query[value]=luke&tax_query[compare]=IN`

### Other Post Types

[](#other-post-types)

- Added in version 1.2.0 By default query is against posts, to query against the post type "jedi" use:
- - `wp-json/swp_api/search?s=rey&post_type=jedi`

### Multiple Meta Queries

[](#multiple-meta-queries)

Nested meta queries added in version 1.1.0 and allow for querying by multiple meta fields. Be sure to see the [relevant section of the WP\_Query docs](https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters)

##### Simple Nested Query

[](#simple-nested-query)

Use a `[]` to create a basic nested query. Default meta\_relation is AND. Default compare is IN.

Example: Search where jedi field is "luke" and sith field is "vader".

URL String: `/wp-json/swp_api/search?meta_query[key][]=jedi&meta_query[value][]=luke&meta_query[key][]=sith&meta_query[value][]=vader`

Translates to:

```
'meta_query' => array (
  'relation' => 'AND',
  array (
    'key' => 'jedi',
    'value' => 'luke',
    'compare' => 'IN',
  ),
  array (
    'key' => 'sith',
    'value' => 'vader',
    'compare' => 'IN',
  ),
)
```

##### Relationships Between Query Parts

[](#relationships-between-query-parts)

Use variable `meta_relation` to change relationship been queries. Also, you can set compare, like with regular meta\_queries. Make sure your compare argument is in the right order.

Example: Search where jedi field is "luke" or sith field is not "vader".

URL String `wp-json/swp_api/search?meta_query[key][]=jedi&meta_query[value][]=luke&meta_query[compare][]=in&meta_query[key][]=sith&meta_query[value][]=vader&meta_query[compare][]=NOT%20IN&meta_relation=OR`

Translates to:

```
'meta_query' => array (
  'relation' => 'OR',
  array (
    'key' => 'jedi',
    'value' => 'luke',
    'compare' => 'IN',
  ),

  array (
    'key' => 'sith',
    'value' => 'vader',
    'compare' => 'NOT IN',
  ),
)
```

##### Multiple Values In A Query Part

[](#multiple-values-in-a-query-part)

Put multiple fields into your query parts, by adding extra nesting levels in URL string. Order gets very tricky, numbers (remember to start at 0) help, as shown below.

Example: Search where jedi field is "luke" or "obi-wan" and sith field is not "vader".

URL STRING: `wp-json/swp_api/search?meta_query[key][]=jedi&meta_query[value][0][]=luke&meta_query[value][0][]=obi-wan&meta_query[compare][]=in&meta_query[key][]=sith&meta_query[value][]=vader&meta_query[compare][]=NOT%20IN&meta_relation=AND`

```
array (
  'relation' => 'AND',
  array (
    'key' => 'jedi',
    'value' => array ('luke', 'obi-wan' ),
    'compare' => 'IN',
  ),
  array (
    'key' => 'sith',
    'value' => 'vader',
    'compare' => 'NOT IN',
  ),
)
```

### License &amp; Copyright

[](#license--copyright)

- Copyright 2015 Josh Pollock for CalderaWP LLC.
- Licensed under the terms of the [GNU General Public License version 2](http://www.gnu.org/licenses/gpl-2.0.html) or later.
- Please share with your neighbor.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 94.3% 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 ~333 days

Recently: every ~414 days

Total

6

Last Release

2358d ago

Major Versions

0.3.0 → 1.0.02015-07-06

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6676674?v=4)[Joe Fusco](/maintainers/josephfusco)[@josephfusco](https://github.com/josephfusco)

![](https://avatars.githubusercontent.com/u/7424837?v=4)[ipetty](/maintainers/ipetty)[@ipetty](https://github.com/ipetty)

---

Top Contributors

[![Shelob9](https://avatars.githubusercontent.com/u/1994311?v=4)](https://github.com/Shelob9 "Shelob9 (33 commits)")[![josephfusco](https://avatars.githubusercontent.com/u/6676674?v=4)](https://github.com/josephfusco "josephfusco (2 commits)")

---

Tags

wordpresswp-apisearchwpwp-json-api

### Embed Badge

![Health badge](/badges/masonitedoors-searchwp-api-route/health.svg)

```
[![Health](https://phpackages.com/badges/masonitedoors-searchwp-api-route/health.svg)](https://phpackages.com/packages/masonitedoors-searchwp-api-route)
```

###  Alternatives

[airesvsg/acf-to-rest-api

Exposes Advanced Custom Fields Endpoints in the WordPress REST API

1.4k78.0k](/packages/airesvsg-acf-to-rest-api)[wordpress/mcp-adapter

Adapter for Abilities API, letting WordPress abilities to be used as MCP tools, resources or prompts

887184.7k4](/packages/wordpress-mcp-adapter)[humanmade/mercator

WordPress multisite domain mapping for the modern era.

532189.6k5](/packages/humanmade-mercator)[wp-graphql/wp-graphql-woocommerce

WooCommerce bindings for WPGraphQL

70556.6k](/packages/wp-graphql-wp-graphql-woocommerce)[sybrew/the-seo-framework

An automated, advanced, accessible, unbranded and extremely fast SEO solution for any WordPress website.

47884.4k](/packages/sybrew-the-seo-framework)[hieu-le/wordpress-xmlrpc-client

A PHP client for Wordpress websites that closely implement the XML-RPC WordPress API with full test suite built in

116162.9k2](/packages/hieu-le-wordpress-xmlrpc-client)

PHPackages © 2026

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