PHPackages                             mathsgod/pcloud-sdk-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. mathsgod/pcloud-sdk-php

ActiveLibrary[API Development](/categories/api)

mathsgod/pcloud-sdk-php
=======================

A PHP SDK for pCloud API

1.0.0(1y ago)061MITPHP

Since Jun 30Pushed 1y agoCompare

[ Source](https://github.com/mathsgod/pcloud-sdk-php)[ Packagist](https://packagist.org/packages/mathsgod/pcloud-sdk-php)[ RSS](/packages/mathsgod-pcloud-sdk-php/feed)WikiDiscussions main Synced today

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

pcloud-sdk-php
==============

[](#pcloud-sdk-php)

> **Note:** This library was developed because the official SDK ([pCloud/pcloud-sdk-php](https://github.com/pCloud/pcloud-sdk-php)) lacks many features. This project aims to provide a more complete and practical PHP SDK for pCloud.

pcloud-sdk-php is a PHP SDK for accessing the [pCloud API](https://docs.pcloud.com/). It supports file, folder, sharing, public links, thumbnails, trash, archiving, transfer, collection, and account management operations.

EU or US API Endpoint
---------------------

[](#eu-or-us-api-endpoint)

pCloud provides both EU and US API endpoints.

- **EU:** `https://eapi.pcloud.com/`
- **US:** `https://api.pcloud.com/`

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

[](#installation)

Recommended via Composer:

```
composer require mathsgod/pcloud-sdk-php
```

Or simply include the `src/` directory in your project.

Quick Start
-----------

[](#quick-start)

```
$access_token = 'YOUR_TOKEN';
$client = new \GuzzleHttp\Client([
    'base_uri' => "https://eapi.pcloud.com/",
    'headers' => [
        'Authorization' => 'Bearer ' . $access_token,
    ],
]);

$api = new \pCloud\Sdk\Api($client);
```

---

Function List
-------------

[](#function-list)

> For detailed parameters and return values, please refer to the source code comments.

**General**- userinfo()
- supportedlanguages()
- setlanguage(string $language)
- currentserver()
- diff(array $params = \[\])
- getfilehistory(int $fileid)
- getip()
- getapiserver()

**Auth**- sendverificationemail()
- verifyemail(string $code)
- changepassword(string $oldpassword, string $newpassword)
- lostpassword(string $mail)
- resetpassword(string $code, string $newpassword)
- register(string $mail, string $password, string $termsaccepted, ?string $language = null, ?string $referer = null)
- invite()
- userinvites()
- logout()
- listtokens()
- deletetoken(int $tokenid)
- sendchangemail(?string $newmail = null, ?string $code = null)
- changemail(string $password, string $code)
- senddeactivatemail()
- deactivateuser(string $password, string $code)

**Collection**- collection\_list(?int $type = null, bool $showfiles = false, ?int $pagesize = null)
- collection\_details(int $collectionid, ?int $page = null, ?int $pagesize = null)
- collection\_create(string $name, ?int $type = null, ?string $fileids = null)
- collection\_rename(int $collectionid, string $name)
- collection\_delete(int $collectionid)
- collection\_linkfiles(int $collectionid, string $fileids, bool $noitems = false)
- collection\_unlinkfiles(int $collectionid, ?string $positions = null, bool $all = false, ?string $fileids = null)
- collection\_move(int $collectionid, int $item, int $fileid, int $position)

**PublicLinks**- getfilepublink(?int $fileid = null, ?string $path = null, ?string $expire = null, ?int $maxdownloads = null, ?int $maxtraffic = null, bool $shortlink = false, ?string $linkpassword = null)
- getfolderpublink(?int $folderid = null, ?string $path = null, ?string $expire = null, ?int $maxdownloads = null, ?int $maxtraffic = null, bool $shortlink = false, ?string $linkpassword = null)
- gettreepublink(string $name, ?string $fileids = null, ?string $folderids = null, ?int $folderid = null, ?string $expire = null, ?int $maxdownloads = null, ?int $maxtraffic = null, bool $shortlink = false, ?string $linkpassword = null)
- showpublink(string $code)
- getpublinkdownload(string $code, ?int $fileid = null, bool $forcedownload = false, ?string $contenttype = null, ?int $maxspeed = null, bool $skipfilename = false)
- copypubfile(string $code, ?int $fileid = null, ?string $topath = null, ?int $tofolderid = null, ?string $toname = null, bool $noover = false)
- listpublinks()
- listplshort()
- deletepublink(int $linkid)
- changepublink(int $linkid, array $options)
- getpubthumb(string $code, int $fileid, string $size, bool $crop = false, ?string $type = null)
- getpubthumblink(string $code, int $fileid, string $size, bool $crop = false, ?string $type = null)
- getpubthumbslinks(string $code, int $fileid, string $size, bool $crop = false, ?string $type = null)
- savepubthumb(string $code, int $fileid, string $size, ?string $topath = null, ?int $tofolderid = null, ?string $toname = null, bool $crop = false, ?string $type = null, bool $noover = false)
- getpubzip(string $code, bool $forcedownload = false, ?string $filename = null, ?string $timeoffset = null)
- getpubziplink(string $code, bool $forcedownload = false, ?string $filename = null, ?string $timeoffset = null)
- savepubzip(string $code, ?string $timeoffset = null, ?string $topath = null, ?int $tofolderid = null, ?string $toname = null)
- getpubvideolinks(string $code, ?int $fileid = null, bool $forcedownload = false, ?string $contenttype = null, ?int $maxspeed = null, bool $skipfilename = false)
- getpubaudiolink(string $code, ?int $fileid = null, bool $forcedownload = false, ?string $contenttype = null, ?int $abitrate = null)
- getpubtextfile(string $code, ?int $fileid = null, ?string $fromencoding = null, ?string $toencoding = null, bool $forcedownload = false, ?string $contenttype = null)
- getcollectionpublink(int $collectionid, ?string $expire = null, ?int $maxdownloads = null, ?int $maxtraffic = null, bool $shortlink = false)

**Revisions**- listrevisions(?int $fileid = null, ?string $path = null)
- revertrevision(?int $fileid = null, ?string $path = null, ?int $revisionid = null)

**Thumbnails**- getthumblink(?int $fileid = null, ?string $path = null, ?string $size = null, bool $crop = false, ?string $type = null)
- getthumbslinks(string $fileids, string $size, bool $crop = false, ?string $type = null)
- getthumb(?int $fileid = null, ?string $path = null, ?string $size = null, bool $crop = false, ?string $type = null)
- savethumb(?int $fileid = null, ?string $path = null, ?string $size = null, ?string $topath = null, ?int $tofolderid = null, ?string $toname = null, bool $crop = false, ?string $type = null, bool $noover = false)

**Trash**- trash\_list(int $folderid = 0, bool $nofiles = false, bool $recursive = false)
- trash\_restorepath(?int $fileid = null, ?int $folderid = null)
- trash\_restore(?int $fileid = null, ?int $folderid = null, ?int $restoreto = null, bool $metadata = false)
- trash\_clear(?int $fileid = null, ?int $folderid = null)

**UploadLinks**- createuploadlink(?int $folderid = null, ?string $path = null, string $comment = '', ?string $expire = null, ?int $maxspace = null, ?int $maxfiles = null)
- listuploadlinks()
- deleteuploadlink(int $uploadlinkid)
- changeuploadlink(int $uploadlinkid, array $options)
- showuploadlink(int $uploadlinkid)
- uploadtolink(string $code, array $files, bool $nopartial = false, ?string $progresshash = null)
- uploadlinkprogress(string $code, string $progresshash)
- copytolink(string $code, ?int $fileid = null, ?string $path = null, ?string $toname = null)

---

Common Examples
---------------

[](#common-examples)

### Upload a file

[](#upload-a-file)

```
// Single file
$result = $api->uploadfile([
    '/path/to/local/file.jpg'
], null, 0); // Upload to root folder

// Multiple files (custom filenames)
$result = $api->uploadfile([
    ['path' => '/tmp/a.jpg', 'filename' => 'photo1.jpg'],
    ['path' => '/tmp/b.png', 'filename' => 'photo2.png'],
], null, 123456); // Upload to folderid=123456
```

### Get file info

[](#get-file-info)

```
// By fileid
$meta = $api->stat(123456789);
// By path
$meta = $api->stat(null, '/Documents/test.pdf');
```

### Download file (get download link)

[](#download-file-get-download-link)

```
$link = $api->getfilelink(123456789);
echo $link['hosts'][0] . $link['path'];
```

### Delete file

[](#delete-file)

```
$api->deletefile(123456789);
// or
$api->deletefile(null, '/Documents/test.pdf');
```

### Create folder

[](#create-folder)

```
// By folderid+name
$meta = $api->createfolder(null, 123456, 'New Folder');
// By full path
$meta = $api->createfolder('/Documents/New Folder');
```

### List folder contents

[](#list-folder-contents)

```
$list = $api->listfolder(null, 123456); // By folderid
$list = $api->listfolder('/Documents'); // By path
```

### Recursively delete folder

[](#recursively-delete-folder)

```
$api->deletefolderrecursive(123456); // Deletes all contents, use with caution
```

### Copy folder

[](#copy-folder)

```
// Copy to another folder
$api->copyfolder(123456, null, 654321);
// Copy to a specific path
$api->copyfolder(123456, null, null, '/Documents/Backup/');
```

### Copy, move, or rename file

[](#copy-move-or-rename-file)

```
// Copy file to new folder
$api->copyfile(123, null, 456, null, 'newname.jpg');
// Move and rename
$api->renamefile(123, null, null, 456, 'newname.jpg');
```

### Calculate file checksum

[](#calculate-file-checksum)

```
$hash = $api->checksumfile(123456789);
echo $hash['sha1'];
```

### Get thumbnail link

[](#get-thumbnail-link)

```
$thumb = $api->getthumblink(123456789, null, '200x200');
echo $thumb['hosts'][0] . $thumb['path'];
```

---

Supported API Features
----------------------

[](#supported-api-features)

- File operations (upload, download, copy, delete, stat, checksum, revisions, thumbnails)
- Folder operations (create, delete, recursive delete, copy, move, stat/list)
- Sharing and public links
- Trash (recycle bin)
- Archiving (zip/unzip)
- Transfer
- Collection (playlist)
- Authentication and account management
- Server and language settings

Documentation
-------------

[](#documentation)

- [pCloud API Official Docs](https://docs.pcloud.com/)
- All SDK methods correspond to API endpoints. See source code comments for parameters and return values.

License
-------

[](#license)

MIT License

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance50

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

368d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18732337?v=4)[Raymond](/maintainers/mathsgod)[@mathsgod](https://github.com/mathsgod)

---

Top Contributors

[![mathsgod](https://avatars.githubusercontent.com/u/18732337?v=4)](https://github.com/mathsgod "mathsgod (9 commits)")

### Embed Badge

![Health badge](/badges/mathsgod-pcloud-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/mathsgod-pcloud-sdk-php/health.svg)](https://phpackages.com/packages/mathsgod-pcloud-sdk-php)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M985](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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