{"id":31767939,"url":"https://github.com/mathsgod/pcloud-sdk-php","last_synced_at":"2026-01-20T16:36:14.996Z","repository":{"id":302031439,"uuid":"1009557174","full_name":"mathsgod/pcloud-sdk-php","owner":"mathsgod","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-30T09:36:12.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-02T08:06:09.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathsgod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-27T10:22:22.000Z","updated_at":"2025-06-30T09:36:15.000Z","dependencies_parsed_at":"2025-06-30T07:51:28.858Z","dependency_job_id":"353c902e-19a4-4c59-8fdf-b1f3cd83e614","html_url":"https://github.com/mathsgod/pcloud-sdk-php","commit_stats":null,"previous_names":["mathsgod/pcloud-sdk-php"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mathsgod/pcloud-sdk-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fpcloud-sdk-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fpcloud-sdk-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fpcloud-sdk-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fpcloud-sdk-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathsgod","download_url":"https://codeload.github.com/mathsgod/pcloud-sdk-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fpcloud-sdk-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002400,"owners_count":26083375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-10T01:49:07.872Z","updated_at":"2025-10-10T01:49:15.137Z","avatar_url":"https://github.com/mathsgod.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pcloud-sdk-php\n\n\u003e **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.\n\npcloud-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.\n\n## EU or US API Endpoint\n\npCloud provides both EU and US API endpoints.  \n- **EU:** `https://eapi.pcloud.com/`\n- **US:** `https://api.pcloud.com/`\n\n## Installation\n\nRecommended via Composer:\n\n```bash\ncomposer require mathsgod/pcloud-sdk-php\n```\n\nOr simply include the `src/` directory in your project.\n\n## Quick Start\n\n```php\n$access_token = 'YOUR_TOKEN';\n$client = new \\GuzzleHttp\\Client([\n    'base_uri' =\u003e \"https://eapi.pcloud.com/\", \n    'headers' =\u003e [\n        'Authorization' =\u003e 'Bearer ' . $access_token,\n    ],\n]);\n\n$api = new \\pCloud\\Sdk\\Api($client);\n```\n\n---\n\n## Function List\n\n\u003e For detailed parameters and return values, please refer to the source code comments.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eGeneral\u003c/strong\u003e\u003c/summary\u003e\n\n- userinfo()\n- supportedlanguages()\n- setlanguage(string $language)\n- currentserver()\n- diff(array $params = [])\n- getfilehistory(int $fileid)\n- getip()\n- getapiserver()\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eAuth\u003c/strong\u003e\u003c/summary\u003e\n\n- sendverificationemail()\n- verifyemail(string $code)\n- changepassword(string $oldpassword, string $newpassword)\n- lostpassword(string $mail)\n- resetpassword(string $code, string $newpassword)\n- register(string $mail, string $password, string $termsaccepted, ?string $language = null, ?string $referer = null)\n- invite()\n- userinvites()\n- logout()\n- listtokens()\n- deletetoken(int $tokenid)\n- sendchangemail(?string $newmail = null, ?string $code = null)\n- changemail(string $password, string $code)\n- senddeactivatemail()\n- deactivateuser(string $password, string $code)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCollection\u003c/strong\u003e\u003c/summary\u003e\n\n- collection_list(?int $type = null, bool $showfiles = false, ?int $pagesize = null)\n- collection_details(int $collectionid, ?int $page = null, ?int $pagesize = null)\n- collection_create(string $name, ?int $type = null, ?string $fileids = null)\n- collection_rename(int $collectionid, string $name)\n- collection_delete(int $collectionid)\n- collection_linkfiles(int $collectionid, string $fileids, bool $noitems = false)\n- collection_unlinkfiles(int $collectionid, ?string $positions = null, bool $all = false, ?string $fileids = null)\n- collection_move(int $collectionid, int $item, int $fileid, int $position)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003ePublicLinks\u003c/strong\u003e\u003c/summary\u003e\n\n- getfilepublink(?int $fileid = null, ?string $path = null, ?string $expire = null, ?int $maxdownloads = null, ?int $maxtraffic = null, bool $shortlink = false, ?string $linkpassword = null)\n- getfolderpublink(?int $folderid = null, ?string $path = null, ?string $expire = null, ?int $maxdownloads = null, ?int $maxtraffic = null, bool $shortlink = false, ?string $linkpassword = null)\n- 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)\n- showpublink(string $code)\n- getpublinkdownload(string $code, ?int $fileid = null, bool $forcedownload = false, ?string $contenttype = null, ?int $maxspeed = null, bool $skipfilename = false)\n- copypubfile(string $code, ?int $fileid = null, ?string $topath = null, ?int $tofolderid = null, ?string $toname = null, bool $noover = false)\n- listpublinks()\n- listplshort()\n- deletepublink(int $linkid)\n- changepublink(int $linkid, array $options)\n- getpubthumb(string $code, int $fileid, string $size, bool $crop = false, ?string $type = null)\n- getpubthumblink(string $code, int $fileid, string $size, bool $crop = false, ?string $type = null)\n- getpubthumbslinks(string $code, int $fileid, string $size, bool $crop = false, ?string $type = null)\n- 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)\n- getpubzip(string $code, bool $forcedownload = false, ?string $filename = null, ?string $timeoffset = null)\n- getpubziplink(string $code, bool $forcedownload = false, ?string $filename = null, ?string $timeoffset = null)\n- savepubzip(string $code, ?string $timeoffset = null, ?string $topath = null, ?int $tofolderid = null, ?string $toname = null)\n- getpubvideolinks(string $code, ?int $fileid = null, bool $forcedownload = false, ?string $contenttype = null, ?int $maxspeed = null, bool $skipfilename = false)\n- getpubaudiolink(string $code, ?int $fileid = null, bool $forcedownload = false, ?string $contenttype = null, ?int $abitrate = null)\n- getpubtextfile(string $code, ?int $fileid = null, ?string $fromencoding = null, ?string $toencoding = null, bool $forcedownload = false, ?string $contenttype = null)\n- getcollectionpublink(int $collectionid, ?string $expire = null, ?int $maxdownloads = null, ?int $maxtraffic = null, bool $shortlink = false)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eRevisions\u003c/strong\u003e\u003c/summary\u003e\n\n- listrevisions(?int $fileid = null, ?string $path = null)\n- revertrevision(?int $fileid = null, ?string $path = null, ?int $revisionid = null)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eThumbnails\u003c/strong\u003e\u003c/summary\u003e\n\n- getthumblink(?int $fileid = null, ?string $path = null, ?string $size = null, bool $crop = false, ?string $type = null)\n- getthumbslinks(string $fileids, string $size, bool $crop = false, ?string $type = null)\n- getthumb(?int $fileid = null, ?string $path = null, ?string $size = null, bool $crop = false, ?string $type = null)\n- 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)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eTrash\u003c/strong\u003e\u003c/summary\u003e\n\n- trash_list(int $folderid = 0, bool $nofiles = false, bool $recursive = false)\n- trash_restorepath(?int $fileid = null, ?int $folderid = null)\n- trash_restore(?int $fileid = null, ?int $folderid = null, ?int $restoreto = null, bool $metadata = false)\n- trash_clear(?int $fileid = null, ?int $folderid = null)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eUploadLinks\u003c/strong\u003e\u003c/summary\u003e\n\n- createuploadlink(?int $folderid = null, ?string $path = null, string $comment = '', ?string $expire = null, ?int $maxspace = null, ?int $maxfiles = null)\n- listuploadlinks()\n- deleteuploadlink(int $uploadlinkid)\n- changeuploadlink(int $uploadlinkid, array $options)\n- showuploadlink(int $uploadlinkid)\n- uploadtolink(string $code, array $files, bool $nopartial = false, ?string $progresshash = null)\n- uploadlinkprogress(string $code, string $progresshash)\n- copytolink(string $code, ?int $fileid = null, ?string $path = null, ?string $toname = null)\n\u003c/details\u003e\n\n---\n\n## Common Examples\n\n### Upload a file\n\n```php\n// Single file\n$result = $api-\u003euploadfile([\n    '/path/to/local/file.jpg'\n], null, 0); // Upload to root folder\n\n// Multiple files (custom filenames)\n$result = $api-\u003euploadfile([\n    ['path' =\u003e '/tmp/a.jpg', 'filename' =\u003e 'photo1.jpg'],\n    ['path' =\u003e '/tmp/b.png', 'filename' =\u003e 'photo2.png'],\n], null, 123456); // Upload to folderid=123456\n```\n\n### Get file info\n\n```php\n// By fileid\n$meta = $api-\u003estat(123456789);\n// By path\n$meta = $api-\u003estat(null, '/Documents/test.pdf');\n```\n\n### Download file (get download link)\n\n```php\n$link = $api-\u003egetfilelink(123456789);\necho $link['hosts'][0] . $link['path'];\n```\n\n### Delete file\n\n```php\n$api-\u003edeletefile(123456789);\n// or\n$api-\u003edeletefile(null, '/Documents/test.pdf');\n```\n\n### Create folder\n\n```php\n// By folderid+name\n$meta = $api-\u003ecreatefolder(null, 123456, 'New Folder');\n// By full path\n$meta = $api-\u003ecreatefolder('/Documents/New Folder');\n```\n\n### List folder contents\n\n```php\n$list = $api-\u003elistfolder(null, 123456); // By folderid\n$list = $api-\u003elistfolder('/Documents'); // By path\n```\n\n### Recursively delete folder\n\n```php\n$api-\u003edeletefolderrecursive(123456); // Deletes all contents, use with caution\n```\n\n### Copy folder\n\n```php\n// Copy to another folder\n$api-\u003ecopyfolder(123456, null, 654321);\n// Copy to a specific path\n$api-\u003ecopyfolder(123456, null, null, '/Documents/Backup/');\n```\n\n### Copy, move, or rename file\n\n```php\n// Copy file to new folder\n$api-\u003ecopyfile(123, null, 456, null, 'newname.jpg');\n// Move and rename\n$api-\u003erenamefile(123, null, null, 456, 'newname.jpg');\n```\n\n### Calculate file checksum\n\n```php\n$hash = $api-\u003echecksumfile(123456789);\necho $hash['sha1'];\n```\n\n### Get thumbnail link\n\n```php\n$thumb = $api-\u003egetthumblink(123456789, null, '200x200');\necho $thumb['hosts'][0] . $thumb['path'];\n```\n\n---\n\n## Supported API Features\n\n- File operations (upload, download, copy, delete, stat, checksum, revisions, thumbnails)\n- Folder operations (create, delete, recursive delete, copy, move, stat/list)\n- Sharing and public links\n- Trash (recycle bin)\n- Archiving (zip/unzip)\n- Transfer\n- Collection (playlist)\n- Authentication and account management\n- Server and language settings\n\n## Documentation\n\n- [pCloud API Official Docs](https://docs.pcloud.com/)\n- All SDK methods correspond to API endpoints. See source code comments for parameters and return values.\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Fpcloud-sdk-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathsgod%2Fpcloud-sdk-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Fpcloud-sdk-php/lists"}