First request

Use your API key to discover a fund and its series in the /meta catalog, then read its NAV.

Set your key

Store your API key in FONDOS_API_KEY and send it with each request as Authorization: Bearer. Keep it out of source code, URLs and repositories.

Bash · curl
export FONDOS_API_KEY="YOUR_API_KEY"

Request with curl

GET /meta returns the complete data.catalog, grouped by fund. Read run and the exact serie code from this catalog. Each response includes data and meta: meta.source preserves attribution and meta.publications gives each vehicle publication cutoff. URL-encode SERIE if it contains spaces or symbols.

Bash · curl
BASE="https://ledgifi.com/api/fondos/v1"
AUTH="Authorization: Bearer $FONDOS_API_KEY"

# 1. Read publication coverage, funds, and their series.
curl -sS "$BASE/meta" -H "$AUTH"

# 2. Copy run and a series[].serie from the same data.catalog[] fund.
RUN="REPLACE_RUN"; SERIE="REPLACE_SERIE"
# URL-encode SERIE if it contains spaces or special characters.
curl -sS "$BASE/funds/$RUN/series/$SERIE" -H "$AUTH"

Request with Python

Python
# Python 3.10+, no external packages.
import json
import os
from urllib.parse import quote
from urllib.request import Request, urlopen

BASE = "https://ledgifi.com/api/fondos/v1"

def get(path):
    headers = {"Authorization": "Bearer " + os.environ["FONDOS_API_KEY"]}
    with urlopen(Request(BASE + path, headers=headers), timeout=30) as response:
        return json.load(response)

catalog = get("/meta")["data"]["catalog"]
fund = next(fund for fund in catalog if fund["series"])
serie = fund["series"][0]["serie"]
nav = get(f"/funds/{quote(fund['run'], safe='')}/series/{quote(serie, safe='')}")
history = nav["data"]["history"]
if history["points"] is None:
    raise RuntimeError("History unavailable: " + history["unavailableReason"])
for point in history["points"]:
    print(point["date"], point["nav"], point["currency"])

Catalog and history

GET /meta includes every published fund and its compact series entries in one response. Select a run and serie locally, then call /funds/{run}/series/{serie}.

The series detail includes the complete published native NAV history in history.points, without date filters or pagination. history.from and history.to identify the first and last returned observations; both are null when there are no observations. Use downloads for bulk history or the whole market.

If a request fails

Errors include a stable code in application/problem+json.