> For the complete documentation index, see [llms.txt](https://hackerbot-industries.gitbook.io/documentation-hackerbot-industries/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hackerbot-industries.gitbook.io/documentation-hackerbot-industries/software/flask-apis.md).

# Flask APIs

## Introduction

{% hint style="info" %}
The Flask API will occupy the robot and block other processes. Make sure to stop the Flask process if you need to use the robot for other tasks.
{% endhint %}

This is the flask api and backend of the command center, to launch this, navigate to the directory and run the launch script:

```sh
launch-flask-api 
```

If successful, you should see something similiar to this:

```
---------------------------------------------
STARTING HACKERBOT FLASK API
---------------------------------------------

---------------------------------------------
SUCCESS! Hackerbot Web Application is Running!
Flask Backend:  http://localhost:5000
                http://10.1.10.110:5000
Log file: /home/bobby/hackerbot/logs/hackerbot_flask_202503251849.txt
---------------------------------------------
```

To stop the process, run the stop script:

```sh
stop-flask-api 
```

You should see something like this in your console:

```
---------------------------------------------
STOPPING HACKERBOT FLASK API
---------------------------------------------
Stopping Flask backend (PID: 101864)...
Force killing Flask backend...
Flask backend stopped.
---------------------------------------------
CHECKING SERIAL PORT /dev/ttyACM1
---------------------------------------------
Serial port /dev/ttyACM1 is not occupied.
---------------------------------------------
HACKERBOT FLASK API STOPPED
```

***

## API Reference

> This section provides a reference for all RESTful endpoints used to control the Hackerbot platform. These APIs are organized by module: `Core`, `Base`, `Head`, and `Arm`.

### 🧪 Quick Examples

#### Ping the Core

```sh
curl -X POST http://<host>/api/v1/core \
  -H "Content-Type: application/json" \
  -d '{"method": "ping"}'
```

#### Start the Base

```sh
curl -X POST http://<host>/api/v1/base \
  -H "Content-Type: application/json" \
  -d '{"method": "start"}'
```

#### Drive the Robot

```sh
curl -X POST http://<host>/api/v1/base/actions \
  -H "Content-Type: application/json" \
  -d '{"linear_velocity": 0.0, "angle_velocity": 65}'
```

**Navigation**

```sh
curl -X POST http://<host>/api/v1/base/maps \
  -H "Content-Type: application/json" \
  -d '{"method": "goto", "x": 0.0, "y": 0.0, "angle": 0.0, "speed":0.4}'
```

#### Make the Robot Speak

```sh
curl -X POST http://<host>/api/v1/base \
  -H "Content-Type: application/json" \
  -d '{"method": "speak", "model_src": "en_GB-semaine-medium", "text": "Tacos!", "speaker_id": null}'
```

**Move the head**

```sh
curl -X POST http://<host>/api/v1/head \
     -H "Content-Type: application/json" \
     -d '{"method": "look", "yaw":180.0, "pitch":180.0, "speed":90}'
```
