PHPackages                             lokalise/php-lokalise-api - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. lokalise/php-lokalise-api

ActiveLibrary[HTTP &amp; Networking](/categories/http)

lokalise/php-lokalise-api
=========================

Lokalise API client

v4.4.1(1y ago)182.2M↓11.3%12[4 issues](https://github.com/lokalise/php-lokalise-api/issues)[1 PRs](https://github.com/lokalise/php-lokalise-api/pulls)2MITPHPPHP &gt;=7.4CI failing

Since Oct 2Pushed 10mo ago12 watchersCompare

[ Source](https://github.com/lokalise/php-lokalise-api)[ Packagist](https://packagist.org/packages/lokalise/php-lokalise-api)[ Docs](https://app.lokalise.com/api2docs/curl/)[ RSS](/packages/lokalise-php-lokalise-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (31)Used By (2)

Lokalise API v2 official PHP library
====================================

[](#lokalise-api-v2-official-php-library)

Client library for [Lokalise](https://lokalise.com) API 2.0, written with PHP. [Full API reference](https://app.lokalise.com/api2docs/curl/).

Changelog is located [here](CHANGELOG.md).

Getting started
---------------

[](#getting-started)

1. PHP 7.4.x or greater is required
2. Install LokaliseApiClient using [Composer](#composer-installation) (recommended) or manually

Composer installation
---------------------

[](#composer-installation)

1. Get [Composer](http://getcomposer.org/)
2. Require LokaliseApiClient with `php composer.phar require lokalise/php-lokalise-api`
3. Add the following to your application's main PHP file: `require 'vendor/autoload.php';`

Construct LokaliseApiClient
---------------------------

[](#construct-lokaliseapiclient)

Create and grab your API token at [Lokalise profile](https://app.lokalise.com/profile)

```
$client = new \Lokalise\LokaliseApiClient($apiToken);
```

Request
-------

[](#request)

[Comments](Docs/comments.md)

[Contributors](Docs/contributors.md)

[Files](Docs/files.md)

[Keys](Docs/keys.md)

[Languages](Docs/languages.md)

[Payment Cards](Docs/paymentCards.md)

[Projects](Docs/projects.md)

[Queued Processes](Docs/queuedProcesses.md)

[Screenshots](Docs/screenshots.md)

[Snapshots](Docs/snapshots.md)

[Tasks](Docs/tasks.md)

[Teams](Docs/teams.md)

[Team Users](Docs/teamUsers.md)

[Team User Groups](Docs/teamUserGroups.md)

[Translations](Docs/translations.md)

[Translation Providers](Docs/translationProviders.md)

[Orders](Docs/orders.md)

[Webhooks](Docs/webhooks.md)

[Branches](Docs/branches.md)

Response
--------

[](#response)

```
/** @var \Lokalise\LokaliseApiResponse $response */
$response = $client->languages->listSystem();

$response->
    headers                // Associative array of Lokalise headers received
    getContent()           // Return response data as associative array
    __toArray()            // getContent() alias. Return response data as associative array
    __toString()           // Return JSON encoded response data
    getTotalCount()        // Return total count of filtered items in List methods
    getPageCount()         // Return count of pages in List methods (based on limit parameter)
    getPaginationLimit()   // Return pagination limit used in the request
    getPaginationPage()    // Return current page of the request
    getNextCursor()        // Return next cursor for cursor based pagination
    hasNextCursor()        // Return true if next cursor is present for cursor based pagination
```

Utils
-----

[](#utils)

```
\Lokalise\Utils::
    base64FileEncode($filePath)    // Get base64 encoded contents with leading mime type
```

Exceptions and errors
---------------------

[](#exceptions-and-errors)

```
\Lokalise\Exceptions\LokaliseApiException       // Exception throws when Lokalise API can't be reached using Guzzle
\Lokalise\Exceptions\LokaliseResponseException  // Exception throws when Lokalise API responded with a single error
```

Best practice

```
$client = new \Lokalise\LokaliseApiClient($apiToken);

try {
    $language = $client->languages->retrieve($projectId, $languageId)->getContent();
} catch (\Lokalise\Exceptions\LokaliseApiException $e) {
    // try again later or break
} catch (\Lokalise\Exceptions\LokaliseResponseException $e) {
    // Request cannot be completed. More details in {$e->getCode()} and {$e->getMessage()}
    // break
}
```

Rate limits
-----------

[](#rate-limits)

[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.

Only one concurrent request per token is allowed.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance47

Moderate activity, may be stable

Popularity51

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Every ~121 days

Recently: every ~23 days

Total

21

Last Release

369d ago

Major Versions

2.2.0 → 3.0.02020-05-25

3.1.0 → 4.0.02021-01-26

PHP version history (4 changes)2.0.0PHP ^5.3 || ^7.0

2.0.2PHP ^5.6 || ^7.0

2.0.5PHP ^5.6 || ~7.0

4.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/480b629738012c7d1b9eaba786554e087c6c6ef4afd70b55c454469795eb5348?d=identicon)[andrewi-wd](/maintainers/andrewi-wd)

![](https://www.gravatar.com/avatar/6b4a2f9696bece1dc9a18db1d84472b39ad981bd3241af776279cb328efd738f?d=identicon)[lokalise](/maintainers/lokalise)

---

Top Contributors

[![andrewi-wd](https://avatars.githubusercontent.com/u/2337032?v=4)](https://github.com/andrewi-wd "andrewi-wd (41 commits)")[![beinarovic](https://avatars.githubusercontent.com/u/1528278?v=4)](https://github.com/beinarovic "beinarovic (34 commits)")[![nickustinov](https://avatars.githubusercontent.com/u/823000?v=4)](https://github.com/nickustinov "nickustinov (25 commits)")[![akankov](https://avatars.githubusercontent.com/u/1974569?v=4)](https://github.com/akankov "akankov (6 commits)")[![kkarauda](https://avatars.githubusercontent.com/u/177550809?v=4)](https://github.com/kkarauda "kkarauda (6 commits)")[![RonnyLV](https://avatars.githubusercontent.com/u/3844817?v=4)](https://github.com/RonnyLV "RonnyLV (6 commits)")[![yarlson](https://avatars.githubusercontent.com/u/751584?v=4)](https://github.com/yarlson "yarlson (4 commits)")[![TheLevti](https://avatars.githubusercontent.com/u/7612582?v=4)](https://github.com/TheLevti "TheLevti (3 commits)")[![VSevostianov](https://avatars.githubusercontent.com/u/167165727?v=4)](https://github.com/VSevostianov "VSevostianov (3 commits)")[![kosmos2uh](https://avatars.githubusercontent.com/u/13737181?v=4)](https://github.com/kosmos2uh "kosmos2uh (2 commits)")[![ansisblodnieks](https://avatars.githubusercontent.com/u/12951277?v=4)](https://github.com/ansisblodnieks "ansisblodnieks (1 commits)")[![Soean](https://avatars.githubusercontent.com/u/695201?v=4)](https://github.com/Soean "Soean (1 commits)")[![masuichig](https://avatars.githubusercontent.com/u/24214655?v=4)](https://github.com/masuichig "masuichig (1 commits)")[![Motassem-MK](https://avatars.githubusercontent.com/u/13342609?v=4)](https://github.com/Motassem-MK "Motassem-MK (1 commits)")

---

Tags

composerlokalise-apiofficialphpapirestlokalise

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lokalise-php-lokalise-api/health.svg)

```
[![Health](https://phpackages.com/badges/lokalise-php-lokalise-api/health.svg)](https://phpackages.com/packages/lokalise-php-lokalise-api)
```

###  Alternatives

[xendit/xendit-php

Xendit PHP SDK

189730.6k6](/packages/xendit-xendit-php)[angelleye/paypal-php-library

PHP wrapper for PayPal APIs

243440.9k](/packages/angelleye-paypal-php-library)[infobip/infobip-api-php-client

PHP library for consuming Infobip's API

921.8M10](/packages/infobip-infobip-api-php-client)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[mediamonks/rest-api-bundle

MediaMonks Rest API Symfony Bundle

1656.2k1](/packages/mediamonks-rest-api-bundle)[phrest/api

REST API Package for Phalcon PHP

304.2k](/packages/phrest-api)

PHPackages © 2026

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