Skip to main content
GET
/
v1
/
chart
/
history
Python (SDK)
from finance_dev import FinanceDev, models
import os


with FinanceDev(
    security=models.Security(
        client_id=os.getenv("FINANCEDEV_CLIENT_ID", ""),
        client_secret=os.getenv("FINANCEDEV_CLIENT_SECRET", ""),
    ),
) as fd_client:

    res = fd_client.chart.get_chart_history(symbol="AAPL", resolution=models.Resolution.SIXTY, from_=1672531200, to=1675209600, include_extended=False)

    # Handle response
    print(res)
{ "s": "ok", "t": [ 1672531200, 1672534800, 1672538400 ], "c": [ 130.15, 130.89, 131.24 ], "o": [ 129.93, 130.15, 130.89 ], "h": [ 130.28, 131.05, 131.37 ], "l": [ 129.88, 130.09, 130.81 ], "v": [ 1234567, 1345678, 1456789 ], "nextTime": 1672542000 }

Documentation Index

Fetch the complete documentation index at: https://finance.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

symbol
string
required

Stock symbol to fetch historical data for

resolution
enum<string>
required

Bar resolution: '1', '5', '15', '30', '60' (minutes), '240' (4 hours), 'D'/'1D' (daily), 'W'/'1W' (weekly), 'M'/'1M' (monthly)

Available options:
1,
5,
15,
30,
60,
240,
D,
W,
M,
1D,
1W,
1M
from
integer<int64>
required

Start time as Unix timestamp in seconds (or milliseconds, will be auto-converted)

Required range: x >= 1
to
integer<int64>
required

End time as Unix timestamp in seconds (or milliseconds, will be auto-converted). Must be greater than 'from' parameter.

Required range: x >= 1

Response

Historical chart data retrieved successfully

s
enum<string>
required

Status of the response

Available options:
ok,
no_data,
error
errmsg
string

Error message (only present if s='error' or s='no_data')

t
integer<int64>[]

Array of bar timestamps (Unix time in seconds)

c
number[]

Array of close prices

o
number[]

Array of open prices

h
number[]

Array of high prices

l
number[]

Array of low prices

v
integer<int64>[]

Array of volumes

nextTime
integer<int64>

Next expected bar time (optional)