Skip to content

Commit

Permalink
Create api_reference.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Oct 29, 2024
1 parent ed03d22 commit 9ac8227
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions docs/api_reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# API Documentation

## Overview
The GCCS-Core API provides a set of endpoints for accessing climate data and managing geoengineering interventions. The API follows RESTful principles and returns data in JSON format.

## Base URL

[http://localhost:5000/api](http://localhost:5000/api)


## Endpoints

### 1. Get Current Climate Data
- **Endpoint**: `/climate`
- **Method**: `GET`
- **Description**: Retrieves the latest climate data from the system.
- **Response**:
```json
1 {
2 "temperature": 22.5,
3 "humidity": 60,
4 "co2_level": 400
5 }
```

### 2. Submit Geoengineering Intervention
- **Endpoint**: /interventions
- **Method**: POST
- **Description**: Submits a request for a geoengineering intervention.
- **Request Body**:
```json
1 {
2 "type": "carbon_capture",
3 "parameters": {
4 "location": "North America",
5 "duration": "6 months"
6 }
7 }
```

- Response:

```json
1 {
2 "status": "success",
3 "message": "Intervention submitted successfully."
4 }
```

## Error Handling
The API returns standard HTTP status codes to indicate the success or failure of requests. Common error responses include:

- 400 Bad Request: Invalid input data.
- 404 Not Found: Endpoint not found.
- 500 Internal Server Error: An unexpected error occurred.

# Conclusion
This API documentation provides a comprehensive overview of the available endpoints and their usage. For further assistance, please refer to the user guide or contact support.

0 comments on commit 9ac8227

Please sign in to comment.