Skip to content
Anton GoncharovAI systems developer

Hands-On APIs for AI and Data Science

Ryan Day

  • AI and agents
  • Python
  • API

A practical book on building an API for data and connecting AI to it. The running project is a FastAPI service with a database and documentation, then an SDK for it, using the API in analytics and, finally, LangChain agents that call the API themselves.

Key ideas

  1. A good API starts with the user: clear endpoints, OpenAPI documentation and predictable errors.
  2. An SDK takes retries, pagination and response parsing off API consumers.
  3. For an LLM agent an API is a tool: the endpoint description should be as clear to the model as to a human.
  4. Data served through an API is easier to verify and reuse than file exports.

How I apply it

I write APIs in FastAPI with automatic OpenAPI documentation and a typed client for the frontend — that’s how this site’s API is built. The agents in my projects work with the client’s CRM and services through the same kind of described tools.

Where and how I applied it

  • Demo · Next.js website · catalog, map, comparison

    Real estate catalog with smart search

    The “How it works” block shows the search phrase as a function call for a language model: the API is described so that both a person and a model understand it.

  • Demo · Web app · agent diagram

    AI agent builder

    An API call is a separate node on the agent’s diagram: the agent reaches the company’s services through described tools.

  • Demo · Python backend · webhooks → amoCRM and Bitrix24

    Lead integration hub

    Leads from twelve sources arrive through APIs and webhooks and are brought to one format instead of being exported as files.

More on the shelf

  • Reading

    Server Applications in Python, Django, Flask and FastAPI

    R. S. Bukharev

    The path of server-side development in Python, from sockets and protocols to architecture and launch on a server. Django, Flask and FastAPI are covered through real projects: a CRM system, a Telegram bot with server-side logic, a REST API for a mobile app and a WebSocket chat. Separate chapters cover caching and scaling, Docker and Kubernetes, PostgreSQL, MySQL, SQLite and MongoDB, and security: password hashing, JWT and OAuth 2.0, protection against SQL injection, XSS and CSRF, TLS.

    ProgrammingPythonBackendApplied in 1 project
  • Reading

    Prompt Engineering for LLMs

    John Berryman, Albert Ziegler

    The authors are engineers who built GitHub Copilot. The book isn’t about “magic phrases” but about how to build an application around a model: how an LLM sees text, how to assemble context for it from user data, how conversational agents with tools and multi-step workflows work, and how to evaluate answer quality.

    AI and agentsLLMPrompt engineeringApplied in 3 projects