Algomorph

API Documentation

Welcome to the Algomorph API

The Algomorph API provides developers with access to various data structures and algorithms across multiple programming languages. You can retrieve and execute algorithms, making it a valuable tool for developers and students.

With our API, you can programmatically interact with algorithms, execute them with custom inputs, and integrate them into your own applications. Whether you're looking for a sorting algorithm in Python or graph traversal techniques in Java, this API has you covered.

Key Features

  • Access a Wide Range of Algorithms: Retrieve implementations of sorting, searching, dynamic programming, graph traversal, and more.
  • Multi-Language Support: Available in multiple languages including Python, Java, C++, JavaScript, and more.
  • Run and Test Algorithms: Provide inputs, configure specific options, and see real-time outputs with complexity analysis.
  • Easy Integration: Access the API with simple HTTP requests to fetch algorithm implementations or execute them remotely.

Who is this API for?

Whether you're a developer integrating algorithms into your application or a student learning data structures the Algomorph API is perfect for:

  • Developers: Integrate algorithms into your applications effortlessly.
  • Students & Educators: Access and execute algorithms to understand how they work with real-world inputs.

How It Works

The API is designed to be simple and intuitive. You can perform the following actions:

  • GET Requests: Retrieve algorithms in the language of your choice.
  • POST Requests: Run algorithms with your input and receive real-time results.

Base URL

Base URL: http://localhost:3000/api/algorithms

API Authentication

No Authentication Required

Our Algomorph API is designed to be easily accessible to all users without the need for authentication. This means you can start using the API immediately, without needing API keys, tokens, or authorization headers.

Whether you're a developer testing algorithms or integrating them into your application, you can freely make requests to any of the available API endpoints. We aim to provide a frictionless experience for anyone who wants to interact with our algorithms.

Benefits of No Authentication

  • Instant Access: No need to sign up or request API keys. You can access and test algorithms as soon as you land on the platform.
  • Simplicity: With no need for OAuth tokens or complex authorization mechanisms, the API remains simple to use, especially for educational purposes.
  • Faster Prototyping: Developers can quickly integrate and experiment with algorithms in their applications without any additional setup steps.

Usage Limitations

While the API does not require authentication, it's important to understand that there may be certain rate limits to ensure fair usage for all users.

We strive to make the API available to as many users as possible, without the complexity of user accounts or subscription tiers.

Security Considerations

Although the API does not require authentication, we encourage users to implement security best practices in their applications when using the API. Ensure that you validate user input and sanitize any data returned by the API to protect against potential security threats.

API Endpoints

1. Explore Algorithm Implementations (GET)

Fetch all the available algorithms.

GET /api/algorithms

Fetch details of a specific algorithm.

GET /api/algorithms/{algorithm}

Fetch details of a specific algorithm in a given language.

GET /api/algorithms/{algorithm}/{language}

Request Parameters:

  • algorithm: Name of the algorithm (e.g., quick-sort, merge-sort).
  • language: Programming language for the implementation (e.g., java, python).

Example Request:

GET /api/algorithms/quick-sort/java

Example Response:

{
  "algorithm": "quick-sort",
  "description": "Quick Sort is an efficient, divide-and-conquer algorithm that sorts { /* Description here */ }",
  "language": "java",
  "code": "public class QuickSort { /* QuickSort Java code here */ }"
}

Response Status Codes:

  • 200 OK: Request succeeded.
  • 404 Not Found: Algorithm or language not found.

2. Perform Algorithm Execution (POST) (Coming Soon)

Run the selected algorithm with provided input and get the output.

POST /api/algorithms/{algorithm}/{language}/run

Request Body (JSON):

  • input: The input data for the algorithm (e.g., array to sort).

Example Request:

POST /api/algorithms/quick-sort/java/run

{
  "input": [3, 6, 1, 8]
}

Example Response:

{
  "algorithm": "quick-sort",
  "language": "java",
  "input": [3, 6, 1, 8],
  "output": [1, 3, 6, 8],
  "executionTime": "25ms"
}

Response Status Codes:

  • 200 OK: Execution succeeded.
  • 400 Bad Request: Invalid input or parameters.