# 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>***
