Docs/ Quickstart

Quickstart

Get a key, make the first call, read the envelope. curl, TypeScript and Python.

1. Get a key

Create a free account (150 credits a month, no card) and create a key in the dashboard. Keys start with ffk_ and are shown once.

2. Make the first call

Put the ISIN in the path. A fund that has never been loaded takes 15–90 seconds the first time (the documents are read live), so set a generous timeout; every later call within 24 hours returns in milliseconds.

curl --max-time 300 https://fundfactsapi.com/api/v1/funds/IE00B4L5Y983 \
-H "Authorization: Bearer ffk_your_api_key"

No key yet? The demo endpoint serves funds that are already loaded, without authentication: curl https://fundfactsapi.com/api/v1/demo/funds/IE00B4L5Y983

TypeScript

ts
const res = await fetch("https://fundfactsapi.com/api/v1/funds/IE00B4L5Y983", {
headers: { Authorization: `Bearer ${process.env.FUNDFACTS_API_KEY}` },
signal: AbortSignal.timeout(300_000),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const { name, data, expiresAt } = await res.json();
console.log(name, data.headlineMetrics.ter, data.riskRating, data.profile.category);

Python

python
import os, requests
r = requests.get(
"https://fundfactsapi.com/api/v1/funds/IE00B4L5Y983",
headers={"Authorization": f"Bearer {os.environ['FUNDFACTS_API_KEY']}"},
timeout=300,
)
r.raise_for_status()
fund = r.json()
print(fund["name"], fund["data"]["headlineMetrics"]["ter"], fund["data"]["profile"]["category"])

3. Several funds at once

Use the batch endpoint instead of a loop: one call, one credit per ISIN answered, and cold ISINs are warmed for you.

curl --max-time 300 -X POST https://fundfactsapi.com/api/v1/funds \
-H "Authorization: Bearer ffk_your_api_key" -H "Content-Type: application/json" \
-d '{"isins": ["IE00B4L5Y983", "IE00B3RBWM25", "LU1681043599"]}'

4. SDKs and React widgets

Official clients wrap every endpoint with typed methods, an in-memory cache until expiresAt and proper error objects; the widgets package renders a response as charts and tiles with no CSS to import.

npm install @fundfactsapi/sdk @fundfactsapi/widgets # JavaScript / TypeScript + React
pip install fundfacts # Python
tsx
import { FundFacts } from "@fundfactsapi/sdk";
import { FundFactsheet } from "@fundfactsapi/widgets";
const fund = await new FundFacts({ apiKey: process.env.FUNDFACTS_API_KEY }).getFund("IE00B4L5Y983");
export default function Page() {
return <FundFactsheet fund={fund} />; // growth chart, key facts, holdings, sectors, countries, risk, returns, metrics
}