Document Conversions using cURL

Using cURL to interact with ConvertAPI offers a straightforward way to perform document transformations and file conversions without needing specialized libraries. With just a few command-line steps, you can seamlessly integrate ConvertAPI’s robust features into your existing workflows.

Integrate within minutes

It is easy to start converting documents using cURL in a few simple steps:

1

Sign up for a free account

Sign up for free and receive 250 conversions to try and evaluate our service. You will receive a free trial with no credit card required upon registration!

2

Set up the conversion online

On your account dashboard you will access an intuitive UI tool that allows you to set up the conversion, adjust the parameters, and try the conversion online with zero code.

3

Copy auto-generated code snippet

Once you have set up the conversion parameters and are happy with the conversion results, you will receive an auto-generated cURL code snippet with your custom parameters!

Get started now

Document management toolkit for cURL

By sending HTTP requests directly from your terminal or scripts, you can convert PDFs, Office files, images, and more simply by specifying the appropriate endpoint, file, and any desired parameters. This approach is especially helpful for automation tasks, server environments where you want minimal dependencies, or quick one-off conversions.

File Converter Suite

High-performance and unbeatable accuracy document converter suite with support for over 500+ conversion.

Document Builder using cURL

Generate dynamic DOCX and PDF documents like invoices, contracts, reports, on the fly.

Document Management tools

Protect, redact, compare, watermark, flatten, compress and modify your documents using ConvertAPI cURL.

Security and Decryption

Protect and unprotect PDFs, MS Office Powerpoint and MS Office Word documents.

AI Data Extractor

Built to scale with your business, whether you're handling a few conversions or thousands.

Archiving & Optimization

Reduce file sizes without losing quality. Archive converters are designed to handle over 100 different file formats.

Take a look at cURL code samples

View on GitHub

Configure it online - we will generate the cURL code for you!

Configure your file conversion directly online using our intuitive interface. Select the desired parameters and see the results in real-time. Once you're satisfied, we’ll automatically generate the cURL code for you, making integration into your project effortless. No need to start from scratch—just copy the code and implement it seamlessly into your application!

Get started now

File conversion examples using cURL

Using cURL, you can directly invoke ConvertAPI’s extensive document conversion and manipulation features from the command line or within scripts—no additional software or libraries required. By sending HTTP requests to the ConvertAPI endpoints, you’re able to perform operations like converting PDFs, merging documents, compressing images, or extracting data, all using familiar cURL commands. This approach makes it easy to automate conversions in shell scripts, integrate with CI/CD pipelines, and quickly test or debug new workflows.

With straightforward parameters for specifying files, formats, and advanced options (such as page ranges or image quality), cURL provides a lightweight, flexible way to tap into ConvertAPI’s robust capabilities from virtually any environment.

Basic Usage Examples

Convert WEB to PDF using cURL

curl -X POST https://v2.convertapi.com/convert/web/to/pdf?auth=secret_or_token -F "Url=https://www.google.com" -F "StoreFile=true"

Convert a local Excel to PDF

curl -X POST https://v2.convertapi.com/convert/xlsx/to/pdf?auth=secret_or_token -F "File=@/path/to/doc.xlsx" -F "StoreFile=true"

Convert a remote Word to PDF

curl -X POST https://v2.convertapi.com/convert/docx/to/pdf \
     -H "Authorization: Bearer secret_or_token" \
     -F "File=https://cdn.convertapi.com/cara/testfiles/document.docx" \
     -F "StoreFile=true"

Setting Additional Parameters

Every conversion endpoint accepts specific custom parameters. You can find these on the converter landing pages .

Convert a local PowerPoint to PNG with additional parameters

curl -X POST https://v2.convertapi.com/convert/pptx/to/png \
     -H "Authorization: Bearer secret_or_token" \
     -F "File=@/path/to/presentation.pptx" \
     -F "StoreFile=true" \
     -F "ImageResolutionH=500" \
     -F "ImageResolutionV=500" \
     -F "ScaleImage=true" \
     -F "ScaleProportions=true"

Conversion Chaining Using cURL

You can create a conversion workflow by chaining multiple conversions with cURL. For instance, convert a PDF file into several JPG images and then compress the converted files into a single ZIP archive.

Step 1: Convert a PDF to JPG

curl -X POST https://v2.convertapi.com/convert/pdf/to/jpg \
     -H "Authorization: Bearer secret_or_token" \
     -F "File=@/path/to/document.pdf" \
     -F "ImageResolutionH=500" \
     -F "ImageResolutionV=500" \
     -F "ScaleImage=true" \
     -F "StoreFile=true"

Step 2: Archive multiple JPG images to a ZIP archive

In this example we used a PDF document that consists of 3 pages which results in 3 separate JPG images. Now let's zip multiple converted files into a single archive:

curl -X POST https://v2.convertapi.com/convert/jpg/to/zip \
     -H "Authorization: Bearer secret_or_token" \
     -F "Files[0]=https://v2.convertapi.com/d/dda2ab19d23e7aaa4203b5ff1fa5a13b/document.jpg" \
     -F "Files[1]=https://v2.convertapi.com/d/600e09f511ee90bbe5385ba32d791768/document-2.jpg" \
     -F "Files[2]=https://v2.convertapi.com/d/8601b3e1ce2abad484cc58ef0c8f2a28/document-3.jpg"
     -F "StoreFile=true"

In this example, the file URLs passed as the file array parameters are the converted files from a previous conversion step. You can use FileId instead if you wish, however you must store the files on our servers by setting the StoreFile=True to be able to chain multiple conversions. It will be deleted automatically after a maximum period of 3 hours.


Conclusion

The ConvertAPI cURL integration offers a powerful and flexible way to access ConvertAPI’s extensive document conversion and manipulation capabilities directly from your terminal or within shell scripts. By leveraging the ubiquitous cURL tool, you can perform complex file transformations without the need for additional programming languages or SDKs.

For more details, updates, and deeper usage examples, explore the ConvertAPI cURL GitHub repository.

Data security is our top priority

We ensure that all document processing is handled securely in the cloud, adhering to industry-leading standards like ISO 27001, GDPR, and HIPAA. To enhance security even further, we can ensure that no files or data are stored on our servers and never leave your country.

Learn more about security

Frequently asked questions

What is ConvertAPI’s cURL integration?

It refers to leveraging our document processing services via standard curl commands. Instead of installing a language-specific library, you can make HTTP requests from any environment where curl is available.

How do I authenticate requests?

You can find your authentication credentials on your account dashboard once you sign up. You can add them as a ?auth=secret_or_token query parameter, or using the Authorization header -H "Authorization: Bearer secret_or_token"

Does curl handle large files or batch processing?

Yes. You can process large files if you have sufficient system resources and network bandwidth. For bulk conversions, consider looping in a script or using a parallel tool (e.g., GNU Parallel or xargs -P) to launch multiple conversions at once.

Can I write a multiline curl command?

Yes, but the line-continuation symbol differs by shell or OS. For Bash/zsh (Linux, macOS) use the `\`, for Windows cmd.exe: `^`, and for PowerShell use the backtick: `

How do I debug or view request details?

Include -v or --verbose in your command to see the full request/response trace. That helps identify if there’s an issue with authentication, parameters, or file paths.

Try cURL integration for free!