Detect Language API Python Client
Detects language of given text. Returns detected language codes and scores.
Before using Detect Language API client you have to setup your personal API key. You can get it by signing up at https://detectlanguage.com
Installation
pip install detectlanguage
Upgrading
When upgrading please check changelog for breaking changes.
Configuration
import detectlanguage
detectlanguage.configuration.api_key = "YOUR API KEY"
# You can use proxy if needed
# detectlanguage.configuration.proxies = {'https': 'https://user:pass@proxy:8080'}
Usage
Detect language
detectlanguage.detect("Dolce far niente")
Result
[{'language': 'it', 'score': 0.5074}]
Detect single code
If you need just a language code you can use detect_code.
detectlanguage.detect_code("Dolce far niente")
Result
'it'
Batch detection
It is possible to detect language of several texts with one request. This method is faster than doing one request per text.
detectlanguage.detect_batch(["Dolce far niente", "Hello world"])
Result
Result is array of detections in the same order as the texts were passed.
[[{'language': 'it', 'score': 0.5074}], [{'language': 'en', 'score': 0.9098}]]
Get your account status
detectlanguage.account_status()
Result
{ 'status': 'ACTIVE', 'daily_requests_limit': 5000, 'daily_bytes_limit': 1048576,
'bytes': 3151, 'plan': 'FREE', 'date': '2014-03-29', 'requests': 263,
'plan_expires': None }
Get list of supported languages
detectlanguage.languages()
Result
[{'code': 'aa', 'name': 'Afar'}, {'code': 'ab', 'name': 'Abkhazian'}, ...]
License
Detect Language API Python Client is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
Metadata
Release files for detectlanguage 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| detectlanguage-2.0.0.tar.gz | 5.2 kB | With provenance | Details for detectlanguage-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| detectlanguage-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for detectlanguage-2.0.0-py3-none-any.whl |
Total release size: 10.6 kB
Release files / detectlanguage-2.0.0.tar.gz
| Download URL | detectlanguage-2.0.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2746b629744b9603156df4bd528e09506be49c00edaa2ee02310181ba221c76c
|
|
BLAKE2b-256 checksum How to use checksums |
d2673a3b478b85a4f989062a9d2f16e26c4a2e358e60fb62a606c75b4b64e8db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 20, 2025.
Transparency logRelease files / detectlanguage-2.0.0-py3-none-any.whl
| Download URL | detectlanguage-2.0.0-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24fe10946284e113d34267b8026c388df291e1d94f922d2c55b6a79fedaed68d
|
|
BLAKE2b-256 checksum How to use checksums |
8bcb18fa7f4451855645a70c2d757c22eeaed8b23a3c633b150db11d85f874c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 20, 2025.
Transparency logSecurity for detectlanguage 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for detectlanguage-2.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 20, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.