Indrives Upload API Documentation
This API allows you to upload files using a direct URL or device file upload.
API Endpoint
POST https://indrives.in/api.php
Request Parameters
| Parameter |
Required |
Description |
| api |
Yes |
Your API key |
| sourceType |
Yes |
Upload type (direct or deviceUpload) |
| url |
Required for direct |
Remote file URL |
| localFile |
Required for deviceUpload |
File from device |
Upload Using Direct URL
POST Parameters
api=YOUR_API_KEY
sourceType=direct
url=https://example.com/file.mp4
cURL Example
curl -X POST https://indrives.in/api.php \
-d "api=YOUR_API_KEY" \
-d "sourceType=direct" \
-d "url=https://example.com/file.mp4"
PHP Example
<?php
$url = "https://indrives.in/api.php";
$data = [
"api" => "YOUR_API_KEY",
"sourceType" => "direct",
"url" => "https://example.com/file.mp4"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
JavaScript Example
fetch("https://indrives.in/api.php", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: new URLSearchParams({
api: "YOUR_API_KEY",
sourceType: "direct",
url: "https://example.com/file.mp4"
})
})
.then(res => res.json())
.then(data => console.log(data));
Python Example
import requests
url = "https://indrives.in/api.php"
data = {
"api": "YOUR_API_KEY",
"sourceType": "direct",
"url": "https://example.com/file.mp4"
}
response = requests.post(url, data=data)
print(response.json())
Upload From Device
POST Parameters
api=YOUR_API_KEY
sourceType=deviceUpload
localFile=(file)
cURL Example
curl -X POST https://indrives.in/api.php \
-F "api=YOUR_API_KEY" \
-F "sourceType=deviceUpload" \
-F "localFile=@video.mp4"
PHP Example
<?php
$url = "https://indrives.in/api.php";
$data = [
"api" => "YOUR_API_KEY",
"sourceType" => "deviceUpload",
"localFile" => new CURLFile("video.mp4")
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
JavaScript Example
const formData = new FormData();
formData.append("api", "YOUR_API_KEY");
formData.append("sourceType", "deviceUpload");
formData.append("localFile", fileInput.files[0]);
fetch("https://indrives.in/api.php", {
method: "POST",
body: formData
})
.then(res => res.json())
.then(data => console.log(data));
Example Response
{
"status":"finished",
"link_id":"X7Vwyvz1Q8xd2Sa5",
"api":"efe1c78441e5c23a77012bb29dc984bdf7f79594",
"name":"Screenshot_20260309_094639_Free Fire MAX.jpg",
"type":"image/jpeg",
"size":"501.48 KB",
"shared_time":"09-Mar-2026"
}
Response Fields
| Field |
Description |
| status |
Upload status |
| link_id |
Unique file ID |
| api |
API key used |
| name |
Uploaded file name |
| type |
File MIME type |
| size |
File size |
| shared_time |
Date when file was shared |