# Lunar API

{% hint style="info" %}
The API is used by your custom scripts to directly send requests to Lunar to buy/sell tokens
{% endhint %}

## 1. Setup

* You can find examples of the code (in python and golang) [here](https://github.com/jerempjerem/lunar-api)
* Use this in your custom scripts

## 2. Task Creation

* You need to create a DeFi Extension [task](/extension/lunar-task-creation.md) and turn it on for Lunar to receive your API requests

{% hint style="info" %}
The API is very basic, if high demand we will release a more advanced version that will support

* Live editing from API
* Task Creation from API
* & more
  {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guide.lunar.trade/other/lunar-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
