PHPackages                             cjrasmussen/wordpress-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. cjrasmussen/wordpress-api

ActiveLibrary[API Development](/categories/api)

cjrasmussen/wordpress-api
=========================

Simple helper for interacting with the WordPress REST API

1.0.3(1y ago)016MITPHPPHP &gt;=7.4.0

Since Oct 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/cjrasmussen/WordpressApi)[ Packagist](https://packagist.org/packages/cjrasmussen/wordpress-api)[ Docs](https://cjr.dev)[ RSS](/packages/cjrasmussen-wordpress-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

WordpressApi
============

[](#wordpressapi)

Simple class for making authenticated requests to the WordPress REST API. Not affiliated with WordPress. Currently only supports basic auth.

Usage
-----

[](#usage)

```
use cjrasmussen\WordpressApi\WordpressApi;

$wpApi = new WordpressApi($url);

// SET BASIC AUTH TOKEN
$wpApi->setAuthBasicToken('jfheriberwoifnoewigah');

// GET THE DATA ABOUT A SPECIFIED POST
$data = $wpApi->request('GET', "v2/posts/{$post_id}");

// SET BASIC AUTH TOKEN VIA USERNAME AND PASSWORD
$wpApi->setAuthUserPass('someuser', '1insecurepassword');

// DELETE A SPECIFIED MEDIA ITEM
$ipb->request('DELETE', "/v2/media/{$media_id}");
```

Installation
------------

[](#installation)

Simply add a dependency on cjrasmussen/wordpress-api to your composer.json file if you use [Composer](https://getcomposer.org/) to manage the dependencies of your project:

```
composer require cjrasmussen/wordpress-api
```

Although it's recommended to use Composer, you can actually include the file(s) any way you want.

License
-------

[](#license)

WordpressApi is [MIT](http://opensource.org/licenses/MIT) licensed.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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.

###  Release Activity

Cadence

Every ~236 days

Total

4

Last Release

612d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0225f44837a665c8a143afa50a34a406a769c523dba31e4cdf73fd0530dede45?d=identicon)[cjrasmussen](/maintainers/cjrasmussen)

---

Top Contributors

[![cjrasmussen](https://avatars.githubusercontent.com/u/15007730?v=4)](https://github.com/cjrasmussen "cjrasmussen (5 commits)")

---

Tags

apiwordpress

### Embed Badge

![Health badge](/badges/cjrasmussen-wordpress-api/health.svg)

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

###  Alternatives

[wp-graphql/wp-graphql-woocommerce

WooCommerce bindings for WPGraphQL

69146.8k](/packages/wp-graphql-wp-graphql-woocommerce)[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

118158.5k2](/packages/hieu-le-wordpress-xmlrpc-client)[wordpress/wp-ai-client

An AI client and API for WordPress to communicate with any generative AI models of various capabilities using a uniform API.

11117.5k1](/packages/wordpress-wp-ai-client)[pronamic/wp-documentor

Documentation Generator for WordPress.

6529.8k5](/packages/pronamic-wp-documentor)[rickwest/laravel-wordpress-api

A Laravel read-only client for the WordPress REST API (v2)

3712.5k1](/packages/rickwest-laravel-wordpress-api)[oomphinc/wp-forms-api

Drupal-esque API for creating and munging forms in WordPress

581.1k](/packages/oomphinc-wp-forms-api)

PHPackages © 2026

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