Home › Guides › Load SEC earnings data into pandas (Aegwah quickstart)
Load SEC earnings data into pandas (Aegwah quickstart)
Two ways to get Aegwah earnings data into pandas: the REST API for a single ticker, or the bulk ZIP for the full universe.
Option A — REST API into a DataFrame
import requests, pandas as pd
KEY = "your-api-key"
r = requests.get(
"https://api.aegwah.com/v1/actuals/AAPL",
headers={"Authorization": f"Bearer {KEY}"},
timeout=30,
)
r.raise_for_status()
df = pd.DataFrame(r.json())
df["report_date"] = pd.to_datetime(df["report_date"])
print(df[["fiscal_quarter", "eps_diluted_gaap", "report_date"]].head())
Option B — bulk ZIP
import pandas as pd, zipfile, glob, os
# after downloading aegwah-actuals-latest.zip
with zipfile.ZipFile("aegwah-actuals-latest.zip") as z:
z.extractall("aegwah_data")
frames = [pd.read_csv(f) for f in glob.glob("aegwah_data/**/*.csv", recursive=True)]
df = pd.concat(frames, ignore_index=True)
print(df.shape)
Avoiding look-ahead bias
Filter to point-in-time records using the eps_restatement flag and align on report_date (when the market saw the number), not fiscal_period_end.
Get institutional-quality earnings data
502 tickers · 16+ years of GAAP EPS · ZIP + REST API. From $30/month.
View plans →