Base URL
For the public deployment, use:
https://autodockvina.com
AutoDock-Vina PrepServer exposes a staged API for creating docking workspaces, preparing receptor PDBQT files, uploading ligands, building reproducible docking packages, and downloading ready-to-run ZIP archives.
The headless API exposes staged `/api/v1` endpoints for scripted docking package preparation: create a workspace, add receptors, save docking centers, prepare receptor PDBQT files, upload ligands, build a package, list artifacts, and download the generated ZIP.
The API walks through the same staged workflow as the browser interface: create a workspace, add a receptor, save a docking box, prepare receptor PDBQT files, upload ligands, build a package, and download the final ZIP.
It is intentionally not a single black-box endpoint. Each step returns stateful JSON, making failed receptor conversion, missing centers, ligand upload issues, and package-building problems easier to diagnose.
For the public deployment, use:
https://autodockvina.com
For the examples below, you only need a terminal with:
curl
bash
unzip
Versioned endpoints generally return JSON in this form:
{
"ok": true,
"data": {},
"warnings": []
}
Do not upload confidential receptor structures, proprietary ligand libraries, or sensitive project data to a public deployment unless the instance is explicitly configured for that purpose.
A full docking-preparation workflow follows these stages.
Create an isolated server-side workspace for this docking job.
POST /api/v1/workspaces
Fetch a receptor from the PDB or upload your own receptor file.
POST /api/v1/workspaces/<jobname>/receptors/fetch
POST /api/v1/workspaces/<jobname>/receptors/upload
Save an XYZ docking box center and box size for the receptor.
POST /api/v1/workspaces/<jobname>/centers/save
Clean the receptor and convert it to a docking-ready PDBQT file.
POST /api/v1/workspaces/<jobname>/prep/start
GET /api/v1/workspaces/<jobname>/prep/status
Upload an SDF, SMI, SMILES, CSV, ZIP, or folder-style ligand input.
POST /api/v1/workspaces/<jobname>/ligands/upload
GET /api/v1/workspaces/<jobname>/ligands
Build the docking package, list artifacts, and download the final ZIP.
POST /api/v1/workspaces/<jobname>/build
GET /api/v1/workspaces/<jobname>/artifacts
GET /api/v1/workspaces/<jobname>/download
This example downloads the repository ligand file Example/Ligand_SDF/DR7.sdf,
fetches receptor 3EKY chain A, prepares the receptor,
uploads the ligand, builds a portable docking package, and downloads the final ZIP.
The example uses a real ligand file from the repository and a receptor fetched directly from the PDB. The final artifact is a downloadable ZIP containing the prepared receptor, ligand input, centers CSV, runner scripts, and package-specific instructions.
Start in a clean folder so the downloaded ZIP is easy to find.
mkdir -p PrepServer_DR7_API_Demo
cd PrepServer_DR7_API_Demo
Download the example ligand from the repository raw file URL.
curl -L -o DR7.sdf \
https://raw.githubusercontent.com/Joey305/autodock-WEBSERVER/main/Example/Ligand_SDF/DR7.sdf
ls -lh DR7.sdf
Use a timestamped workspace name to avoid collisions.
BASE="https://autodockvina.com"
JOB="dr7-example-$(date +%s)"
LIGAND="DR7.sdf"
echo "Using JOB=$JOB"
echo "Using LIGAND=$LIGAND"
This script performs the complete staged API workflow from ligand download to ZIP download.
cat > run_dr7_prepserver_api_demo.sh <<'EOF'
#!/usr/bin/env bash
set -e
BASE="https://autodockvina.com"
JOB="dr7-example-$(date +%s)"
LIGAND="DR7.sdf"
DR7_URL="https://raw.githubusercontent.com/Joey305/autodock-WEBSERVER/main/Example/Ligand_SDF/DR7.sdf"
echo "=========================================="
echo " AutoDock-Vina PrepServer DR7 API Example"
echo "=========================================="
echo ""
echo "BASE: $BASE"
echo "JOB: $JOB"
echo "LIGAND: $LIGAND"
echo ""
echo "0) Download example ligand"
curl -L -o "$LIGAND" "$DR7_URL"
ls -lh "$LIGAND"
echo ""
echo "1) Health check"
curl -sS "$BASE/api/v1/health"
echo ""
echo ""
echo "2) Create workspace"
curl -sS -X POST "$BASE/api/v1/workspaces" \
-H "Content-Type: application/json" \
-d "{\"workspace_name\":\"$JOB\"}"
echo ""
echo ""
echo "3) Fetch receptor 3EKY chain A"
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/receptors/fetch" \
-H "Content-Type: application/json" \
-d '{"pdb_id":"3EKY","chains":"A"}'
echo ""
echo ""
echo "4) Save example docking center"
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/centers/save" \
-H "Content-Type: application/json" \
-d '{
"method":"xyz",
"receptor":"Receptors/3eky.pdb",
"center":[10.5, 22.1, -3.4],
"size":20
}'
echo ""
echo ""
echo "5) Confirm saved centers"
curl -sS "$BASE/api/v1/workspaces/$JOB/centers"
echo ""
echo ""
echo "6) Prepare receptor"
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/prep/start" \
-H "Content-Type: application/json" \
-d '{
"remove_hets":"all",
"remove_chains":"",
"altloc":"collapse"
}'
echo ""
echo ""
echo "7) Check receptor-preparation status"
curl -sS "$BASE/api/v1/workspaces/$JOB/prep/status"
echo ""
echo ""
echo "8) Check summary before ligand upload"
curl -sS "$BASE/api/v1/workspaces/$JOB/summary"
echo ""
echo ""
echo "9) Upload DR7 ligand"
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/ligands/upload" \
-F "mode=single" \
-F "file=@$LIGAND"
echo ""
echo ""
echo "10) Confirm ligand upload"
curl -sS "$BASE/api/v1/workspaces/$JOB/ligands"
echo ""
echo ""
echo "11) Build portable docking package"
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/build" \
-H "Content-Type: application/json" \
-d '{
"package_mode":"portable",
"vina_poses":20,
"confgen_poses":64
}'
echo ""
echo ""
echo "12) List generated artifacts"
curl -sS "$BASE/api/v1/workspaces/$JOB/artifacts"
echo ""
echo ""
echo "13) Download final ZIP"
curl -L -o "${JOB}_docking_package.zip" \
"$BASE/api/v1/workspaces/$JOB/download"
echo ""
echo ""
echo "14) Confirm local ZIP"
ls -lh "${JOB}_docking_package.zip"
echo ""
echo "Done."
echo "Downloaded package: ${JOB}_docking_package.zip"
EOF
chmod +x run_dr7_prepserver_api_demo.sh
./run_dr7_prepserver_api_demo.sh
Use this section when you want to inspect each API response manually.
BASE="https://autodockvina.com"
curl -sS "$BASE/api/v1/health"
echo ""
JOB="dr7-example-$(date +%s)"
curl -sS -X POST "$BASE/api/v1/workspaces" \
-H "Content-Type: application/json" \
-d "{\"workspace_name\":\"$JOB\"}"
echo ""
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/receptors/fetch" \
-H "Content-Type: application/json" \
-d '{"pdb_id":"3EKY","chains":"A"}'
echo ""
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/centers/save" \
-H "Content-Type: application/json" \
-d '{
"method":"xyz",
"receptor":"Receptors/3eky.pdb",
"center":[10.5, 22.1, -3.4],
"size":20
}'
echo ""
curl -sS "$BASE/api/v1/workspaces/$JOB/centers"
echo ""
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/prep/start" \
-H "Content-Type: application/json" \
-d '{
"remove_hets":"all",
"remove_chains":"",
"altloc":"collapse"
}'
echo ""
curl -sS "$BASE/api/v1/workspaces/$JOB/prep/status"
echo ""
curl -L -o DR7.sdf \
https://raw.githubusercontent.com/Joey305/autodock-WEBSERVER/main/Example/Ligand_SDF/DR7.sdf
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/ligands/upload" \
-F "mode=single" \
-F "file=@DR7.sdf"
echo ""
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/build" \
-H "Content-Type: application/json" \
-d '{
"package_mode":"portable",
"vina_poses":20,
"confgen_poses":64
}'
echo ""
curl -L -o "${JOB}_docking_package.zip" \
"$BASE/api/v1/workspaces/$JOB/download"
ls -lh "${JOB}_docking_package.zip"
After receptor preparation, the summary should include:
{
"converted_count": 1,
"converted_list": ["3eky.pdbqt"],
"prep_done": true,
"receptors_prepped": 1
}
After package build, the artifact list should include job.zip.
If you do not have an SDF file, you can create a simple .smi file locally
and upload it through the same ligand endpoint.
The first column is the SMILES string. The optional second column is a ligand ID. Replace the example SMILES with your molecule of interest.
cat > example_ligand.smi <<'EOF'
CC(=O)Oc1ccccc1C(=O)O aspirin_example
EOF
curl -sS -X POST "$BASE/api/v1/workspaces/$JOB/ligands/upload" \
-F "mode=single" \
-F "file=@example_ligand.smi"
echo ""
curl -sS "$BASE/api/v1/workspaces/$JOB/ligands"
echo ""
job/
├── Receptors/
├── Receptors_PDBQT/
├── Ligands/
├── vina_centers.csv
├── run_confgen_local.sh
├── run_vina_local.sh
├── run_all_local.sh
├── README_RUN_LOCAL.md
└── bundled Python helper scripts
unzip "${JOB}_docking_package.zip" -d "${JOB}_package"
cd "${JOB}_package"
find . -maxdepth 3 -type f | sort | head -80
ls does not show server files
Workspace files are created on the server under a path like
/tmp/autodock_prep/<jobname>. Your local folder only receives files
after you download the generated ZIP artifact.
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/api/v1/health |
Check service health, API version, public mode, and temporary workspace root. |
POST |
/api/v1/workspaces |
Create a new workspace or reuse a named workspace when supported. |
GET |
/api/v1/workspaces/<jobname> |
Read workspace state. |
GET |
/api/v1/workspaces/<jobname>/summary |
Read receptor status, center rows, ligand state, generated artifacts, and package readiness. |
POST |
/api/v1/workspaces/<jobname>/receptors/upload |
Upload receptor files by single file, ZIP, or folder-style form upload. |
POST |
/api/v1/workspaces/<jobname>/receptors/fetch |
Fetch a receptor by PDB ID and optional chain selection. |
GET |
/api/v1/workspaces/<jobname>/receptors |
List registered receptors in a workspace. |
POST |
/api/v1/workspaces/<jobname>/centers/resolve |
Resolve a docking center from JSON payload input without necessarily saving it. |
POST |
/api/v1/workspaces/<jobname>/centers/save |
Save a docking center and box size for a receptor. |
GET |
/api/v1/workspaces/<jobname>/centers |
List saved docking centers. |
POST |
/api/v1/workspaces/<jobname>/prep/start |
Prepare receptors and convert them into PDBQT outputs. |
GET |
/api/v1/workspaces/<jobname>/prep/status |
Read receptor-preparation status and logs. |
POST |
/api/v1/workspaces/<jobname>/ligands/upload |
Upload ligand files, ZIPs, or folder-style ligand inputs. |
GET |
/api/v1/workspaces/<jobname>/ligands |
List uploaded ligand files and ligand metadata. |
POST |
/api/v1/workspaces/<jobname>/build |
Build a portable or LSF-style docking package. |
GET |
/api/v1/workspaces/<jobname>/artifacts |
List generated ZIP artifacts. |
GET |
/api/v1/workspaces/<jobname>/download |
Download the latest or requested ZIP artifact. |
{
"workspace_name": "demo-docking-job",
"reuse": false
}
{
"pdb_id": "3EKY",
"chains": "A"
}
{
"method": "xyz",
"receptor": "Receptors/3eky.pdb",
"center": [10.5, 22.1, -3.4],
"size": 20
}
{
"remove_hets": "all",
"remove_chains": "",
"altloc": "collapse"
}
{
"package_mode": "portable",
"vina_poses": 20,
"confgen_poses": 64
}
{
"package_mode": "lsf",
"workers": 16,
"queue": "general",
"project": "brd",
"mem_per_core": 2000,
"vina_poses": 20,
"confgen_poses": 64
}
.pdb.pdbqt.cif.mmcif.ent.sdf.smi.smiles.csv
Ligand and receptor upload workflows are designed to ignore common macOS metadata files,
including .DS_Store, ._*, and __MACOSX/.
Portable mode is recommended for most users. It builds a ZIP package containing normalized receptor, ligand, center, and helper-script files for downstream local or server-side execution.
{
"package_mode": "portable"
}
LSF mode is intended for lab or HPC environments that use an LSF scheduler. Use it only when your target environment matches the generated scheduler assumptions.
{
"package_mode": "lsf"
}
The requested workspace does not exist. This can happen after a server restart because temporary workspaces may be ephemeral.
{
"ok": false,
"error": "workspace_missing"
}
Fix: create a new workspace and rerun the staged workflow.
The receptor exists, but no docking center was saved for its expected PDBQT filename.
{
"ok": false,
"error": "centers_incomplete"
}
If the receptor is Receptors/3eky.pdb, the saved center should map to
3eky.pdbqt.
Open Babel is not installed or not available on the server path.
{
"ok": false,
"error": "obabel_missing"
}
Server administrators should verify which obabel and obabel -V.
Open Babel is installed but cannot find its plugin directory.
Unable to find OpenBabel plugins.
Try setting the BABEL_LIBDIR environment variable.
On Heroku, set BABEL_LIBDIR to the Open Babel plugin folder, then restart the app.
Receptor preparation ran, but conversion to PDBQT failed.
{
"ok": false,
"error": "receptor_conversion_failed"
}
Check the preparation log through the prep status endpoint.
The package build step was requested before ligand upload.
{
"ok": false,
"error": "ligands_missing"
}
Upload an SDF, SMI, SMILES, CSV, ZIP, or folder input before building.
# Aptfile
openbabel
# Buildpacks
heroku buildpacks:add --index 1 heroku-community/apt --app autodockvina
heroku buildpacks:add --index 2 heroku/python --app autodockvina
# Verify obabel
heroku run --no-tty "which obabel && obabel -V" --app autodockvina
# Find plugins if needed
heroku run --no-tty "find /app/.apt -type f ( -name 'pdbformat.so' -o -name 'pdbqtformat.so' -o -name 'plugindefines.txt' ) -print" --app autodockvina
# Example plugin path
heroku config:set BABEL_LIBDIR=/app/.apt/usr/lib/x86_64-linux-gnu/openbabel/3.1.1 --app autodockvina
heroku restart --app autodockvina
# Confirm PDB and PDBQT formats
heroku run --no-tty 'echo BABEL_LIBDIR=$BABEL_LIBDIR && which obabel && obabel -V && obabel -L formats | grep -E "pdb|pdbqt"' --app autodockvina
Solvent-exposed ligand atom and warhead/linker follow-up.
warheadhunter.comDegrader design continuation and linker-recruiter-warhead assembly.
protacbuilder.comE3 recruiter and ligase-context exploration.
e3ligandalyzer.comViral ligand solvent-exposed moiety and PROTACability-style triage.
vlisemod.comUse the browser interface to create the same type of docking package without writing API calls.
No. The API is intentionally staged so scripts can inspect workspace state, receptor intake, center saving, receptor preparation, ligand upload, package generation, artifacts, and download separately.
Yes. API workflows can save explicit XYZ centers and use supported selector-based center resolution where the uploaded receptor format is supported by the resolver.
Automation should unpack the package, verify generated inputs, provide the correct AutoDock Vina runtime environment, run docking with appropriate parameters, and preserve logs for review.