PHPackages                             cloutier/php-ipfs-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. cloutier/php-ipfs-api

ActiveLibrary[API Development](/categories/api)

cloutier/php-ipfs-api
=====================

A client library for the IPFS API

0.0.6(9y ago)1189.4k41[7 issues](https://github.com/cloutier/php-ipfs-api/issues)[2 PRs](https://github.com/cloutier/php-ipfs-api/pulls)2MITPHPPHP &gt;=5.3.0

Since Aug 11Pushed 4y ago14 watchersCompare

[ Source](https://github.com/cloutier/php-ipfs-api)[ Packagist](https://packagist.org/packages/cloutier/php-ipfs-api)[ Docs](https://github.com/cloutier/php-ipfs-api)[ RSS](/packages/cloutier-php-ipfs-api/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (7)Used By (2)

IPFS API wrapper library in PHP
===============================

[](#ipfs-api-wrapper-library-in-php)

[![](https://camo.githubusercontent.com/d24e7861d6a9cb0847b1a23b0b3267c5d94be53be8f34096bbdb88859ea2104c/68747470733a2f2f697066732e696f2f697066732f516d514a363850464d4464417367435a76413155567a7a6e3138617356636637485676434467706a695343417365)](https://camo.githubusercontent.com/d24e7861d6a9cb0847b1a23b0b3267c5d94be53be8f34096bbdb88859ea2104c/68747470733a2f2f697066732e696f2f697066732f516d514a363850464d4464417367435a76413155567a7a6e3138617356636637485676434467706a695343417365)

> A client library for the IPFS API.

Good news everyone! [S3r3nity](http://www.s3r3nity.com/) is sponsoring the development of this library. They will be using it inside one of their (unannounced) projects and its maintainer is hired to implement all the missing api calls (including the new file api) before the end of September 2016.

**Warning:** Changes will be made from user's suggestions and this warning will be removed when everything is stable. First stable release is scheduled for the end of September 2016.

Usage
=====

[](#usage)

Installing
----------

[](#installing)

This library requires the cURL module:

```
$ sudo apt-get install php5-curl
$ composer require cloutier/php-ipfs-api
$ composer install
```

```
use Cloutier\PhpIpfsApi\IPFS;

// connect to ipfs daemon API server
$ipfs = new IPFS("localhost", "8080", "5001"); // leaving out the arguments will default to these values
```

API
---

[](#api)

#### add

[](#add)

Adds content to IPFS.

**Usage**

```
$hash = $ipfs->add("Hello world");
```

#### cat

[](#cat)

Retrieves the contents of a single hash.

**Usage**

```
$ipfs->cat($hash);
```

#### ls

[](#ls)

Gets the node structure of a hash.

**Usage**

```
$obj = $ipfs->ls($hash);

foreach ($obj as $e) {
	echo $e['Hash'];
	echo $e['Size'];
	echo $e['Name'];
}
```

#### Object size

[](#object-size)

Returns object size.

**Usage**

```
$size = $ipfs->size($hash);
```

#### Pin

[](#pin)

Pin or unpin a hash.

**Usage**

```
$ipfs->pinAdd($hash);
$ipfs->pinRm($hash);
```

#### Pin

[](#pin-1)

Get information about your ipfs node.

**Usage**

```
print_r($ipfs->id());
```

License
=======

[](#license)

The MIT License (MIT)

Copyright (c) 2015-2016 Vincent Cloutier
Copyright (c) 2016 S3r3nity Technologies

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community26

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~6 days

Total

6

Last Release

3572d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/869e1aa25a14c5e17fada5360ef660b31c00153ab6e2ab88ed9383110020b25c?d=identicon)[cloutier](/maintainers/cloutier)

---

Top Contributors

[![cloutier](https://avatars.githubusercontent.com/u/1014864?v=4)](https://github.com/cloutier "cloutier (10 commits)")[![daviddias](https://avatars.githubusercontent.com/u/1211152?v=4)](https://github.com/daviddias "daviddias (1 commits)")[![dbosen](https://avatars.githubusercontent.com/u/6398151?v=4)](https://github.com/dbosen "dbosen (1 commits)")[![marsal](https://avatars.githubusercontent.com/u/2465274?v=4)](https://github.com/marsal "marsal (1 commits)")[![Vytek](https://avatars.githubusercontent.com/u/2614303?v=4)](https://github.com/Vytek "Vytek (1 commits)")

---

Tags

ipfs

### Embed Badge

![Health badge](/badges/cloutier-php-ipfs-api/health.svg)

```
[![Health](https://phpackages.com/badges/cloutier-php-ipfs-api/health.svg)](https://phpackages.com/packages/cloutier-php-ipfs-api)
```

###  Alternatives

[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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