ANONYMOUS FILES

File Upload API

Anonymous Files' file upload API allows you to upload a file and retrieve file details from the command line or using any programming language. Using the API you have full control over your upload and can do the same as the drag and drop on the front page.

Our API is RESTful and returns a json response. No authentication is needed.

As with the web site, the API is anonymous and we do not log any identifying information.

Basic file upload

For a basic file upload you must perform a HTTP POST on our API endpoint https://api.anonymousfiles.io/ and specify the file parameter. This will upload the file with no options selected, the same as when dropping a file on the main page.

The following is an example using curl you can adapt to any programming language:

$ curl -F [email protected] https://api.anonymousfiles.io/
{
    "id": "31hsyyGb",
    "name": "testimage.jpg",
    "size": 191475,
    "url": "https://anonymousfiles.io/31hsyyGb/"
}

The API will respond with a json representation of your file upload. You must save the id parameter. The url parameter is a link to the download page for your file.

File upload with options

You can also pass optional parameters for expires and no_index.

expires must be a string. Enter an expiry like 1h, 2d, 3w etc and after this your file will expire and be deleted. Minimum 1h maximum 6m. Valid values: 1h-24h, 1d-7d, 1w-4w, 1m-6m.

no_index must be a boolean-type value, e.g. true|false.

For example, passing both parameters, using curl:

$ curl -F [email protected] -F expires=1h -F no_index=true https://api.anonymousfiles.io/
{
    "id": "31hsyyGb",
    "name": "testimage.jpg",
    "size": 191475,
    "url": "https://anonymousfiles.io/31hsyyGb/"
}

File detail endpoint

To return the details of a file upload you must perform a HTTP GET on the API detail endpoint https://api.anonymousfiles.io/{id}/ and pass the id string parameter.

For example, using curl:

$ curl https://api.anonymousfiles.io/31hsyyGb/
{
    "id": "31hsyyGb",
    "name": "testimage.jpg",
    "size": 191475,
    "url": "https://anonymousfiles.io/31hsyyGb/"
}