PHPackages                             scn/deepl-api-connector - 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. scn/deepl-api-connector

ActiveLibrary[API Development](/categories/api)

scn/deepl-api-connector
=======================

Unofficial PHP Client for the API of deepl.com

v4.0.0(1y ago)16275.2k↓14.6%11[1 PRs](https://github.com/SC-Networks/deepl-api-connector/pulls)6MITPHPPHP ^8.2CI passing

Since Jun 4Pushed 3mo ago7 watchersCompare

[ Source](https://github.com/SC-Networks/deepl-api-connector)[ Packagist](https://packagist.org/packages/scn/deepl-api-connector)[ Docs](https://github.com/SC-Networks/deepl-api-connector)[ RSS](/packages/scn-deepl-api-connector/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (27)Used By (6)

deepl-api-connector - Unofficial PHP Client for the API of deepl.com.
=====================================================================

[](#deepl-api-connector---unofficial-php-client-for-the-api-of-deeplcom)

[![Monthly Downloads](https://camo.githubusercontent.com/b782888529d8e18a91558b76bc7a10f14d4d264344e06ca120d764b62608c434/68747470733a2f2f706f7365722e707567782e6f72672f73636e2f646565706c2d6170692d636f6e6e6563746f722f642f6d6f6e74686c79)](https://packagist.org/packages/scn/deepl-api-connector)[![License](https://camo.githubusercontent.com/b106349e9651c3f4866b99c180cf1bb1a6ed3f39f83ab0c6d7ab7ab8cc339be4/68747470733a2f2f706f7365722e707567782e6f72672f73636e2f646565706c2d6170692d636f6e6e6563746f722f6c6963656e7365)](LICENSE)[![Build status](https://github.com/SC-Networks/deepl-api-connector/actions/workflows/php.yml/badge.svg)](https://github.com/SC-Networks/deepl-api-connector/actions/workflows/php.yml)

- Information about Deepl:
- Deepl API Documentation:

Requirements
============

[](#requirements)

- php (See the compatibility table below for supported php versions)
- Implementations of [PSR17 (Http-Factories)](https://www.php-fig.org/psr/psr-17/) ([Available packages](https://packagist.org/providers/psr/http-factory-implementation)) and [PSR18 (Http-Client)](https://www.php-fig.org/psr/psr-18/) ([Available packages](https://packagist.org/providers/psr/http-client-implementation))
- A deepl free/pro api key

Compatibility
=============

[](#compatibility)

Connector-VersionPHP-Version(s)**master** (dev)8.2, 8.3**3.x** (features and bugfixes)7.4, 8.0, 8.1, 8.2, 8.3**2.x** (EOL)7.3, 7.4, 8.0, 8.1**1.x** (EOL)7.2, 7.3, 7.4Install
-------

[](#install)

Via Composer

```
$ composer require scn/deepl-api-connector
```

Usage
-----

[](#usage)

### Api client creation

[](#api-client-creation)

The `DeeplClientFactory` supports auto-detection of installed psr17/psr18 implementations. Just call the `create` method and you are ready to go

```
require_once __DIR__  . '/vendor/autoload.php';

use \Scn\DeeplApiConnector\DeeplClientFactory;

$deepl = DeeplClientFactory::create('your-api-key');
```

Optionally, you can provide already created instances of HttpClient, StreamFactory and RequestFactory as params to the create method.

```
require_once __DIR__  . '/vendor/autoload.php';

use \Scn\DeeplApiConnector\DeeplClientFactory;

$deepl = DeeplClientFactory::create(
    'your-api-key',
    $existingHttpClientInstance,
    $existingStreamFactoryInstance,
    $existingRequestFactoryInstance,
);
```

If a custom HTTP client implementation is to be used, this can also be done via the DeeplClientFactory::create method. The Client must support PSR18.

#### Get Usage of API Key

[](#get-usage-of-api-key)

```
require_once __DIR__  . '/vendor/autoload.php';

$deepl = \Scn\DeeplApiConnector\DeeplClientFactory::create('your-api-key');

try {
    $usageObject = $deepl->getUsage();
}
```

#### Get Translation

[](#get-translation)

```
require_once __DIR__  . '/vendor/autoload.php';

$deepl = \Scn\DeeplApiConnector\DeeplClientFactory::create('your-api-key');

try {
    $translation = new \Scn\DeeplApiConnector\Model\TranslationConfig(
        'My little Test',
        \Scn\DeeplApiConnector\Enum\LanguageEnum::LANGUAGE_DE
        ...,
        ...,
    );

    $translationObject = $deepl->getTranslation($translation);
}
```

```
require_once __DIR__  . '/vendor/autoload.php';

$deepl = \Scn\DeeplApiConnector\DeeplClientFactory::create('your-api-key');

try {
    $translation = new \Scn\DeeplApiConnector\Model\TranslationConfig(
        'My little Test',
        \Scn\DeeplApiConnector\Enum\LanguageEnum::LANGUAGE_DE
    );

    $translationObject = $deepl->translate('some text', \Scn\DeeplApiConnector\Enum\LanguageEnum::LANGUAGE_DE);
}
```

Optional you also can translate a batch of texts as once, see `example/translate_batch.php`

#### Add File to Translation Queue

[](#add-file-to-translation-queue)

```
require_once __DIR__  . '/vendor/autoload.php';

$deepl = \Scn\DeeplApiConnector\DeeplClientFactory::create('your-api-key');

try {
    $fileTranslation = new \Scn\DeeplApiConnector\Model\FileTranslationConfig(
        file_get_contents('test.txt'),
        'test.txt',
        \Scn\DeeplApiConnector\Enum\LanguageEnum::LANGUAGE_EN,
        \Scn\DeeplApiConnector\Enum\LanguageEnum::LANGUAGE_DE
    );

    $fileSubmission = $deepl->translateFile($fileTranslation);

    $fileSubmission->getDocumentId()
}
```

#### Check File Translation Status

[](#check-file-translation-status)

All translation states are available in `FileStatusEnum`

```
require_once __DIR__  . '/vendor/autoload.php';

$deepl = \Scn\DeeplApiConnector\DeeplClientFactory::create('your-api-key');

try {
    $fileTranslation = new \Scn\DeeplApiConnector\Model\FileTranslationConfig(
        file_get_contents('test.txt'),
        'test.txt',
        \Scn\DeeplApiConnector\Enum\LanguageEnum::LANGUAGE_EN,
        \Scn\DeeplApiConnector\Enum\LanguageEnum::LANGUAGE_DE
    );

    $fileSubmission = $deepl->translateFile($fileTranslation);

    $translationStatus = $deepl->getFileTranslationStatus($fileSubmission);
}
```

#### Get Translated File Content

[](#get-translated-file-content)

```
require_once __DIR__  . '/vendor/autoload.php';

$deepl = \Scn\DeeplApiConnector\DeeplClientFactory::create('your-api-key');

try {
    $fileTranslation = new \Scn\DeeplApiConnector\Model\FileTranslationConfig(
        file_get_contents('test.txt'),
        'test.txt',
        \Scn\DeeplApiConnector\Enum\LanguageEnum::LANGUAGE_EN,
        \Scn\DeeplApiConnector\Enum\LanguageEnum::LANGUAGE_DE
    );

    $fileSubmission = $deepl->translateFile($fileTranslation);

    $file = $deepl->getFileTranslation($fileSubmission);

    echo $file->getContent();
}
```

#### Retrieve supported languages

[](#retrieve-supported-languages)

See `example/retrieve_supported_languages.php`

#### Working with glossaries

[](#working-with-glossaries)

See [use\_glossaries.php](example/use_glossaries.php)

Testing
-------

[](#testing)

```
$ composer test
```

Credits
-------

[](#credits)

- [Deepl](https://www.deepl.com)

License
-------

[](#license)

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

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance63

Regular maintenance activity

Popularity44

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity86

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

Recently: every ~191 days

Total

24

Last Release

466d ago

Major Versions

v1.4.0 → v2.0.02019-08-02

v2.2.0 → v3.0.02022-01-20

3.3.1 → v4.0.02025-02-06

PHP version history (5 changes)v1.0.0PHP &gt;=5.6

v1.1.0PHP ^7.2

2.x-devPHP ^7.2 || ^8.0

v3.0.0PHP ^7.4 || ^8.0

v4.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/571575?v=4)[scn](/maintainers/scn)[@scn](https://github.com/scn)

---

Top Contributors

[![WorksDev](https://avatars.githubusercontent.com/u/6623695?v=4)](https://github.com/WorksDev "WorksDev (32 commits)")[![usox](https://avatars.githubusercontent.com/u/5184763?v=4)](https://github.com/usox "usox (30 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![Ciloe](https://avatars.githubusercontent.com/u/1830492?v=4)](https://github.com/Ciloe "Ciloe (2 commits)")[![Mistralys](https://avatars.githubusercontent.com/u/8895528?v=4)](https://github.com/Mistralys "Mistralys (2 commits)")[![modrictin](https://avatars.githubusercontent.com/u/31577031?v=4)](https://github.com/modrictin "modrictin (1 commits)")

---

Tags

apiapi-clientconnectordeepldeepl-apideepl-clienti18nphptranslationtranslationstranslatortranslationdeepl

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/scn-deepl-api-connector/health.svg)

```
[![Health](https://phpackages.com/badges/scn-deepl-api-connector/health.svg)](https://phpackages.com/packages/scn-deepl-api-connector)
```

###  Alternatives

[deeplcom/deepl-php

Official DeepL API Client Library

2616.2M66](/packages/deeplcom-deepl-php)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[jolicode/slack-php-api

An up to date PHP client for Slack's API

2534.4M12](/packages/jolicode-slack-php-api)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)

PHPackages © 2026

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