Quickstart

Set up Databento

You need an API key to request data from Databento. Sign up and you will automatically receive an API key. Each API key is a 32-character string starting with db-, that can be found on the API keys page on your portal.

Info

Every new account receives $125 in free data credits. These credits allow you to start receiving actual historical data immediately and verify your integration at no cost.

Choose a service

Databento provides two data services: historical and live. These two services are nearly identical, but we separate them due to licensing fees and the differences between request-response and real-time streaming APIs. You can choose to integrate just one or both services.

Historical
Live
Reference
Coverage
Historical and delayed intraday data within the exchange's live data restrictions.
Intraday data from within the last 24 hours and real-time data.
Historical with intraday updates.
Pricing
Usage-based or flat-rate. No monthly license fees.
Flat-rate. Monthly license fees apply.
Dataset license fees apply.
Access
Client libraries (C++, Python, and Rust) and API (HTTP).
Client libraries (C++, Python, and Rust) and API (Raw).
Client libraries (Python and Rust) and API (HTTP).

Build your first application

Getting historical data

1

Select how you will be integrating Databento below to see installation instructions. By default, Python has been selected for you.

If you don't see an official client library for your preferred language, you can still integrate our historical service through its HTTP API.

2

Install our Python client library with pip. Python 3.10+ is required.

1
$ pip install databento
3

A simple Databento historical application looks like this.

This replays 10 minutes of trades of the entire CME Globex market event-by-event.

Copy this to a file main.py. Then, run the file with python main.py.

1
2
3
4
5
6
7
8
9
10
11
import databento as db

client = db.Historical("$YOUR_API_KEY")
data = client.timeseries.get_range(
    dataset="GLBX.MDP3",
    symbols="ALL_SYMBOLS",
    start="2022-06-02T14:20:00",
    end="2022-06-02T14:30:00",
)

data.replay(print)
4

You can modify this application to specify particular instruments, and schemas.

Let's get ESM2 and NQZ2 data in 1-second OHLCV bars.

1
2
3
4
5
6
7
8
9
10
11
12
import databento as db

client = db.Historical("$YOUR_API_KEY")
data = client.timeseries.get_range(
    dataset="GLBX.MDP3",
    symbols=["ESM2", "NQZ2"],
    schema="ohlcv-1s",
    start="2022-06-06T14:30:00",
    end="2022-06-06T14:40:00",
)

data.replay(print)

You have successfully written your first historical data application with Databento! Here are shortcuts to some of the next steps you can take:

  • To download a large amount of data to disk, see how to do a batch download of data files.
  • To get another dataset, just swap the dataset. You can get a list of datasets and their names from our metadata.
  • You can use our symbology API to find other instrument IDs.
  • You can also find dataset names and instrument IDs interactively from our search.

To learn more, read the full documentation for our historical service under API reference - Historical.

Getting live data

1

Select how you will be integrating Databento below to see installation instructions.

If you don't see an official client library for your preferred language, you can still integrate our service via the Raw API.

2

Install our Python client library with pip. Python 3.10+ is required.

1
$ pip install -U databento
3

A simple Databento live application looks like this.

This prints 10 seconds of trades for all ES futures contracts event-by-event.

Copy this to a file main.py. Then, run the file with python main.py.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import databento as db

client = db.Live(key="$YOUR_API_KEY")

client.subscribe(
    dataset="GLBX.MDP3",
    schema="trades",
    stype_in="parent",
    symbols="ES.FUT",
)

client.add_callback(print)

client.start()

client.block_for_close(timeout=10)
4

You can modify this application to specify particular instruments, and schemas.

Let's get ES.FUT and NQ.FUT data in 1-second OHLCV bars.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import databento as db

client = db.Live(key="$YOUR_API_KEY")

client.subscribe(
    dataset="GLBX.MDP3",
    schema="ohlcv-1s",
    stype_in="parent",
    symbols=["ES.FUT", "NQ.FUT"],
)

client.add_callback(print)

client.start()

client.block_for_close(timeout=10)

You have successfully written your first live data application with Databento! To learn more, read the full documentation for our live service under API reference - Live.

Getting reference data

1

Select how you will be integrating Databento below to see installation instructions. By default, Python has been selected for you.

If you don't see an official client library for your preferred language, you can still integrate our reference service through its HTTP API.

2

Install our Python client library with pip. Python 3.8+ is required.

1
$ pip install databento
3

A simple Databento reference application looks like this.

This request fetches all dividend event records for Microsoft from January 2019 until June 2024. You can modify this request to specify particular symbols, and events.

Copy this to a file main.py. Then, run the file with python main.py.

1
2
3
4
5
6
7
8
9
10
11
12
import databento as db

client = db.Reference("$YOUR_API_KEY")
df = client.corporate_actions.get_range(
    start="2019",
    end="2024-07",
    symbols=["MSFT"],
    events=["DIV"],
    countries=["US"],
)

print(df)

You have successfully written your first reference data application with Databento! Here are shortcuts to some of the next steps you can take:

To learn more, read the full documentation for our reference service under Reference API.