# REST API

## Authenticating requests

Authentication is done by passing an API token in the `Authorization` header of your HTTP request:&#x20;

```markup
Authorization: Bearer <api-token>
```

## API reference

Swagger documentation is published with all available endpoints:

* Marple DB: <https://db.marpledata.com/api/docs>
* Marple Insight: <https://insight.marpledata.com/api/v1/spec/>

<figure><img src="/files/aTyGbSr1ZeFVYzqOlLHB" alt=""><figcaption></figcaption></figure>

## **Formatting request arguments** <a href="#arguments-and-responses" id="arguments-and-responses"></a>

There are two ways to pass arguments to an endpoint:

1. **URL encoding** (Key-Value Pairs) – Used in GET requests.
2. **JSON encoding** (Request Body) – Used in POST requests.

The method depends on the endpoint, but generally:

* GET requests → Use URL encoding.
* POST requests → Use JSON encoding.

```python
import requests

# URL encoding for a GET request
params = {"key1": "value1", "key2": "value2"}
response = requests.get("https://api.example.com/endpoint", params=params)

# JSON encoding for a POST request
data = {"key1": "value1", "key2": "value2"}
response = requests.post("https://api.example.com/endpoint", json=data)
```

This ensures proper data formatting based on the request type.


---

# 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://docs.marpledata.com/docs/sdk/overview/rest-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.
