{"id":23098902,"url":"https://github.com/lokalise/php-lokalise-api","last_synced_at":"2025-04-05T13:08:02.634Z","repository":{"id":33080838,"uuid":"130975744","full_name":"lokalise/php-lokalise-api","owner":"lokalise","description":"Lokalise API v2 PHP library.","archived":false,"fork":false,"pushed_at":"2025-03-12T15:18:56.000Z","size":221,"stargazers_count":17,"open_issues_count":7,"forks_count":11,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-28T12:11:30.794Z","etag":null,"topics":["composer","lokalise-api","official","php"],"latest_commit_sha":null,"homepage":"https://app.lokalise.com/api2docs/curl/","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/lokalise.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2018-04-25T08:34:56.000Z","updated_at":"2025-03-12T15:17:40.000Z","dependencies_parsed_at":"2025-02-19T11:10:41.466Z","dependency_job_id":"d08d3534-a56e-4430-9824-33053a98b29e","html_url":"https://github.com/lokalise/php-lokalise-api","commit_stats":{"total_commits":106,"total_committers":13,"mean_commits":8.153846153846153,"dds":0.6698113207547169,"last_synced_commit":"44dc8308a6fb98c68ea91b354781ec6fe120bab6"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lokalise%2Fphp-lokalise-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lokalise%2Fphp-lokalise-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lokalise%2Fphp-lokalise-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lokalise%2Fphp-lokalise-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lokalise","download_url":"https://codeload.github.com/lokalise/php-lokalise-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339158,"owners_count":20923014,"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","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":["composer","lokalise-api","official","php"],"created_at":"2024-12-16T23:14:14.121Z","updated_at":"2025-04-05T13:08:02.615Z","avatar_url":"https://github.com/lokalise.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lokalise API v2 official PHP library\n\nClient library for [Lokalise](https://lokalise.com) API 2.0, written with PHP.\n[Full API reference](https://app.lokalise.com/api2docs/curl/).\n\nChangelog is located [here](CHANGELOG.md).\n\n## Getting started\n\n1. PHP 7.4.x or greater is required\n2. Install LokaliseApiClient using [Composer](#composer-installation) (recommended) or manually\n\n## Composer installation\n\n1. Get [Composer](http://getcomposer.org/)\n2. Require LokaliseApiClient with `php composer.phar require lokalise/php-lokalise-api`\n3. Add the following to your application's main PHP file: `require 'vendor/autoload.php';`\n\n## Construct LokaliseApiClient\nCreate and grab your API token at [Lokalise profile](https://app.lokalise.com/profile)\n\n```php\n$client = new \\Lokalise\\LokaliseApiClient($apiToken);\n```\n\n## Request\n\n[Comments](Docs/comments.md)\n\n[Contributors](Docs/contributors.md)\n\n[Files](Docs/files.md)\n\n[Keys](Docs/keys.md)\n\n[Languages](Docs/languages.md)\n\n[Payment Cards](Docs/paymentCards.md)\n\n[Projects](Docs/projects.md)\n\n[Queued Processes](Docs/queuedProcesses.md)\n\n[Screenshots](Docs/screenshots.md)\n\n[Snapshots](Docs/snapshots.md)\n\n[Tasks](Docs/tasks.md)\n\n[Teams](Docs/teams.md)\n\n[Team Users](Docs/teamUsers.md)\n\n[Team User Groups](Docs/teamUserGroups.md)\n\n[Translations](Docs/translations.md)\n\n[Translation Providers](Docs/translationProviders.md)\n\n[Orders](Docs/orders.md)\n\n[Webhooks](Docs/webhooks.md)\n\n[Branches](Docs/branches.md)\n\n## Response\n\n```php\n/** @var \\Lokalise\\LokaliseApiResponse $response */\n$response = $client-\u003elanguages-\u003elistSystem();\n\n$response-\u003e\n    headers                // Associative array of Lokalise headers received\n    getContent()           // Return response data as associative array\n    __toArray()            // getContent() alias. Return response data as associative array\n    __toString()           // Return JSON encoded response data\n    getTotalCount()        // Return total count of filtered items in List methods\n    getPageCount()         // Return count of pages in List methods (based on limit parameter)\n    getPaginationLimit()   // Return pagination limit used in the request\n    getPaginationPage()    // Return current page of the request\n    getNextCursor()        // Return next cursor for cursor based pagination\n    hasNextCursor()        // Return true if next cursor is present for cursor based pagination\n```\n\n## Utils\n\n```php\n\\Lokalise\\Utils::\n    base64FileEncode($filePath)    // Get base64 encoded contents with leading mime type\n```\n\n## Exceptions and errors\n\n```php\n\\Lokalise\\Exceptions\\LokaliseApiException       // Exception throws when Lokalise API can't be reached using Guzzle\n\\Lokalise\\Exceptions\\LokaliseResponseException  // Exception throws when Lokalise API responded with a single error\n```\n\nBest practice\n\n```php\n$client = new \\Lokalise\\LokaliseApiClient($apiToken);\n\ntry {\n    $language = $client-\u003elanguages-\u003eretrieve($projectId, $languageId)-\u003egetContent();\n} catch (\\Lokalise\\Exceptions\\LokaliseApiException $e) {\n    // try again later or break\n} catch (\\Lokalise\\Exceptions\\LokaliseResponseException $e) {\n    // Request cannot be completed. More details in {$e-\u003egetCode()} and {$e-\u003egetMessage()}\n    // break\n}\n```\n\n## Rate limits\n[Access to all endpoints is limited](https://app.lokalise.com/api2docs/curl/#resource-rate-limits) to 6 requests per second from 14 September, 2021. This limit is applied per API token and per IP address. If you exceed the limit, a 429 HTTP status code will be returned and the corresponding exception will be raised that you should handle properly. To handle such errors, we recommend an exponential backoff mechanism with a limited number of retries.\n\nOnly one concurrent request per token is allowed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flokalise%2Fphp-lokalise-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flokalise%2Fphp-lokalise-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flokalise%2Fphp-lokalise-api/lists"}