lobsterdata
Python client for the LOBSTER financial data API.
LOBSTER provides high-quality, tick-level order book data for NASDAQ-listed stocks, widely used in academic finance research.
Installation
pip install lobsterdata
To use the example CLI scripts (examples/cli.py and examples/bulk_request.py), install the examples optional dependency group, which adds anyio and python-dotenv:
pip install "lobsterdata[examples]"
Quick start
🦞 Pilot phase — The API is currently in pilot and access is by invitation only. If you are an active Lobsterian and would like to join, please send an email to service@lobsterdata.com with your name, institute, and email address. Only active Lobsterians will be granted access.
from lobsterdata import LobsterClient
client = LobsterClient(
api_key="your_api_key",
api_secret="your_api_secret",
is_pilot=True, # True → dev.lobsterdata.com, False → lobsterdata.com
)
1 — Submit a request
result = client.submit_request(
symbol="AAPL",
start_date="2025-02-03",
end_date="2025-02-07",
level=10,
exchange="NASDAQ",
)
request_id = result["data"]["request_id"]
print(f"Request submitted – ID: {request_id}")
Submitting in a loop? Sleep at least 3 seconds between each call on the pilot server to stay well within the rate limit of 20 requests per minute. Exceeding it will block your API key for 10 minutes.
import time for symbol in symbols: client.submit_request(symbol, start_date, end_date) time.sleep(3) # avoid rate-limit block
Construction typically takes a few minutes depending on the date range and symbol.
2 — Check if ready
List your requests and inspect their status and data size:
requests = client.list_requests()
for req in requests:
rid = req.get("request_id") or req.get("id")
status = req.get("status")
size_mb = req.get("request_data_size", 0) / (1024 * 1024)
print(f"ID {rid} | {req.get('symbol')} | status: {status} | size: {size_mb:.2f} MB")
A request is ready to download when status == "finished" and request_data_size > 0.
Construction typically takes a few minutes. Re-run the snippet above until your request meets both conditions.
3 — Download and clean up
filepath = client.download_request(request_id, download_dir="./downloads")
print(f"Saved to: {filepath}")
client.delete_request(request_id)
print("Deleted from server.")
See the
examples/directory for ready-to-run CLI scripts — a great starting point for learning the full API workflow.examples/cli.pycovers interactive single-request submission and download;examples/bulk_request.pyshows an async multi-symbol pipeline.
API limits & constraints
⚠️ Violating any of these constraints will result in a rejected request (
error=1) or a temporary API key block.
Request constraints
| Parameter | Allowed values | Notes |
|---|---|---|
level |
0 or 10 |
Any other value is rejected |
frequency_seconds |
0 or null |
Any other value is rejected |
| Date range | ≤ 31 days | end_date − start_date must not exceed 31 days |
Rate limiting
| Limit | Consequence |
|---|---|
| 20 requests per minute | Exceeding this blocks your API key for 10 minutes |
Storage limit
The pilot server has a storage limit of 200 GB of raw CSV data (not the compressed zip size). If your total stored data on the server exceeds this quota, your API key will be blocked with the reason "Storage breached". The block is lifted automatically once you delete enough files to drop below the limit — use delete_request() or download_and_cleanup() to free up space.
Checking your block state
state = client.get_block_state()
print(state)
# {"blocked": False, "block_reason": None, "unblock_time": None}
If blocked is True, the response will include block_reason and unblock_time.
API reference
| Method | Description |
|---|---|
submit_request(symbol, start_date, end_date, level, exchange) |
Submit a new data construction request |
list_requests() |
List all requests for the authenticated user |
get_request(request_id) |
Look up a single request by ID |
list_alive_requests() |
Requests with status waiting, running, or undeleted finished |
list_downloadable_requests() |
Finished requests with data available for download |
download_request(request_id, download_dir) |
Download a completed request's data file |
delete_request(request_id) |
Delete a request and its file from the server |
download_and_cleanup(download_dir) |
Download all available files then delete them from the server |
get_block_state() |
Check whether your API key is currently blocked and why |
Credentials
Credentials are read from a .env file (recommended) or environment variables.
.env file (recommended)
Copy the provided template and fill in your values:
cp .env.example .env
LOBSTER_API_KEY=your_api_key
LOBSTER_API_SECRET=your_api_secret
LOBSTER_IS_PILOT=true
The CLI scripts load .env automatically via python-dotenv. .env is git-ignored.
Environment variables
export LOBSTER_API_KEY="your_api_key"
export LOBSTER_API_SECRET="your_api_secret"
export LOBSTER_IS_PILOT="false"
License
MIT
Metadata
Release files for lobsterdata 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lobsterdata-0.1.4.tar.gz | 7.0 kB | With provenance | Details for lobsterdata-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lobsterdata-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for lobsterdata-0.1.4-py3-none-any.whl |
Total release size: 14.8 kB
Release files / lobsterdata-0.1.4.tar.gz
| Download URL | lobsterdata-0.1.4.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8466fddb71998cb96d54a20be4966caadb10b8a0ee6e4383d0266586b413522f
|
|
BLAKE2b-256 checksum How to use checksums |
910e54855a236319c1bb9ee5db7726e64832ee0ff91e02e049e2c586b46c1b14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 19, 2026.
Transparency logRelease files / lobsterdata-0.1.4-py3-none-any.whl
| Download URL | lobsterdata-0.1.4-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
69454bcf4572b48b20a7a4ae1661bafb3e2c9d0dc99730a219d355a7e4ad692b
|
|
BLAKE2b-256 checksum How to use checksums |
1b82c7bd3b9b2b3b5421eee3b3cb78487b48873b4daf75472174b23210f6a38b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 19, 2026.
Transparency logSecurity for lobsterdata 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for lobsterdata-0.1.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.