# Getting Started

The Finalle API offers REST endpoints for querying the latest market events from US stock exchanges and receiving real-time portfolio and industry briefs.

#### API Base URL

The base url for the API is: `https://api.main.finalle.ai`

#### Authentication

To authenticate with the API for both GET and POST requests, include your API key in the `X-API-Key` header as follows (JSON format):

```json
{  
    "X-API-Key": "YOUR_API_KEY"
}
```

#### Response Types

By default, all endpoints return a JSON response.&#x20;

The API response will follow the following structure:

On API success:

```json
{
    "result": "success",
    "data": {
        ...
    },
    "request_id": "YOUR_UNIQUE_REQUEST_ID"
}
```

On API failure:

```json
{
    "result": "fail",
    "error": "Error Message",
    "request_id": "YOUR_UNIQUE_REQUEST_ID"
}
```

#### Error Codes

Our API uses [HTTP response codes](https://www.restapitutorial.com/httpstatuscodes.html) to indicate the success or failure of an API request:

2xx - Success.

4xx - Errors based on information provided in the request:

* Bad request input (400)
* Unauthorized API key (401)

5xx - Internal errors on our servers.

#### Help and Support

In case you are having any issues or needs clarifications, please don't hesitate to reach out to us at:  ***<support@finalle.ai>***


---

# 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://api-docs.finalle.ai/api/getting-started.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.
