---
name: twelve-data-ingestion
description: "How to get Twelve Data data into a pandas DataFrame and Parquet: access, the request, the format, limits, quirks and terms."
---

# Load Twelve Data daily prices into pandas and Parquet for testing

Source entry: https://signal-lab-jet.vercel.app/datasets/twelve-data
Provider: https://twelvedata.com
Checked against the provider's documentation: 2026-10-29

## Access
- A Basic API key is required. Put it in TWELVE_DATA_API_KEY.
- Free data is for internal testing, evaluation or development only.

## Request
```bash
curl 'https://api.twelvedata.com/time_series?symbol=AAPL&interval=1day&outputsize=100&apikey='$TWELVE_DATA_API_KEY
```

## Format
JSON: status and metadata plus values in reverse chronological order. OHLC and volume values are strings.

## Load into pandas and Parquet
Needs Python 3 with requests, pandas and pyarrow.
```python
"""Twelve Data daily AAPL prices -> pandas -> Parquet. Free tier testing only."""
import os
import requests
import pandas as pd

params = {"symbol": "AAPL", "interval": "1day", "outputsize": 100,
          "apikey": os.environ["TWELVE_DATA_API_KEY"]}
r = requests.get("https://api.twelvedata.com/time_series", params=params, timeout=30)
r.raise_for_status()
body = r.json()
if body.get("status") == "error":
    raise RuntimeError(body["message"])
df = pd.DataFrame(body["values"])
df["datetime"] = pd.to_datetime(df["datetime"])
for column in ("open", "high", "low", "close", "volume"):
    df[column] = pd.to_numeric(df[column])
df = df.sort_values("datetime")
df.to_parquet("twelve_data_aapl_daily.parquet", index=False)
print(len(df), "rows", df["datetime"].min().date(), "to", df["datetime"].max().date())
```
Needs a personal API key; not run.

## Limits
- Basic: eight API credits per minute and 800 credits per day.
- Credits are weighted by endpoint and symbol count.

## Quirks
- Sort values by datetime before time-series work.
- An API error is a JSON object with status=error, code and message.
- The free plan is not for display or production.

## Terms and attribution
- Basic data may be used internally only for testing, evaluation or development.
- It may not be displayed, shared externally or used in production.
- Free-tier data may not be used commercially.
- Terms page: https://twelvedata.com/terms

## Sources
- https://twelvedata.com/pricing: "8 (800 a day)"
- https://twelvedata.com/pricing: "Data may be used internally for testing, evaluation, or development purposes only."
- https://twelvedata.com/terms: "Use Free Tier data for commercial purposes"

Information for educational purposes only. Free tiers, limits and licenses belong to the providers and may change; check the provider's own terms before using the data.
