> For the complete documentation index, see [llms.txt](https://oz-docs.finalle.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oz-docs.finalle.ai/api/getting-started.md).

# 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. Additionally, the API allows you to chat and ask questions from our extensive database.

#### Authentication

#### GET Requests

For **GET** requests either pass your API key in the query string like follows:

```http
https://api.finalle.ai/api_endpoint?api_key=YOUR_API_KEY
```

Or alternatively, you can pass your API key in the request body (Content-Type is *application/json*) of the request like follows:

```json
{  
    "api_key": "YOUR_API_KEY"
}
```

#### POST Requests

For **POST** requests pass your API key in the request body (Content-Type is *application/json*) of the request like follows:

```json
{  
    "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>***
