PHPackages                             pnut-api/phpnut - 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. pnut-api/phpnut

ActiveLibrary[API Development](/categories/api)

pnut-api/phpnut
===============

Pnut API library

1.0.1(5y ago)5492[1 issues](https://github.com/pnut-api/phpnut/issues)MITPHPPHP &gt;=8.0.0

Since Dec 21Pushed 5y ago3 watchersCompare

[ Source](https://github.com/pnut-api/phpnut)[ Packagist](https://packagist.org/packages/pnut-api/phpnut)[ Docs](https://github.com/pnut-api/phpnut)[ RSS](/packages/pnut-api-phpnut/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (15)Used By (0)

phpnut
======

[](#phpnut)

PHP library for the pnut.io API.

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

[](#installation)

You can install **phpnut** via composer or by downloading the source.

#### Via Composer:

[](#via-composer)

**phpnut** is available on Packagist as the [`pnut-api/phpnut`](http://packagist.org/packages/pnut-api/phpnut) package:

```
composer require pnut-api/phpnut

```

To include the library in your project, you may use normal autoloading similar to `require_once __DIR__.'/vendor/autoload.php';` if your project uses [Composer](https://getcomposer.org/). Otherwise, you can also `require_once 'phpnut.php';` or `require_once 'ezphpnut.php'`.

Usage
-----

[](#usage)

### Quick examples

[](#quick-examples)

#### Create a post

[](#create-a-post)

```
$app = new phpnut\phpnut($accessToken);

$app->createPost('Hello world', ['reply_to' => 123]);
```

#### Search for a tag

[](#search-for-a-tag)

```
$app = new phpnut\phpnut($clientId, $clientSecret);

$posts = $app->searchHashtags('mndp');

print_r($posts);
```

EZphpnut
--------

[](#ezphpnut)

If you are planning to design an app for viewing within a browser that requires a login screen etc, this is a great place to start. This aims to hide all the nasty authentication stuff from the average developer. It is also recommended that you start here if you have never worked with OAuth and/or APIs before.

```
