Skip to main content

ConvertAPI Python Client

PyPI version Build Status License: MIT

Convert your files with our online file conversion API

ConvertAPI helps to convert various file formats. Creating PDF and Images from various sources like Word, Excel, Powerpoint, images, web pages or raw HTML codes. Merge, Encrypt, Split, Repair and Decrypt PDF files and many other manipulations. You can integrate it into your application in just a few minutes and use it easily.

Installation

Install with pip:

pip install --upgrade convertapi

Install from source with:

pip install .

Requirements

  • Python 3 with requests; tested on Python 3.10–3.14

Usage

Configuration

You can get your API credentials at https://www.convertapi.com/a

import convertapi

convertapi.api_credentials = 'api-token'

Proxy configuration

If you need to use a proxy, you can specify it using HTTPS_PROXY environment variable when running your script.

Example:

API_TOKEN=api-token HTTPS_PROXY=https://user:pass@127.0.0.1:9000/ python convert_word_to_pdf_and_png.py

File conversion

Convert a file to PDF example. All supported file formats and options can be found here.

result = convertapi.convert('pdf', { 'File': '/path/to/my_file.docx' })

# save to file
result.file.save('/path/to/save/file.pdf')

Other result operations:

# save all result files to folder
result.save_files('/path/to/save/files')

# get conversion cost
conversion_cost = result.conversion_cost

Convert file url

result = convertapi.convert('pdf', { 'File': 'https://website/my_file.docx' })

Specifying from format

result = convertapi.convert(
    'pdf',
    { 'File': '/path/to/my_file' },
    from_format = 'docx'
)

Additional conversion parameters

ConvertAPI accepts additional conversion parameters depending on selected formats. All conversion parameters and explanations can be found here.

result = convertapi.convert(
    'pdf',
    {
        'File': '/path/to/my_file.docx',
        'PageRange': '1-10',
        'PdfResolution': '150',
    }
)

User information

You can always check your usage by fetching user information.

user_info = convertapi.user()

print(user_info['ConversionsTotal'])
print(user_info['ConversionsConsumed'])

Alternative domain

Set base_uri parameter to use other service domains. Dedicated to the region domain list.

convertapi.base_uri = 'https://eu-v2.convertapi.com/'

More examples

Find more advanced examples in the /examples folder.

Development

pip install -e . -r test-requirements.txt
pytest

Tests marked live call the real service and are skipped unless CONVERT_API_SECRET holds an API token (CONVERT_API_BASE_URI optionally points them at another deployment). Releases are described in RELEASING.md.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ConvertAPI/convertapi-library-python. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The library is available as open source under the terms of the MIT License.

Metadata

Release files for convertapi 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for convertapi 2.0.1
File Size Uploaded Provenance
convertapi-2.0.1.tar.gz 10.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for convertapi 2.0.1
File Interpreter ABI Platform
convertapi-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 19.9 kB

Release files / convertapi-2.0.1.tar.gz

Download URL convertapi-2.0.1.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
960414526aeeafd946601fdd1db2478d8a2329d53da6059dfa75069e8ebd81e1
BLAKE2b-256 checksum
How to use checksums
eb933c1bfb1e13147b28651fe8c035f5d2f937c983c13888eea7ddb2ca6acfc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 20, 2026.

Transparency log

Release files / convertapi-2.0.1-py3-none-any.whl

Download URL convertapi-2.0.1-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb9e2d81b85d18e7f1d3dbd9ba3599062ba8c0da6ef9a629e60455640013ee18
BLAKE2b-256 checksum
How to use checksums
83450bb607c94f2e41b4147e45c671c7e3e855e0d6018158dbe9863ef1528a89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 20, 2026.

Transparency log

Security for convertapi 2.0.1

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.

Select from 2 files

Attestation for convertapi-2.0.1.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 Oct 20, 2026.

Transparency log

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

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page