{"id":41190366,"url":"https://github.com/rishimohan/orshot-php-sdk","last_synced_at":"2026-01-22T20:22:49.713Z","repository":{"id":286272227,"uuid":"957436163","full_name":"rishimohan/orshot-php-sdk","owner":"rishimohan","description":"PHP SDK for Orshot","archived":false,"fork":false,"pushed_at":"2025-07-30T10:50:18.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T01:41:26.814Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rishimohan.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-03-30T11:21:59.000Z","updated_at":"2025-04-08T08:48:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"09d8bd3b-d642-4410-afd9-a22cd7231fe9","html_url":"https://github.com/rishimohan/orshot-php-sdk","commit_stats":null,"previous_names":["rishimohan/orshot-php-sdk"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rishimohan/orshot-php-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishimohan%2Forshot-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishimohan%2Forshot-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishimohan%2Forshot-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishimohan%2Forshot-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rishimohan","download_url":"https://codeload.github.com/rishimohan/orshot-php-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishimohan%2Forshot-php-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28670371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T19:36:09.361Z","status":"ssl_error","status_checked_at":"2026-01-22T19:36:05.567Z","response_time":144,"last_error":"SSL_read: 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":[],"created_at":"2026-01-22T20:22:49.576Z","updated_at":"2026-01-22T20:22:49.689Z","avatar_url":"https://github.com/rishimohan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Orshot API PHP SDK\n\nView on Packagist: [https://packagist.org/packages/rishimohan/orshot](https://packagist.org/packages/rishimohan/orshot)\n\n## Installation\n\n```\ncomposer require rishimohan/orshot\n```\n\n## Usage\n\nIf you don't have your API key, get one from [orshot.com](https://orshot.com)\n\n### Render from template\n\n```php\n$response = $client-\u003erenderFromTemplate(['templateId'=\u003e 'open-graph-image-1', 'modifications' =\u003e $modifications, 'responseType'=\u003e 'url', 'responseFormat' =\u003e 'png']);\n```\n\n### Generate signed URL\n\n```php\n$signed_response = $client-\u003egenerateSignedUrl(['templateId'=\u003e 'open-graph-image-1', 'expiresAt' =\u003e 1744276943, 'modifications' =\u003e $modifications, 'renderType'=\u003e 'images', 'responseFormat' =\u003e 'png']);\n```\n\n## Example\n\n### `Base64` response format\n\n```php\n\u003c?php \n\nrequire 'vendor/autoload.php';\n\nuse Orshot\\Client;\n\n$client = new Client(\"os-ha2jdus1cbz1dpt4mktgjyvx\");\n\n$modifications = [\n    'title' =\u003e 'Title from PHP SDK.',\n    'description' =\u003e 'Description from PHP SDK.'\n];\n\n$response = $client-\u003erenderFromTemplate(['templateId'=\u003e 'open-graph-image-1', 'modifications' =\u003e $modifications, 'responseType'=\u003e 'base64', 'responseFormat' =\u003e 'png']);\nprint_r($response['data']);\n```\n\nOutput\n\n```\nArray\n(\n    [content] =\u003e data:image/png;base64,iVBORw0K...\n    [format] =\u003e png\n    [type] =\u003e base64\n    [responseTime] =\u003e 2787.17\n)\n```\n\n### `URL` response format\n\n```php\n\u003c?php \n\nrequire 'vendor/autoload.php';\n\nuse Orshot\\Client;\n\n$client = new Client(\"os-ha2jdus1cbz1dpt4mktgjyvx\");\n\n$modifications = [\n    'title' =\u003e 'Title from PHP SDK.',\n    'description' =\u003e 'Description from PHP SDK.'\n];\n\n$response = $client-\u003erenderFromTemplate(['templateId'=\u003e 'open-graph-image-1', 'modifications' =\u003e $modifications, 'responseType'=\u003e 'url', 'responseFormat' =\u003e 'png']);\nprint_r($response['data']);\n```\n\nOutput\n\n```\nArray\n(\n    [content] =\u003e https://storage.orshot.com/00632982-fd46-44ff-9a61-f41edf1b8e62/images/KwSv2IS4jwH.png\n    [type] =\u003e url\n    [format] =\u003e png\n    [responseTime] =\u003e 3775.54\n)\n```\n\n### `Binary` response format\n\n```php\n\u003c?php \n\nrequire 'vendor/autoload.php';\n\nuse Orshot\\Client;\n\n$client = new Client(\"os-ha2jdus1cbz1dpt4mktgjyvx\");\n\n$modifications = [\n    'title' =\u003e 'Title from PHP SDK.',\n    'description' =\u003e 'Description from PHP SDK.'\n];\n\n$response = $client-\u003erenderFromTemplate(['templateId'=\u003e 'open-graph-image-1', 'modifications' =\u003e $modifications, 'responseType'=\u003e 'binary', 'responseFormat' =\u003e 'png']);\nfile_put_contents('og.png', $response);\n```\n\nThis example writes the binary image to the file `og.png`\n\n### Signed URL\n\n```php\n\u003c?php \n\nrequire 'vendor/autoload.php';\n\nuse Orshot\\Client;\n\n$client = new Client(\"os-ha2jdus1cbz1dpt4mktgjyvx\");\n\n$modifications = [\n    'title' =\u003e 'Title from PHP SDK.',\n    'description' =\u003e 'Description from PHP SDK.'\n];\n\n$signed_response = $client-\u003egenerateSignedUrl(['templateId'=\u003e 'open-graph-image-1', 'expiresAt' =\u003e 1744276943, 'modifications' =\u003e $modifications, 'renderType'=\u003e 'images', 'responseFormat' =\u003e 'png']);\nprint_r($signed_response['data']);\n```\n\nOutput\n\n```\nArray\n(\n    [url] =\u003e https://api.orshot.com/v1/generate/images?description=Description%20from%20PHP%20SDK.\u0026expiresAt=1744276943\u0026id=36\u0026templateId=open-graph-image-1\u0026title=Title%20from%20PHP%20SDK.\u0026signature=7ede3e531de82cbage6174f8f684840b6f8ed0281d5115a748dce924c014daa7\n)\n```\n\n## renderFromTemplate\n\nUse this function to render an image/pdf.\n\n| argument | required | description |\n|----------|----------|-------------|\n| `templateId` | Yes | ID of the template (`open-graph-image-1`, `tweet-image-1`, `beautify-screenshot-1`, ...) |\n| `modifications` | Yes | Modifications for the selected template. |\n| `responseType` | No | `base64`, `binary`, `url` (Defaults to `base64`). |\n| `responseFormat` | No | `png`, `webp`, `pdf`, `jpg`, `jpeg` (Defaults to `png`). |\n\nFor available templates and their modifications refer [Orshot Templates Page](https://orshot.com/templates)\n\n## generateSignedUrl\n\nUse this function to generate signed URL.\n\n| key | required | description |\n|----------|----------|-------------|\n| `templateId` | Yes | ID of the template (`open-graph-image-1`, `tweet-image-1`, `beautify-screenshot-1`, ...) |\n| `modifications` | Yes | Modifications for the selected template. |\n| `expiresAt` | Yes | Expires at in unix timestamp (Number). |\n| `renderType` | No | `images`, `pdfs` (Defaults to `images`). |\n| `responseFormat` | No | `png`, `webp`, `pdf`, `jpg`, `jpeg` (Defaults to `png`). |\n\n## Local development and testing\n\nRun these from the project root\n\n`composer config repositories.local '{\"type\": \"path\", \"url\": \"/path/to/your/library\"}' --global`\n\nUpdate the url to the path of the library in your computer.\n\nIn a separate test directory, run this\n\n`composer require rishimohan/orshot:@dev`\n\nWrite a small PHP script `test.php` in the test directory using the above exposed functions and run `php test.php`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishimohan%2Forshot-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frishimohan%2Forshot-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishimohan%2Forshot-php-sdk/lists"}