PHPackages                             babymarkt/deepl-php-lib - 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. [API Development](/categories/api)
4. /
5. babymarkt/deepl-php-lib

Abandoned → [deeplcom/deepl-php](/?search=deeplcom%2Fdeepl-php)ArchivedLibrary[API Development](/categories/api)

babymarkt/deepl-php-lib
=======================

DeepL API Client Library supporting PHP &gt;= 7.3 &amp;&amp; PHP &lt;= 8.1

v4.0.0(3y ago)50284.8k↓36.7%28[1 issues](https://github.com/Baby-Markt/deepl-php-lib/issues)[1 PRs](https://github.com/Baby-Markt/deepl-php-lib/pulls)MITPHPPHP &gt;=7.3 &lt;8.2

Since Jun 12Pushed 3y ago8 watchersCompare

[ Source](https://github.com/Baby-Markt/deepl-php-lib)[ Packagist](https://packagist.org/packages/babymarkt/deepl-php-lib)[ Docs](https://github.com/Baby-Markt/deepl-php-lib)[ RSS](/packages/babymarkt-deepl-php-lib/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (26)Used By (0)

deepl-php-lib
=============

[](#deepl-php-lib)

---

Deprecated Library !
--------------------

[](#deprecated-library-)

Hello everyone,

in the last couple of months we didn't give much attention to this projekt. DeepL on the other hand has developed client libraries for Python, .NET and Node.js (see: [API-Doc](https://www.deepl.com/en/docs-api/accessing-the-api/client-libraries/)).

Since there is a PHP-Library in the works [Github](https://github.com/DeepLcom/deepl-php) and our track record with maintaining our library hasn't been as good as it should have been, we decided to abandon this library and switch internally to the official one.

To make clear that we won't continue to work on this repository, we will archive it. If anyone from the community wants to continue our work we can put a line in the README to point to the new maintained repository.

Otherwise, we recommend you to check out the new library coming from [DeepL](https://github.com/DeepLcom/deepl-php).

Thank you to everyone who contributed to this project over the years.

---

[![Latest Version on Packagist](https://camo.githubusercontent.com/4d65c843be680f216d33fa32d128774557d35539e41b7b88142276d38462da54/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626162796d61726b742f646565706c2d7068702d6c69622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/babymarkt/deepl-php-lib)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/e3ca6dcdc55ec9483396a8658e43eacdccc2558178eae491241276106ce54d5a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f426162792d4d61726b742f646565706c2d7068702d6c69622f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/Baby-Markt/deepl-php-lib)[![Coverage Status](https://camo.githubusercontent.com/da43ff56208977f77c186a7ccadf1c4d1179897b87734d45c31c688f64f7cd33/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f426162792d4d61726b742f646565706c2d7068702d6c69622e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Baby-Markt/deepl-php-lib/code-structure)[![Quality Score](https://camo.githubusercontent.com/907bf18a6c74151c475f3a8bd557e9951539152b32814e68bbfe6184b2f51578/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f426162792d4d61726b742f646565706c2d7068702d6c69622e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Baby-Markt/deepl-php-lib)[![Total Downloads](https://camo.githubusercontent.com/8d96fb9fe0ddbe16bff1c52af2312ef2264264200c308101f7f1bfd9be32b93f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626162796d61726b742f646565706c2d7068702d6c69622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/babymarkt/deepl-php-lib)

Simple PHP Library for DeepL API. You can translate one or multiple text strings (up to 50) per request.

🇩🇪🇦🇹🇨🇭🇬🇧🇺🇸🇪🇸🇲🇽🇫🇷🇮🇹🇯🇵🇳🇱🇵🇱🇵🇹🇧🇷🇷🇺🇨🇳🇬🇷🇩🇰🇨🇿🇪🇪🇫🇮🇭🇺🇱🇹🇱🇻🇷🇴🇷🇸🇸🇰🇸🇪

[Official DeepL API](https://www.deepl.com/docs-api/introduction/)

[CHANGELOG](CHANGELOG.md)

Install
-------

[](#install)

Use composer if you want to use this library in your project.

```
composer require babymarkt/deepl-php-lib
```

Usage
-----

[](#usage)

Create an instance with your auth key:

```
use \BabyMarkt\DeepL\DeepL;

$authKey = '';
$deepl   = new DeepL($authKey);
```

Use the DeepL API Pro:

```
use \BabyMarkt\DeepL\DeepL;

$authKey = '';
$deepl   = new DeepL($authKey,2,'api-free.deepl.com');
```

### Translate

[](#translate)

Translate one Text:

```
$translatedText = $deepl->translate('Hallo Welt', 'de', 'en');
echo $translatedText[0]['text'].PHP_EOL;
```

Translate multiple Texts:

```
$text = array(
    'Hallo Welt',
    'Wie geht es dir',
    'Macht doch einfach mal'
);

$translations = $deepl->translate($text, 'de', 'en');

foreach ($translations as $translation) {
    echo $translation['text'].PHP_EOL;
}
```

paramDescription$textText to be translated. Only UTF8-encoded plain text is supported. The parameter may be specified as an Array and translations are returned in the same order as they are requested. Each of the array values may contain multiple sentences. Up to 50 texts can be sent for translation in one request.$sourceLangLanguage of the text to be translated.
default: "" (DeepL will auto-detect)$targetLangThe language into which the text should be translated.
 default: en$tagHandlingSets which kind of tags should be handled. Options currently available: "xml"$ignoreTagsArray of XML tags that indicate text not to be translated.
 default: null$formalitySets whether the translated text should lean towards formal or informal language. This feature currently works for all target languages except "EN" (English), "EN-GB" (British English), "EN-US" (American English), "ES" (Spanish), "JA" (Japanese) and "ZH" (Chinese).

Possible options are:
"default" (default)
"more" - for a more formal language
"less" - for a more informal language$splitSentencesArray of XML tags which always cause splits
 default: null$preserveFormattingSets whether the translation engine should respect the original formatting, even if it would usually correct some aspects. Possible values are:
"0" (default)
"1"
The formatting aspects affected by this setting include:
Punctuation at the beginning and end of the sentence
Upper/lower case at the beginning of the sentence$nonSplittingTagsComma-separated list of XML tags which never split sentences.
 default: null$outlineDetectionSee:
 default: 1$splittingTagsArray of XML tags which always cause splits.
 default: null### Supported languages

[](#supported-languages)

In Version 2 we removed the internal List of supported Languages. Instead, you can now get an array with the supported Languages directly form DeepL:

```
$languagesArray = $deepl->languages();

foreach ($languagesArray as $language) {
    echo 'Name: '.$language['name'].' Api-Shorthand: '.$language['language'].PHP_EOL;
}
```

You can check for the supported Source-Languages:

```
$sourceLanguagesArray = $deepl->languages('source');

foreach ($sourceLanguagesArray as $sourceLanguage) {
    echo 'Name: '.$sourceLanguage['name'].' Api-shorthand: '.$sourceLanguage['language'].PHP_EOL;
}
```

Check for the supported Target-Languages:

```
$targetLanguagesArray = $deepl->languages('target');

foreach ($targetLanguagesArray as $targetLanguage) {
    echo 'Name: '.$targetLanguage['name'].' Api-Shorthand: '.$targetLanguage['language'].PHP_EOL;
}
```

### Monitoring usage

[](#monitoring-usage)

You can now check how much you translate, as well as the limit:

```
$usageArray = $deepl->usage();

echo 'You have used '.$usageArray['character_count'].' of '.$usageArray['character_limit'].' in the current billing period.'.PHP_EOL;
```

### Glossary

[](#glossary)

Create a glossary

```
$glossary = $deepl->createGlossary('MyGlossary', ['Hallo' => 'Hello'], 'de', 'en');
```

paramDescription$nameGlossary name$entriesArray of entries$sourceLanguageThe source language into which the glossary rule apply$targetLanguageThe target language into which the glossary rule applyDelete a glossary

```
$glossary = $deepl->deleteGlossary($glossaryId);
```

paramDescription$glossaryIdGlossary uuid (set by DeepL when glossary is created)List glossaries

```
use \BabyMarkt\DeepL\Glossary;

$glossaries = $deepl->listGlossaries();
foreach ($glossaries as $glossary) {
    var_dump($glossary);
}
```

Get glossary meta information: creation date, is glossary ready to use ...

```
use \BabyMarkt\DeepL\Glossary;

$glossaryInformation = $deepl->glossaryInformation($glossaryId);
var_dump($glossaryInformation);
```

paramDescription$glossaryIdGlossary uuid (set by DeepL when glossary is created)Get glossary entries

```
$entries = $deepl->glossaryEntries($glossaryId);
foreach ($entries as $sourceLangText => $targetLangText) {
    echo $sourceLangText .' > '.$targetLangText;
}
```

paramDescription$glossaryIdGlossary uuid (set by DeepL when glossary is created)### Configuring cURL requests

[](#configuring-curl-requests)

If you need to use a proxy, you can configure the underlying curl client to use one. You can also specify a timeout to avoid waiting for several minutes if Deepl is unreachable

```
$deepl->setTimeout(10); //give up after 10 seconds
$deepl->setProxy('http://corporate-proxy.com:3128');
$deepl->setProxyCredentials('username:password');
```

Testing
-------

[](#testing)

Run PHP\_CodeSniffer Tests:

```
composer cs
```

Run PHPMD Tests:

```
composer md
```

Run PHPUnit Tests:

```
composer test
```

Run all tests:

```
composer test:all
```

Credits
-------

[](#credits)

- [babymarkt.de GmbH](https://github.com/Baby-Markt)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 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 ~62 days

Recently: every ~150 days

Total

24

Last Release

1456d ago

Major Versions

v1.1.0 → v2.0.0-alpha2020-08-12

v2.0.1 → v3.0.02021-07-07

v3.1.0 → v4.0.02022-05-24

PHP version history (4 changes)v1.0.0PHP &gt;=5.3

v1.0.8PHP &gt;=5.3 &lt;8.0

v3.0.0PHP &gt;=7.3 &lt;8.1

v4.0.0PHP &gt;=7.3 &lt;8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/446784?v=4)[Niklas](/maintainers/u-nik)[@u-nik](https://github.com/u-nik)

---

Top Contributors

[![arkadiusjonczek](https://avatars.githubusercontent.com/u/7071411?v=4)](https://github.com/arkadiusjonczek "arkadiusjonczek (79 commits)")[![VimS](https://avatars.githubusercontent.com/u/273156?v=4)](https://github.com/VimS "VimS (63 commits)")[![floranpagliai](https://avatars.githubusercontent.com/u/2648131?v=4)](https://github.com/floranpagliai "floranpagliai (9 commits)")[![tomschwiha](https://avatars.githubusercontent.com/u/8730812?v=4)](https://github.com/tomschwiha "tomschwiha (6 commits)")[![nicolus](https://avatars.githubusercontent.com/u/3315078?v=4)](https://github.com/nicolus "nicolus (5 commits)")[![ssumpfAtBabymarkt](https://avatars.githubusercontent.com/u/22655936?v=4)](https://github.com/ssumpfAtBabymarkt "ssumpfAtBabymarkt (3 commits)")[![denex23](https://avatars.githubusercontent.com/u/59438491?v=4)](https://github.com/denex23 "denex23 (2 commits)")[![bestog](https://avatars.githubusercontent.com/u/5852591?v=4)](https://github.com/bestog "bestog (2 commits)")[![mgoniwiecha](https://avatars.githubusercontent.com/u/13136344?v=4)](https://github.com/mgoniwiecha "mgoniwiecha (1 commits)")[![janbarasek](https://avatars.githubusercontent.com/u/4738758?v=4)](https://github.com/janbarasek "janbarasek (1 commits)")[![shamimmoeen](https://avatars.githubusercontent.com/u/7997852?v=4)](https://github.com/shamimmoeen "shamimmoeen (1 commits)")[![githubwnk](https://avatars.githubusercontent.com/u/24932835?v=4)](https://github.com/githubwnk "githubwnk (1 commits)")[![EtienneDh](https://avatars.githubusercontent.com/u/19950331?v=4)](https://github.com/EtienneDh "EtienneDh (1 commits)")[![martonfarago](https://avatars.githubusercontent.com/u/161203082?v=4)](https://github.com/martonfarago "martonfarago (1 commits)")

---

Tags

apideepldeepl-apideepl-clientdeeplyi18nlanguagephpphp-clientphp-librarytranslatetranslationtranslationstranslatori18ntranslationtranslatordeepldeeplybabymarkt

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/babymarkt-deepl-php-lib/health.svg)

```
[![Health](https://phpackages.com/badges/babymarkt-deepl-php-lib/health.svg)](https://phpackages.com/packages/babymarkt-deepl-php-lib)
```

###  Alternatives

[deeplcom/deepl-php

Official DeepL API Client Library

2616.2M66](/packages/deeplcom-deepl-php)[chriskonnertz/deeply

DeepLy is a PHP client for the DeepL.com translation API

230116.2k8](/packages/chriskonnertz-deeply)[om/potrans

Command line tool for translate Gettext with Google Translator API or DeepL API

10515.0k4](/packages/om-potrans)[scn/deepl-api-connector

Unofficial PHP Client for the API of deepl.com

16275.2k6](/packages/scn-deepl-api-connector)[johannschopplich/kirby-content-translator

DeepL &amp; AI-powered content translation for Kirby CMS

208.1k](/packages/johannschopplich-kirby-content-translator)[jrmajor/fluent

Fluent localization system for PHP

2716.9k5](/packages/jrmajor-fluent)

PHPackages © 2026

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