{"id":36988537,"url":"https://github.com/hetzner-cloud-php/client","last_synced_at":"2026-01-13T23:26:18.597Z","repository":{"id":271835193,"uuid":"914712237","full_name":"hetzner-cloud-php/client","owner":"hetzner-cloud-php","description":"☁️ Plug 'n play PHP client for Hetzner's Cloud API.","archived":false,"fork":false,"pushed_at":"2025-05-12T22:03:18.000Z","size":2815,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T05:16:58.811Z","etag":null,"topics":["api","client","hetzner-cloud","php","sdk"],"latest_commit_sha":null,"homepage":"https://hetznercloudphp.netlify.app/","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/hetzner-cloud-php.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2025-01-10T06:39:31.000Z","updated_at":"2025-05-12T22:03:15.000Z","dependencies_parsed_at":"2025-01-24T22:22:50.154Z","dependency_job_id":"cb3ca314-8963-430a-aae9-f7fcea5822c0","html_url":"https://github.com/hetzner-cloud-php/client","commit_stats":null,"previous_names":["hetzner-cloud-php/client"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/hetzner-cloud-php/client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetzner-cloud-php%2Fclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetzner-cloud-php%2Fclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetzner-cloud-php%2Fclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetzner-cloud-php%2Fclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hetzner-cloud-php","download_url":"https://codeload.github.com/hetzner-cloud-php/client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetzner-cloud-php%2Fclient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","client","hetzner-cloud","php","sdk"],"created_at":"2026-01-13T23:26:18.010Z","updated_at":"2026-01-13T23:26:18.561Z","avatar_url":"https://github.com/hetzner-cloud-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\" style=\"padding-top: 2rem;\"\u003e\n    \u003cimg src=\"docs/public/hetzner_cloud_php_logo.png\" height=\"512\" width=\"512\" alt=\"logo\"/\u003e\n    \u003cdiv style=\"display: inline-block; padding-top: 2rem\"\u003e\n        \u003cimg src=\"https://img.shields.io/packagist/v/hetzner-cloud-php/client.svg?style=flat-square\" alt=\"packgist downloads\" /\u003e\n        \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/hetzner-cloud-php/client/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square\" alt=\"tests ci\" /\u003e\n        \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/hetzner-cloud-php/client/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square\" alt=\"packgist downloads\" /\u003e\n        \u003cimg src=\"https://img.shields.io/packagist/dt/hetzner-cloud-php/client.svg?style=flat-square\" alt=\"packgist downloads\" /\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n\n## Hetzner Cloud PHP\n\nA PHP client for the Hetzner Cloud API. The goal of this project is to provide an easy-to-use and framework agnostic PHP\nPHP client for projects and applications interacting with Hetzner Cloud. Some use cases might include:\n\n- Getting metrics for all servers within a project\n- Programmatically creating firewalls\n- Searching for available datacenters\n\n## Table of Contents\n\n- [Getting started](#getting-started)\n- [Usage](#usage)\n    - [Database](#database)\n    - [Firewalls](#firewalls)\n    - [Servers](#servers)\n\n## Getting started\n\nThe client is available as a composer packager that can be installed in any project using composer:\n\n```bash\ncomposer require hetzner-cloud-php/client\n```\n\nSince the client is compatible with any PSR-18 HTTP client, any commonly used HTTP client can be used thanks\nto our dependency on `php-http/discovery`. Once both dependencies have been installed, you may start interaction\nwith [Hetzner Cloud API](https://docs.hetzner.cloud/):\n\n```php\n/** @var string $apiKey */\n$apiKey = $_ENV['HETZNER_CLOUD_API_KEY'];\n$client = HetznerCloud::client($apiKey);\n\n// Create a server\n$response = $createdServer = $client-\u003eservers()-\u003ecreateServer([\n    'name' =\u003e 'test-server',\n    'server_type' =\u003e 'cpx11',\n    'image' =\u003e 'ubuntu-24.04',\n]);\n\necho $response-\u003eserver-\u003ename; // 'test-server'\n```\n\nFor a comprehensive set of examples, take a look at the [examples](/examples) directory.\n\n## Usage\n\n### Datacenters\n\n#### Get all datacenters\n\nGets a list of available datacenters.\n\n```php\n$response = $client-\u003edatacenters()-\u003egetDatacenters(sort: 'name:desc');\n\necho $response-\u003edatacenters // array\u003cint, Datacenter\u003e\necho $response-\u003emeta // Meta::class\necho $response-\u003etoArray() // ['datacenter' =\u003e ['id' =\u003e 42, ...], 'meta' =\u003e [...]]\n```\n\n#### Get a datacenter\n\nGets a single datacenter.\n\n```php\n$response = $client-\u003edatacenters()-\u003egetDatacenter(42);\n\necho $response-\u003edatacenter // Datacenter::class\necho $response-\u003etoArray() // ['datacenter' =\u003e ['id' =\u003e 42, ...], 'error' =\u003e null]\n```\n\n### `Firewalls`\n\n#### Get a firewall\n\nRetrieves a single firewall for a project.\n\n```php\n$response = $client-\u003efirewalls()-\u003egetFirewall(1337);\n$response-\u003efirewall; // Firewall::class\n$response-\u003etoArray(); // ['firewall' =\u003e ['id =\u003e 1337', ...]]\n```\n\n#### Get firewalls\n\nRetrieves all firewalls for a project, with a few optional query parameters.\n\n```php\n$response = $client-\u003efirewalls()-\u003egetFirewalls(name: 'coolify', labelSelector: 'foo');\n$response-\u003efirewalls; // array\u003cint, Firewall::class\u003e\n\nforeach ($response-\u003efirewalls as $firewall) {\n    $firewall-\u003eid;\n    $firewall-\u003ename;\n    // ...\n}\n\n$response-\u003etoArray(); // ['firewalls' =\u003e [...], 'meta' =\u003e [...]]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhetzner-cloud-php%2Fclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhetzner-cloud-php%2Fclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhetzner-cloud-php%2Fclient/lists"}