PHPackages                             arkqa/discourse-api.php - 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. arkqa/discourse-api.php

ActiveLibrary[API Development](/categories/api)

arkqa/discourse-api.php
=======================

Discourse API client for PHP

1103[1 issues](https://github.com/ArkQA/DiscourseApi.php/issues)PHP

Since May 7Pushed 11y ago1 watchersCompare

[ Source](https://github.com/ArkQA/DiscourseApi.php)[ Packagist](https://packagist.org/packages/arkqa/discourse-api.php)[ RSS](/packages/arkqa-discourse-apiphp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

DiscourseApi.php
================

[](#discourseapiphp)

This is really more of a learning experience -- working on a WordPress site for a friend and needed extensible hooks for Discourse.

I've only personally tested this on HHVM (5.6.99-hhvm) and PHP 5.6.8+.

Pull requests and feature additions are welcome, and this will be maintained for a decent amount of time as I've really taken a liking to Discourse and have been using it in a few projects.

At some point I'm going to namespace everything and separate things by user, group, sso, etc, but this will be on another branch/version to maintain backward compatibility.

Troubleshooting
---------------

[](#troubleshooting)

### End user IPs are that of the server (post content, registration, etc.)

[](#end-user-ips-are-that-of-the-server-post-content-registration-etc)

Enable realip/x-f-f on whatever is backing your instance. Check samples/ to persist this if you are directly running nginx from docker.

#### nginx

[](#nginx)

```
set_real_ip_from  192.168.5.150;
real_ip_header    X-Forwarded-For;

```

#### apache

[](#apache)

```
RemoteIPHeader X-Forwarded-For
RemoteIPInternalProxy 192.168.5.150

```

### 403/404/Not allowed/etc

[](#403404not-allowedetc)

Your username must match your API key (generated from User's Profile -&gt; Admin -&gt; Generate Key). It's likely not possible to generate a key for the `system` account; it just throws a CSRF token error.

You'll probably want to make another (possibly admin) user account and generate a key, or if you're just going to post threads or replies, a normal account will do. The API is subject to the same rate limits as normal users, so you may want to manually set a trust level so they're allowed to post links or post more quickly if necessary.

### Guzzle is throwing HTTPS exceptions

[](#guzzle-is-throwing-https-exceptions)

You probably don't have a cert/CA/bundle for whatever certificate you are using.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

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

---

Top Contributors

[![ArkQa](https://avatars.githubusercontent.com/u/45480756?v=4)](https://github.com/ArkQa "ArkQa (3 commits)")

### Embed Badge

![Health badge](/badges/arkqa-discourse-apiphp/health.svg)

```
[![Health](https://phpackages.com/badges/arkqa-discourse-apiphp/health.svg)](https://phpackages.com/packages/arkqa-discourse-apiphp)
```

###  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)
