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

ActiveLibrary[API Development](/categories/api)

rannmann/php-ipfs-api
=====================

A client library for the IPFS API

0.0.11(6y ago)83472MITPHPPHP &gt;=7.3CI failing

Since Aug 11Pushed 2mo ago2 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (13)Used By (0)

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

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

A client library for the IPFS API.

This is a complete from-the-ground-up rewrite of cloutier/php-ipfs-api.

---

[![Codacy Badge](https://camo.githubusercontent.com/9dd1178a7b2bd31a87e80841b02540732339c4274aa0c27fb1be28f957d02b5c/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6234303262643761376165343435326462353236323439333431336139333364)](https://www.codacy.com/manual/rannmann/php-ipfs-api?utm_source=github.com&utm_medium=referral&utm_content=rannmann/php-ipfs-api&utm_campaign=Badge_Grade)[![CodeFactor](https://camo.githubusercontent.com/1eb4a1645ac7a212e8c3283b14d1a087a9ac10041c52913aad5804d7b5f21a88/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f72616e6e6d616e6e2f7068702d697066732d6170692f62616467652f6d6173746572)](https://www.codefactor.io/repository/github/rannmann/php-ipfs-api/overview/master)

Usage
=====

[](#usage)

Installing
----------

[](#installing)

This library requires PHP 7.3 and the curl and json extensions.

```
$ composer require rannmann/php-ipfs-api
$ composer install
```

```
use rannmann\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");
```

#### addFromPath

[](#addfrompath)

Adds content to IPFS from a filename (helper method)

**Usage**

```
$hash = $ipfs->addFromPath("myFile.txt");
```

#### addFromUrl

[](#addfromurl)

Adds content ot IPFS from a web URL (helper method)

**Usage**

```
$hash = $ipfs->addFromUrl('https://mysite.com/img.png');
```

#### get

[](#get)

Retrieves the contents of a single hash.

**Usage**

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

#### ls

[](#ls)

Gets the node structure of a hash.

**Usage**

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

foreach ($nodes as $node) {
	echo $node['Hash'];
	echo $node['Size'];
	echo $node['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);
```

#### ID

[](#id)

Get information about your ipfs node.

**Usage**

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

License
=======

[](#license)

The MIT License (MIT)

Copyright (c) 2019 Jake Forrester Copyright (c) 2016 S3r3nity Technologies Copyright (c) 2015-2016 Vincent Cloutier

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

38

—

LowBetter than 85% of packages

Maintenance56

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~124 days

Recently: every ~12 days

Total

11

Last Release

2313d ago

PHP version history (3 changes)0.0.1PHP &gt;=5.3.0

0.0.8PHP &gt;=7.2

0.0.9PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0964c51c040fe1bef3933b6c4c526dceeea698b403ab07c66d145db781486a8?d=identicon)[rannmann](/maintainers/rannmann)

---

Top Contributors

[![cloutier](https://avatars.githubusercontent.com/u/1014864?v=4)](https://github.com/cloutier "cloutier (9 commits)")[![rannmann](https://avatars.githubusercontent.com/u/1002752?v=4)](https://github.com/rannmann "rannmann (8 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)")[![Vytek](https://avatars.githubusercontent.com/u/2614303?v=4)](https://github.com/Vytek "Vytek (1 commits)")

---

Tags

ipfs

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)

PHPackages © 2026

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