Server API Tutorial
Learn how to use CatGo's REST API for programmatic access to computation and analysis tools.
Overview
CatGo's Python server exposes a REST API for running calculations, managing workflows, and accessing analysis tools from external scripts and applications.
Step 1: Start the Server
bash
python server/main.pyThe API is available at http://localhost:8000 by default.
Step 2: API Endpoints
Structure Operations
POST /api/structure/parse— Parse a structure filePOST /api/structure/optimize— Run geometry optimizationPOST /api/structure/slab— Generate a slab
Electronic Analysis
POST /api/bands— Compute/retrieve band structurePOST /api/dos— Compute/retrieve density of statesPOST /api/cohp— Compute COHP
MD Analysis
POST /api/md/rdf— Compute radial distribution functionPOST /api/md/rmsd— Compute RMSDPOST /api/md/hbonds— Detect hydrogen bondsPOST /api/md/clustering— Cluster trajectory frames
Workflow
POST /api/workflow/create— Create a new workflowPOST /api/workflow/run— Execute a workflowGET /api/workflow/{id}— Get workflow status
Step 3: Authentication
API authentication details (if applicable) and CORS configuration.
Related
- REST API Module — Full API reference
- MCP Server — MCP protocol integration