Download OpenAPI specification:
The API allows you to interact with nekoweb server programmatically. You can use it to automate tasks like updating, creating and deleting files, and more.
Get information about a user's site. Replace :username with the username of the user. This endpoint doesn't require auth if requested from Nekoweb site.
Returns a JSON object with id, username, title, updates, followers, views, created_at and updated_at properties.
⚠ Note: no need to provide an API key fro this request as the endpoint is public.
username required | string Example: fairfruit |
const fetch = require('node-fetch'); let url = 'https://nekoweb.org/api/site/info/fairfruit'; let options = { method: 'GET' }; fetch(url, options) .then(res => res) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
{- "id": 1855,
- "username": "fairfruit",
- "title": "Welcome to Fairfruit",
- "updates": 5,
- "followers": 0,
- "views": 209,
- "created_at": 1709235724576,
- "updated_at": 1709597947291
}
Create a new file or folder.
Authorization | string Example: 177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d |
isFolder | boolean |
pathname | string |
const { URLSearchParams } = require('url'); const fetch = require('node-fetch'); const encodedParams = new URLSearchParams(); encodedParams.set('isFolder', 'true'); encodedParams.set('pathname', 'test'); let url = 'https://nekoweb.org/api/files/create'; let options = { method: 'POST', headers: { Authorization: '177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d', 'content-type': 'application/x-www-form-urlencoded' }, body: encodedParams }; fetch(url, options) .then(res => res) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
Folder created
Upload a file or files. This will overwrite old files. Max 100MB.
Authorization | string Example: 177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d |
pathname | string |
files | string <binary> |
const FormData = require('form-data'); const fetch = require('node-fetch'); const formData = new FormData(); formData.append('pathname', '/test'); formData.append('files', 'test.txt', { filepath: './test.txt' }); let url = 'https://nekoweb.org/api/files/upload'; let options = { method: 'POST', headers: { Authorization: '177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d' } }; options.body = formData; fetch(url, options) .then(res => res) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
Files uploaded
Delete a file or folder.
Authorization | string Example: 177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d |
pathname | string |
const { URLSearchParams } = require('url'); const fetch = require('node-fetch'); const encodedParams = new URLSearchParams(); encodedParams.set('pathname', 'test'); let url = 'https://nekoweb.org/api/files/delete'; let options = { method: 'POST', headers: { Authorization: '177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d', 'content-type': 'application/x-www-form-urlencoded' }, body: encodedParams }; fetch(url, options) .then(res => res) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
File/folder deleted
Rename/Move a file or folder.
Authorization | string Example: 177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d |
pathname | string |
newpathname | string |
const { URLSearchParams } = require('url'); const fetch = require('node-fetch'); const encodedParams = new URLSearchParams(); encodedParams.set('pathname', 'test'); encodedParams.set('newpathname', 'test2'); let url = 'https://nekoweb.org/api/files/rename'; let options = { method: 'POST', headers: { Authorization: '177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d', 'content-type': 'application/x-www-form-urlencoded' }, body: encodedParams }; fetch(url, options) .then(res => res) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
File/folder renamed
Edit a file.
Authorization | string Example: 177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d |
pathname | string |
content | string |
const FormData = require('form-data'); const fetch = require('node-fetch'); const formData = new FormData(); formData.append('pathname', 'test/test.txt'); formData.append('content', 'Hello world'); let url = 'https://nekoweb.org/api/files/edit'; let options = { method: 'POST', headers: { Authorization: '177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d' } }; options.body = formData; fetch(url, options) .then(res => res) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
File edited
Read a folder.
Returns a JSON array with objects like this: {name: String, dir: Boolean}
pathname | string Example: pathname=test |
Authorization | string Example: 177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d |
const fetch = require('node-fetch'); let url = 'https://nekoweb.org/api/files/readfolder?pathname=test'; let options = { method: 'GET', headers: { Authorization: '177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d' } }; fetch(url, options) .then(res => res) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
[- {
- "name": "test.txt",
- "dir": false
}, - {
- "name": "test2",
- "dir": true
}
]
Create upload for a big file. Allows you to upload files larger than 100MB.
Authorization | string Example: 177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d |
const fetch = require('node-fetch'); let url = 'https://nekoweb.org/api/files/big/create'; let options = { method: 'GET', headers: { Authorization: '177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d' } }; fetch(url, options) .then(res => res) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
{- "id": "fnc8orbox7dk71y1kzwke"
}
Append a chunk to a big file upload.
⚠ Note: you'll need to call /files/big/move
or /files/import/:bigid
to persist the file.
Authorization | string Example: 177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d |
id | string |
file | string <binary> |
const FormData = require('form-data'); const fetch = require('node-fetch'); const formData = new FormData(); formData.append('id', 'fnc8orbox7dk71y1kzwke'); formData.append('file', 'test.txt', { filepath: './test.txt' }); let url = 'https://nekoweb.org/api/files/big/append'; let options = { method: 'POST', headers: { Authorization: '177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d' } }; options.body = formData; fetch(url, options) .then(res => res) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
Appended
Move a big file upload to the final location.
Authorization | string Example: 177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d |
id | string |
pathname | string |
const { URLSearchParams } = require('url'); const fetch = require('node-fetch'); const encodedParams = new URLSearchParams(); encodedParams.set('id', 'fnc8orbox7dk71y1kzwke'); encodedParams.set('pathname', 'test.txt'); let url = 'https://nekoweb.org/api/files/big/move'; let options = { method: 'POST', headers: { Authorization: '177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d', 'content-type': 'application/x-www-form-urlencoded' }, body: encodedParams }; fetch(url, options) .then(res => res) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
Moved
Import a zip file from a big file upload. Replace :bigid with the id of the big file upload.
⚠ Note: should be called after calling /files/big/append
to upload the archive, with the same id.
bigid required | string Example: il4w31f9m1aqqqe8op7hp |
Authorization | string Example: 177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d |
const fetch = require('node-fetch'); let url = 'https://nekoweb.org/api/files/import/il4w31f9m1aqqqe8op7hp'; let options = { method: 'POST', headers: { Authorization: '177e9b41e8b35b5e3cf90dd4a1ce90b9c8d1e6aa79863c0ebfd9c1e5dbb4d24d' } }; fetch(url, options) .then(res => res) .then(json => console.log(json)) .catch(err => console.error('error:' + err));
Imported