Skip to content
Developer API

CocoConvert API

Integrate file conversion into your application. Simple REST API, 50+ formats, instant results.

Quick Start

Converting a file is a 4-step process: get upload URL → upload to R2 → create job → poll & download.

# 1. Get a pre-signed upload URL
UPLOAD=$(curl -s -X POST https://cococonvert.com/api/files/get-upload-url \
  -H "Authorization: Bearer coco_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fileName":"photo.png","fileSize":204800,"contentType":"image/png"}')

UPLOAD_URL=$(echo $UPLOAD | jq -r '.uploadUrl')
FILE_KEY=$(echo $UPLOAD | jq -r '.fileKey')

# 2. Upload directly to R2
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: image/png" \
  --data-binary @photo.png

# 3. Create the conversion job
JOB=$(curl -s -X POST https://cococonvert.com/api/jobs/create \
  -H "Authorization: Bearer coco_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"fileKey\":\"$FILE_KEY\",\"sourceFormat\":\"png\",\"targetFormat\":\"jpg\",\"fileSize\":204800}")

JOB_ID=$(echo $JOB | jq -r '.jobId')

# 4. Poll until completed, then download
STATUS=$(curl -s https://cococonvert.com/api/jobs/$JOB_ID \
  -H "Authorization: Bearer coco_YOUR_API_KEY")

DOWNLOAD_URL=$(echo $STATUS | jq -r '.downloadUrl')
curl -o output.jpg "$DOWNLOAD_URL"

Endpoints

POST/api/files/get-upload-url

Get a pre-signed URL to upload your file directly to R2 storage.

Request Body:

{ fileName: string, fileSize: number, contentType: string }

Response:

{ uploadUrl: string, fileKey: string, fileId: string, expiresIn: 600 }

curl -s -X POST https://cococonvert.com/api/files/get-upload-url \
  -H "Authorization: Bearer coco_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fileName":"photo.png","fileSize":204800,"contentType":"image/png"}'
PUT{uploadUrl}

Upload the file directly to R2 using the pre-signed URL from step 1.

Request Body:

Raw binary file content

Response:

(empty — 200 OK on success)

curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: image/png" \
  --data-binary @photo.png
POST/api/jobs/create

Create a conversion job. The file is processed asynchronously.

Request Body:

{ fileKey: string, sourceFormat: string, targetFormat: string, fileSize: number, options?: object }

Response:

{ jobId: string }

curl -s -X POST https://cococonvert.com/api/jobs/create \
  -H "Authorization: Bearer coco_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fileKey":"'$FILE_KEY'","sourceFormat":"png","targetFormat":"jpg","fileSize":204800}'
GET/api/jobs/{jobId}

Poll job status. When status is "completed", downloadUrl contains the result.

Request Body:

None

Response:

{ jobId, status, downloadUrl, error, sourceFormat, targetFormat, fileName, cpuMinutes, createdAt, completedAt }

curl -s https://cococonvert.com/api/jobs/$JOB_ID \
  -H "Authorization: Bearer coco_YOUR_API_KEY"

Supported Formats

The API supports all the same formats as the web converter — 50+ formats across images, video, audio, documents, spreadsheets, presentations, and more.

View all supported conversions →

Rate Limits

Rate limiting: API endpoints are rate-limited per IP to 20 requests/minute for upload and convert, 60 requests/minute for other endpoints.

File size limits, hourly file limits, and daily conversion quotas depend on your plan.

View plans & limits →

Authentication

Free tier: No authentication required. Limits apply per IP address.

Paid plans (Plus, Pro, Business, Enterprise): Generate an API key from your profile page. Pass it as a Bearer token in the Authorization header:

Authorization: Bearer coco_YOUR_API_KEY

Rate limits by plan:

  • Plus: 1,000 API calls/month
  • Pro: 10,000 API calls/month
  • Business: 50,000 API calls/month
  • Enterprise: 100,000+ API calls/month