
📚 Documentation & Examples
Everything you need to integrate with GoFile
🚀 Quick Start Examples
// GoFile API Example
const response = await fetch('https://gofile.io/api', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);The Gofile API offers a powerful solution for users needing to upload files of any size without incurring costs. This free service ensures that you can effortlessly store and share massive files without worrying about storage limits or financial constraints. With an intuitive interface and straightforward documentation available at gofile.io/api, developers can quickly integrate unlimited file uploads into their applications. This API is designed to accommodate various file types, making it an ideal choice for developers who need a reliable and scalable file management solution.
Utilizing the Gofile API provides numerous advantages, including ease of use, no size restrictions on uploads, support for multiple file formats, fast upload speeds, and comprehensive documentation to streamline the integration process. These benefits position Gofile as an ideal choice for both individual and business users looking to efficiently manage their file storage needs. Below is a simple JavaScript code example for calling the Gofile API to upload a file:
const fs = require('fs');
const axios = require('axios');
async function uploadFile(filePath) {
const file = fs.createReadStream(filePath);
try {
const response = await axios.post('https://api.gofile.io/uploadFile', file, {
headers: {
'Content-Type': 'multipart/form-data',
}
});
console.log('File uploaded successfully:', response.data);
} catch (error) {
console.error('Error uploading file:', error);
}
}
uploadFile('path/to/your/file.ext');
- Unlimited file size uploads
- Completely free to use
- Supports a wide range of file formats
- Fast upload speeds for improved user experience
- Comprehensive and user-friendly documentation
Getting Started — No API Key Required
Gofile lets you upload anonymously with no API key or account. Uploading without credentials automatically creates a temporary guest account and returns a download-page link.
The current flow is two steps: first ask the API for the best upload server, then POST your file to it.
// 1. Get an available upload server
const { data } = await fetch('https://api.gofile.io/servers').then(r => r.json());
const server = data.servers[0].name;
// 2. Upload the file to that server
const form = new FormData();
form.append('file', fileInput.files[0]);
const res = await fetch(`https://${server}.gofile.io/contents/uploadfile`, {
method: 'POST',
body: form
});
console.log(await res.json());
Optional: create a free account and copy your API token from your profile page to tie uploads to your account. Send it as Authorization: Bearer YOUR_TOKEN. See gofile.io/api for the full endpoint list.









