Python
For production notebooks and agents, prefer the institutional Python SDK (scrolls.data over gRPC). Below is the lightweight HTTP path with httpx or requests.
Load a catalog
import httpx
base = "http://localhost:8000"
catalog = httpx.get(f"{base}/fred/catalog").json()
print(catalog["columns"])
print(catalog["rows"][:3])Load series
import httpx
base = "http://localhost:8000"
payload = httpx.post(
f"{base}/fred/series",
json={
"series_ids": ["GDP", "UNRATE"],
"start_date": "2020-01-01",
"end_date": "",
},
).json()
columns = payload["columns"]
rows = payload["rows"]Into a DataFrame
import pandas as pd
frame = pd.DataFrame(rows, columns=columns)
frame["date"] = pd.to_datetime(frame["date"])
frame = frame.set_index("date")Semantic search (HTTP SSE)
Cross-source search is POST /search with a JSON body (streaming SSE). The site BFF proxies this at /api/data/search. Institutions should use scrolls.data.search instead.
import httpx
base = "http://localhost:8000"
with httpx.stream(
"POST",
f"{base}/search",
json={"q": "policy rate cuts", "sources": ["fred", "edgar_8k"], "limit": 10},
headers={"Accept": "text/event-stream"},
) as response:
for line in response.iter_lines():
if line:
print(line)
