This project provides a FastAPI-based API for generating mind maps based on course details. The API is hosted on Render and can be easily integrated into various applications.
- Hosted URL: https://simlified-api-mind-map.onrender.com
- Endpoint:
/generate-mindmap/
(POST request)
The API accepts a JSON payload with the following parameters:
course_title
(string): The title of the course.granularity_level
(string): The desired level of detail (e.g., "Overview", "Detailed Overview", "Comprehensive Breakdown", "In-Depth Analysis", "Exhaustive Detail").
Here's an example of how to use the API using Python's requests
library:
import requests
url = "https://mind-map-api-yn7x.onrender.com/generate-mindmap/"
payload = {
"course_title": "Introduction to Python Programming",
"granularity_level": "Detailed Overview"
}
response = requests.post(url, json=payload)
if response.status_code == 200:
mind_map = response.json()['markdown']
print(mind_map)
else:
print(f"Error: {response.status_code}")
print(response.text)
This repository includes an HTML file (demo.html
) that demonstrates how to use the API with JavaScript. To use the demo:
- Clone this repository.
- Open
demo.html
in a web browser. - Click the "Generate Mind Map" button to send a request to the API with hardcoded data.
- The generated mind map will be displayed on the page in Markdown format.
The API returns a JSON object with a single key markdown
, containing the generated mind map in Markdown format.
If an error occurs, the API will return an appropriate HTTP status code along with an error message in the response body.
Happy mind mapping!