API documentation

Coconut's API is a config-based API built with simplicity and flexibility in mind.
Encode your first video in less than 5 minutes.

API Reference

Input

required The input file to convert by Coconut. We support the following source type:

FTP, SFTP and HTTP protocols

HTTP example:

{
  "input": {
    "url": "https://mybucket.s3.amazonaws.com/upls/video.mp4"
  }
}

FTP example:

{
  "input": {
    "url": "ftp://username:passwd@myserver/path/video.mp4"
  }
}

Parameters

NameTypeDefaultRequired
url
Public URL. For example
https://host/path/file.mp4
ftp://user:pass@host:9888/path/file.mp4
string Yes

Presigned URLs using private S3 bucket

You can also generate a presigned URLs when files are located in a private bucket.

Here is an example in ruby:

s3 = Aws::S3::Client.new(
  :access_key_id => ENV["AWS_ACCESS_KEY_ID"],
  :secret_access_key => ENV["AWS_SECRET_ACCESS_KEY"],
  :region => ENV["AWS_REGION"]
)

signer = Aws::S3::Presigner.new(:client => s3)
signer.presigned_url(:get_object, {
  :bucket => "mybucket",
  :key => "/path/file.mp4",
  :expires_in => 21600
})

Services

AWS S3

Example for AWS S3 source:

{
  "input": {
    "service": "s3",
    "credentials": {
      "access_key_id": "...",
      "secret_access_key": "..."
    },
    "bucket": "mybucket",
    "key": "/path/file.mp4",
    "region": "us-east-1"
  }
}

Options

NameTypeDefaultRequired
service
Service must be s3.
string s3 Yes
credentials
Keys to authenticate against AWS S3.
hash Yes
access_key_id
The AWS Access Key Id.
string Yes
secret_access_key
The AWS Secret Access Key.
string Yes
bucket
The bucket where the file is located.
string Yes
key
The object key.
string Yes
region
The bucket region.
Supported regions are: us-east-2 us-east-1 us-west-1 us-west-2 af-south-1 ap-east-1 ap-south-1 ap-northeast-3 ap-northeast-2 ap-southeast-1 ap-southeast-2 ap-northeast-1 ca-central-1 cn-north-1 cn-northwest-1 eu-central-1 eu-west-1 eu-west-2 eu-south-1 eu-west-3 eu-north-1.
string Yes

Google Cloud Storage

Example for GCS source:

{
  "input": {
    "service": "gcs",
    "credentials": {
      "access_key_id": "...",
      "secret_access_key": "..."
    },
    "bucket": "mybucket",
    "key": "/path/file.mp4",
  }
}

Options

NameTypeDefaultRequired
service
Service must be gcs.
string gcs Yes
credentials
Keys to authenticate.
hash Yes
access_key_id
The AWS Access Key Id.
string Yes
secret_access_key
The AWS Secret Access Key.
string Yes
bucket
The bucket where the file is located.
string Yes
key
The object key.
string Yes

DO Spaces

Example for DO Spaces source:

{
  "input": {
    "service": "dospaces",
    "credentials": {
      "access_key_id": "...",
      "secret_access_key": "..."
    },
    "bucket": "mybucket",
    "key": "/path/file.mp4",
    "region": "nyc3"
  }
}

Options

NameTypeDefaultRequired
service
Service must be dospaces.
string dospaces Yes
credentials
Keys to authenticate.
hash Yes
access_key_id
The AWS Access Key Id.
string Yes
secret_access_key
The AWS Secret Access Key.
string Yes
bucket
The bucket where the file is located.
string Yes
key
The object key.
string Yes
region
The bucket region.
Supported regions are: nyc3 sfo2 sgp1 fra1.
string Yes

Linode

Example for Linode source:

{
  "input": {
    "service": "linode",
    "credentials": {
      "access_key_id": "...",
      "secret_access_key": "..."
    },
    "bucket": "mybucket",
    "key": "/path/file.mp4",
    "region": "us-east-1"
  }
}

Options

NameTypeDefaultRequired
service
Service must be linode.
string linode Yes
credentials
Keys to authenticate.
hash Yes
access_key_id
The AWS Access Key Id.
string Yes
secret_access_key
The AWS Secret Access Key.
string Yes
bucket
The bucket where the file is located.
string Yes
key
The object key.
string Yes
region
The bucket region.
Supported regions are: us-east-1 us-east-2 eu-central-1.
string Yes

Wasabi

Example for Wasabi source:

{
  "input": {
    "service": "wasabi",
    "credentials": {
      "access_key_id": "...",
      "secret_access_key": "..."
    },
    "bucket": "mybucket",
    "key": "/path/file.mp4",
    "region": "us-east-1"
  }
}

Options

NameTypeDefaultRequired
service
Service must be wasabi.
string wasabi Yes
credentials
Keys to authenticate.
hash Yes
access_key_id
The AWS Access Key Id.
string Yes
secret_access_key
The AWS Secret Access Key.
string Yes
bucket
The bucket where the file is located.
string Yes
key
The object key.
string Yes
region
The bucket region.
Supported regions are: us-east-1 us-east-2 us-west-1 eu-central-1.
string Yes

Any S3 Compatible services

Example for a S3 compatible source:

{
  "input": {
    "service": "s3other",
    "credentials": {
      "access_key_id": "...",
      "secret_access_key": "..."
    },
    "bucket": "mybucket",
    "key": "/path/file.mp4",
    "endpoint": "https://compatibles3.com/"
  }
}

Options

NameTypeDefaultRequired
service
Service must be s3other.
string s3other Yes
credentials
Keys to authenticate.
hash Yes
access_key_id
The AWS Access Key Id.
string Yes
secret_access_key
The AWS Secret Access Key.
string Yes
bucket
The bucket where the file is located.
string Yes
key
The object key.
string Yes
endpoint
The API endpoint (full URL) pointing to the S3 compatible service API.
string Yes
region
The bucket region.
string No