# Quickstart

Below are some examples of code that you can use to send data from the project you have created to ANTARES.

{% tabs %}
{% tab title="ESP8266(HTTP)" %}
Below is a video tutorial that you can use to send and get data from ANTARES via ESP8266 (HTTP). Please install [this library](https://github.com/antaresdocumentation/antares-esp8266-http) on Arduino IDE.

{% embed url="<https://youtu.be/Eg06Q1HsWdM>" %}

{% code lineNumbers="true" %}

```arduino
#include <AntaresESP8266HTTP.h>

#define ACCESSKEY "your-access-key"
#define WIFISSID "your-wifi-ssid"
#define PASSWORD "your-wifi-password"

#define applicationName "your-application-name"
#define deviceName "your-device-name"

AntaresESP8266HTTP antares(ACCESSKEY);

void setup() {
  Serial.begin(115200);
  antares.setDebug(true);
  antares.wifiConnection(WIFISSID,PASSWORD);
}

void loop() {
  int temp = random(25,30);
  int hum = random(75,90);

  antares.add("temperature", temp);
  antares.add("humidity", hum);

  antares.send(applicationName, deviceName);
  delay(10000);
}
```

{% endcode %}

<figure><img src="https://content.gitbook.com/content/7cujmJ5QHdJaAjH815aZ/blobs/NElAwqjSpAiwAOdco0PY/BUAT%20GITBOOK.png" alt=""><figcaption></figcaption></figure>

**Congratulations, you have sent your data to ANTARES.**
{% endtab %}

{% tab title="ESP8266(MQTT)" %}
Please install [this library](https://docs.antares.id/en/getting-started/broken-reference) on Arduino IDE.

{% code lineNumbers="true" %}

```arduino
#include <AntaresESP8266MQTT.h>

#define ACCESSKEY "your-access-key"
#define WIFISSID "your-wifi-ssid"
#define PASSWORD "your-wifi-password"

#define applicationName "your-application-name"
#define deviceName "your-device-name"

AntaresESP8266MQTT antares(ACCESSKEY);

void setup() {
  Serial.begin(115200);
  antares.setDebug(true);
  antares.wifiConnection(WIFISSID,PASSWORD);
  antares.setMqttServer();
}

void loop() {
  int temp = random(25,30) ;
  int hum = random(75,90);

  antares.add("temperature", temp);
  antares.add("humidity", hum);

  antares.publish(applicationName, deviceName);
  delay(5000);
}
```

{% endcode %}

<figure><img src="https://content.gitbook.com/content/7cujmJ5QHdJaAjH815aZ/blobs/3FZGvRCugdCCFnlPV1dN/quickstart.png" alt=""><figcaption></figcaption></figure>

**Congratulations, you have sent your data to ANTARES.**
{% endtab %}

{% tab title="NODE JS" %}
Please install antares-http with npm first, make sure npm and NodeJS are installed on CMD (Windows) or Terminal (Linux): More information about Antares for NodeJS can be found at [antares-http npm page](https://docs.antares.id/en/getting-started/broken-reference).

<pre class="language-bash"><code class="lang-bash"><strong>npm init
</strong>npm install antares-http --save
</code></pre>

```javascript
const antares = require('antares-http');

data = {
  temperature: 32,
  humidity: 80,
}
antares.setAccessKey('your-access-key');
antares.send(data, 'your-project-name', 'your-device-name')
.then((response) => {
  console.log(response);
});
```

<figure><img src="https://content.gitbook.com/content/7cujmJ5QHdJaAjH815aZ/blobs/3FZGvRCugdCCFnlPV1dN/quickstart.png" alt=""><figcaption></figcaption></figure>

**Congratulations, you have sent your data to ANTARES.**
{% endtab %}

{% tab title="PYTHON" %}
Please install `antares-http` with pip first, make sure pip and Python are installed on CMD (Windows) or Terminal (Linux):

More information about Antares for Python can be found at [interares-http PyPi page](https://pypi.org/project/antares-http/).

```bash
pip install antares-http
```

```python
from antares_http import antares

data = {
    'temperature' : 32,
    'humidity' : 80
}
antares.setAccessKey('your-access-key')
antares.send(data, 'your-project-name', 'your-device-name')
```

<figure><img src="https://content.gitbook.com/content/7cujmJ5QHdJaAjH815aZ/blobs/3FZGvRCugdCCFnlPV1dN/quickstart.png" alt=""><figcaption></figcaption></figure>

**Congratulations, you have sent your data to ANTARES.**
{% endtab %}
{% endtabs %}
