🕺Simple API upload
Want a super fast way to upload to Arweave with no tokens or wallets needed, and also get your first uploads free?
Example 1.1. Minimal upload
curl --location 'https://api.akord.com/files' \
--header 'Accept: application/json' \
--header 'Api-Key: your_api_key' \
--header 'Content-Type: text/plain' \
--data '@/path/to/your/file.txt'const fs = require('fs').promises;
const data = await fs.readFile('/path/to/your/file.txt', 'utf8'); //nodejs specific
const response = await fetch('https://api.akord.com/files', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Api-Key': 'your_api_key',
'Content-Type': 'text/plain'
},
body: data
})import requests
with open('/path/to/your/file.txt', 'r', encoding='utf-8') as file:
data = file.read()
response = requests.post(
url='https://api.akord.com/files',
headers={
'Accept': 'application/json',
'Api-Key': 'your_api_key',
'Content-Type': 'text/plain'
},
data=data
){
"id": "a6f1fbfc-403d-4607-b648-4b949fdd50bd",
//technical id of upload. can be used to get metadata of the upload or file binary from cloud storage
"mime_type": "text/plain", //depends on content-type of upload, goes as a tag
"sizeInBytes": 10,
"cloud": {
"uri": "a6f1fbfc-403d-4607-b648-4b949fdd50bd", //same as ID
"url": "https://api.akord.com/files/a6f1fbfc-403d-4607-b648-4b949fdd50bd" //url to binary served from cloud storage
},
"tx": {
"id": "LAWVdsBRTkUF8ptiEwiU6n4Q-_5ukBJIFmeAllX7Q0E", //fixed ID of Arweave transaction (ANS-104 data item ID)
"status": "scheduled",
//indicates where is your file in Arweave bundling context
//scheduled - file is in our cloud storage and is scheduled for ANS-104
//verification - file is being verified for malicious content
//blocked - file is recognized as malicious, won't go to Arweave
//pending - file was bundled and posted to Arweave
//confirmed - file is confirmed on Arweave
//rejected - this indicates a technical problem with our bundling service)
"tags": [], //your Arweave tags appended to transaction
"statusUrl": "https://api.akord.com/files/a6f1fbfc-403d-4607-b648-4b949fdd50bd/status", //check file status endpoint, returns simillar JSON schema
"gatewayUrls": [
"https://akrd.net/LAWVdsBRTkUF8ptiEwiU6n4Q-_5ukBJIFmeAllX7Q0E",
//our instance of Arweave gateway - this url will work always, even right after upload since it falls back to cloud storage when file is not yet on Arweave
"https://arweave.net/LAWVdsBRTkUF8ptiEwiU6n4Q-_5ukBJIFmeAllX7Q0E"
// other Arweave gatways
]
"viewblockUrl": "https://viewblock.io/arweave/tx/LAWVdsBRTkUF8ptiEwiU6n4Q-_5ukBJIFmeAllX7Q0E", //see your file on Viewblock - this url will only work when file is in 'committed' status & indexed by Viewblock
"info": "Transaction is visible on the blockchain indexers when in the \"committed\" status.",
"infoUrl": "https://docs.akord.com/api-and-dev-tools/build/akord-api/files"
}
}Example 1.2. Upload with Arweave transaction tags
Example 1.3. Upload with Arweave transaction tags (encoded)
Last updated