API Endpoints
This page documents all available endpoints in the Mako Code API.
Base URL
The API is served from the FastAPI application with the following configuration:
Documentation is available at http://localhost:8001/api/docs
in development mode as mentioned in the README.
CORS Configuration
The API allows requests from the following origins:
Endpoints
Code Execution
Execute Code
Executes Python code and returns the result.
Request Body:
Response:
If there’s an error:
File Operations
Upload File
Uploads a file (CSV, JSON, Parquet, Arrow) and converts it to Parquet format.
Form Parameters:
file
: The file to uploadnewFileName
: Name for the uploaded file
Response:
Read Parquet
Reads a parquet file and returns its contents.
Query Parameters:
filename
: Name of the parquet file
Response:
List Datasets
Lists all available datasets in local storage.
Response:
Delete Dataset
Deletes a dataset and its context file.
Request Body:
Response:
Dataset Context
Save Dataset Context
Saves context information for a dataset.
Request Body:
Response:
Get Dataset Context
Retrieves context information for a dataset.
Response:
Dataset Operations
Get Dataset Data
Retrieves paginated data from a dataset.
Request Body:
Response:
Get Dataset Schema
Retrieves the schema of a dataset.
Response:
Code Analysis
Lint Code
Analyzes code for errors and style issues.
Request Body:
Response:
User Functions
Save Function
Saves a user-defined function.
Request Body:
Response:
List Functions
Lists all saved user functions.
Response:
Delete Function
Deletes a user-defined function.
Response:
Version Control
Save Version
Saves a version of code with metadata.
Request Body:
Response:
List Versions
Lists all versions for a specific tab.
Response:
Get Version
Retrieves a specific version of code.
Response:
Error Handling
The API uses conventional HTTP response codes to indicate the success or failure of an API request.
Code | Description |
---|---|
200 | OK - The request was successful |
400 | Bad Request - The request was invalid |
404 | Not Found - The requested resource does not exist |
500 | Server Error - Something went wrong on our end |
Most endpoints return a consistent response format with success
and error
fields to indicate the result of the operation.