Client libraries for the Development Finance Observatory APIs at developmentfinance.org. Ask a question about aid, debt, or development indicators in your own words, check what DFO understood, and get a versioned table back.
pip install "development-finance[pandas]"import dfo
answer = dfo.search("ODA from Germany to Nigeria")
print(answer)
df = answer.fetch().to_pandas()Germany's gross disbursements to Nigeria for official development assistance, 1960 to 2024. Current US dollars · OECD DAC2a.
Fetch: answer.fetch()
The Python package imports as dfo. Its README has a recipe for each common task:
- Ask a question and read the answer
- Choose a reading
- Fetch other years or places
- Keep group and total rows
- Save the data and load it later
- Refresh later and tell if the data changed
- Share an answer
- Look up a place code
- Compute a figure on DFO, such as growth, a ranking, or aid per person
- Publish cards as a share at a public link
npm install @developmentfinance/clientThe client has the search, choose, fetch, ref, lookup, analysis, card, and share calls under TypeScript names, and no CLI or disk cache. It runs in Node, Bun, Deno, Workers, and browsers. The API's CORS admits only the origins it lists, so a page on another origin calls your own server route, or a same-origin proxy of the API with baseUrl: "/api/v1". Its README covers the quickstart and a web-app route.
Both clients follow the client contract kept in spec-kit, which contract/ copies at the commit contract/SOURCE names. A dataset ref and a saved answer written by one client work in the other. The TypeScript client reads the credentials file the Python CLI writes. CONTRIBUTING.md explains how the contract is synced and how releases are cut.