API
++
Please be aware that Gofile is currently in BETA, and the API may experience modifications. We encourage you to check back regularly for updates. If you have any inquiries, please feel free to reach out to us via the contact page.
+Last update: 2023-04-20
+The Gofile system operates using accounts, files, and folders. With this API, you can manage an efficient file storage system. All files are organized within folders, and each folder is associated with an account. Every account has at least one root folder, which cannot be deleted.
+If you upload a file without specifying any parameters, a guest account and a root folder will be created, and the file will be uploaded to a new folder within the root folder. If you wish to upload multiple files, you must first upload the initial file, then obtain the folderId from the response of the request. You can then upload the remaining files one at a time, specifying the folderId as a parameter.
+Endpoints marked with the following icon require a premium account.
++ +
+Returns the best server available to receive files.
+
+ Curl example
+
curl https://api.gofile.io/getServer
+
+
+ JavaScript example
+
+fetch('https://api.gofile.io/getServer')
+ .then(response => response.json())
+ .then(data => {
+ if (data.status === 'ok') {
+ console.log(data.data.server)
+ }
+ })
+ .catch(error => console.error(error))
+
+
+
+ Response example
+
+{
+ "status": "ok",
+ "data": {
+ "server": "store1"
+ }
+}
+
+
+ + +
+Upload one file on a specific server.
If you specify a folderId, the file will be added to this folder.
+
-
+
-
+ requiredfile
Must contain one file.
If you want to upload multiple files, call uploadFile again and specify the folderId of the first file uploaded.
+ -
+ optionaltoken
The access token of an account. Can be retrieved from the profile page.
If valid, the file will be added to this account.
If undefined, a guest account will be created to receive the file.
+ -
+ optionalfolderId
The ID of a folder.
If valid, the file will be added to this folder.
If undefined, a new folder will be created to receive the file.
When using the folderId, you must pass the account token.
+
+ Curl example
+
curl -F file=@someFile.txt https://store1.gofile.io/uploadFile
+
+
+ JavaScript example
+
+const formData = new FormData();
+formData.append('file', fileInput.files[0]);
+fetch('https://store1.gofile.io/uploadFile', {
+ method: 'POST',
+ body: formData,
+ })
+ .then(response => response.json())
+ .then(data => {
+ if (data.status === 'ok') {
+ console.log(data.data)
+ }
+ })
+ .catch(error => console.error(error))
+
+
+
+ Response example
+
+{
+ "status": "ok",
+ "data": {
+ "downloadPage": "https://gofile.io/d/Z19n9a",
+ "code": "Z19n9a",
+ "parentFolder": "3dbc2f87-4c1e-4a81-badc-af004e61a5b4",
+ "fileId": "4991e6d7-5217-46ae-af3d-c9174adae924",
+ "fileName": "example.mp4",
+ "md5": "10c918b1d01aea85864ee65d9e0c2305"
+ }
+}
+
+
+ + +
+Get a specific content details
+ Parameters+
-
+
-
+ requiredcontentId
The content ID.
+ -
+ requiredtoken
The access token of an account. Can be retrieved from the profile page.
+
+ Curl example
+
curl https://api.gofile.io/getContent?contentId=aefb20bd-1a19-4194-8c31-e750fbfcf0db&token=ivlW1ZSGn2Y4AoADbCHUjllj2cO9m3WM
+
+
+ JavaScript example
+
+fetch(`https://api.gofile.io/getContent?contentId=${contentId}&token=${token}`)
+ .then(response => response.json())
+ .then(data => {
+ if (data.status === 'ok') {
+ console.log(data.data)
+ }
+ })
+ .catch(error => console.error(error))
+
+
+
+ Response example
+
+{
+ "status": "ok",
+ "data": {
+ "isOwner": true,
+ "id": "3dbc2f87-4c1e-4a81-badc-af004e61a5b4",
+ "type": "folder",
+ "name": "Z19n9a",
+ "parentFolder": "3241d27a-f7e1-4158-bc75-73d057eff5fa",
+ "code": "Z19n9a",
+ "createTime": 1648229689,
+ "public": true,
+ "childs": [
+ "4991e6d7-5217-46ae-af3d-c9174adae924"
+ ],
+ "totalDownloadCount": 0,
+ "totalSize": 9840497,
+ "contents": {
+ "4991e6d7-5217-46ae-af3d-c9174adae924": {
+ "id": "4991e6d7-5217-46ae-af3d-c9174adae924",
+ "type": "file",
+ "name": "example.mp4",
+ "parentFolder": "3dbc2f87-4c1e-4a81-badc-af004e61a5b4",
+ "createTime": 1648229689,
+ "size": 9840497,
+ "downloadCount": 0,
+ "md5": "10c918b1d01aea85864ee65d9e0c2305",
+ "mimetype": "video/mp4",
+ "serverChoosen": "store4",
+ "directLink": "https://store4.gofile.io/download/direct/4991e6d7-5217-46ae-af3d-c9174adae924/example.mp4",
+ "link": "https://store4.gofile.io/download/4991e6d7-5217-46ae-af3d-c9174adae924/example.mp4"
+ }
+ }
+ }
+}
+
+
+
+ + +
+Create a new folder
+ Parameters+
-
+
-
+ requiredparentFolderId
The parent folder ID.
+ -
+ requiredfolderName
The name of the created folder.
+ -
+ requiredtoken
The access token of an account. Can be retrieved from the profile page.
+
+ Curl example
+
curl https://api.gofile.io/createFolder -X PUT --data-raw 'parentFolderId=aefb20bd-1a19-4194-8c31-e750fbfcf0db&token=ivlW1ZSGn2Y4AoADbCHUjllj2cO9m3WM&folderName=myFolder'
+
+
+ JavaScript example
+
+fetch('https://api.gofile.io/createFolder', {
+ method: 'PUT',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ parentFolderId: 'aefb20bd-1a19-4194-8c31-e750fbfcf0db',
+ token: 'ivlW1ZSGn2Y4AoADbCHUjllj2cO9m3WM',
+ folderName: 'myFolder',
+ }),
+})
+.then(response => response.json())
+.then(data => {
+ if (data.status === 'ok') {
+ console.log('Folder created successfully')
+ }
+})
+.catch(error => console.error(error))
+
+
+
+ Response example
+
+{
+ "status": "ok",
+ "data": {}
+}
+
+
+
+ + +
+Set an option on a content
+ Parameters+
-
+
-
+ requiredtoken
The access token of an account. Can be retrieved from the profile page.
+ -
+ requiredcontentId
The content ID.
+ -
+ requiredoption
Can be "public", "password", "description", "expire", "tags" or "directLink".
+ -
+ requiredvalue
The value of the option to be defined.
For "public", can be "true" or "false". The contentId must be a folder.
For "password", must be the password. The contentId must be a folder.
For "description", must be the description. The contentId must be a folder.
For "expire", must be the expiration date in the form of unix timestamp. The contentId must be a folder.
For "tags", must be a comma seperated list of tags. The contentId must be a folder.
For "directLink", can be "true" or "false". The contentId must be a file.
+
+ Curl example
+
curl https://api.gofile.io/setOption -X PUT --data-raw 'contentId=aefb20bd-1a19-4194-8c31-e750fbfcf0db&token=ivlW1ZSGn2Y4AoADbCHUjllj2cO9m3WM&option=description&value=Test+description'
+
+
+ JavaScript example
+
+fetch('https://api.gofile.io/setOption', {
+ method: 'PUT',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ contentId: 'aefb20bd-1a19-4194-8c31-e750fbfcf0db',
+ token: 'ivlW1ZSGn2Y4AoADbCHUjllj2cO9m3WM',
+ option: 'description',
+ value: 'Test description',
+ }),
+})
+.then(response => response.json())
+.then(data => {
+ if (data.status === 'ok') {
+ console.log(data.data)
+ }
+})
+.catch(error => console.error(error))
+
+
+
+ Response example
+
+{
+ "status": "ok",
+ "data": {}
+}
+
+
+
+ + +
+Copy one or multiple contents to another folder
+ Parameters+
-
+
-
+ requiredcontentsId
Comma separated contentId to copy (files or folders)
+ -
+ requiredfolderIdDest
Destination folder ID
+ -
+ requiredtoken
The access token of an account. Can be retrieved from the profile page.
+
+ Curl example
+
curl 'https://api.gofile.io/copyContent' -X PUT --data-raw 'contentsId=74cdb7aa-c7e5-4451-5314-f14b4c48c4c1&folderIdDest=18c320d4-c123-4aad-82f5-5ceae39fca1c&token=01n3MXauGU6ZNt347nujBrayPF1hM3nJ'
+
+
+ JavaScript example
+
+fetch('https://api.gofile.io/copyContent', {
+ method: 'PUT',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ contentsId: '74cdb7aa-c7e5-4451-5314-f14b4c48c4c1',
+ folderIdDest: '18c320d4-c123-4aad-82f5-5ceae39fca1c',
+ token: '01n3MXauGU6ZNt347nujBrayPF1hM3nJ',
+ }),
+})
+.then(response => response.json())
+.then(data => {
+ if (data.status === 'ok') {
+ console.log(data.data)
+ }
+})
+.catch(error => console.error(error))
+
+
+
+ Response example
+
+{
+ "status": "ok",
+ "data": {}
+}
+
+
+
+ + +
+Delete one or multiple files/folders
+ Parameters+
-
+
-
+ requiredcontentsId
Comma separated contentId to delete (files or folders)
+ -
+ requiredtoken
The access token of an account. Can be retrieved from the profile page.
+
+ Curl example
+
curl 'https://api.gofile.io/deleteContent' -X DELETE --data-raw 'contentsId=41c45aa2-4f81-424d-b943-81e854dbecfd%2C74bdb74f-c7e3-4968-8327-f14c4c48c4c6&token=ivlW1ZSGn2Y4AoADbCHUjllj2cO9m3WM'
+
+
+ JavaScript example
+
+fetch('https://api.gofile.io/deleteContent', {
+ method: 'DELETE',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ contentsId: '41c45aa2-4f81-424d-b943-81e854dbecfd,74bdb74f-c7e3-4968-8327-f14c4c48c4c6',
+ token: 'ivlW1ZSGn2Y4AoADbCHUjllj2cO9m3WM',
+ }),
+})
+.then(response => response.json())
+.then(data => {
+ if (data.status === 'ok') {
+ console.log(data.data)
+ }
+})
+.catch(error => console.error(error))
+
+
+
+ Response example
+
+{
+ "status": "ok",
+ "data": {}
+}
+
+
+
+ + +
+Retrieving specific account information
+ Parameters +-
+
-
+ requiredtoken
The access token of an account. Can be retrieved from the profile page.
+
+ Curl example
+
curl https://api.gofile.io/getAccountDetails?token=ivlW1ZSGn2Y4AoADbCHUjllj2cO9m3WM
+
+
+ JavaScript example
+
+fetch(`https://api.gofile.io/getAccountDetails?token=ivlW1ZSGn2Y4AoADbCHUjllj2cO9m3WM`)
+ .then(response => response.json())
+ .then(data => {
+ if (data.status === 'ok') {
+ console.log(data.data)
+ }
+ })
+ .catch(error => console.error(error))
+
+
+
+ Response example
+
+{
+ "status": "ok",
+ "data": {
+ "token": "ivlW1ZSGn2Y4AoADbCHUjllj2cO9m3WM",
+ "email": "email@domain.tld",
+ "tier": "standard",
+ "rootFolder": "2aecea58-84e6-420d-b2b9-68b4add8418d",
+ "foldersCount": 4,
+ "filesCount": 20,
+ "totalSize": 67653500,
+ "totalDownloadCount": 1
+ }
+}
+
+
+
+