# Python and FastAPI

> How larch uses Python and FastAPI: Hiki’s back end, with async MongoDB, aiohttp scrapers and a pipeline that enriches titles from four anime databases.

URL: https://larch.ee/technologies/python-fastapi/

larch builds back ends in Python with FastAPI. Hiki’s whole back end is Python: a FastAPI service with async MongoDB, aiohttp scrapers and the pipeline that enriches every manga title.

- Products built: 1
- Framework: FastAPI
- Database: MongoDB, async
- Scrapers: aiohttp
- Runs on: Cloud Run

## Built with Python and FastAPI

One product, the whole back end. Hiki’s catalog is only as good as its data. The Python back end collects it, cleans it up and serves it.

### [Hiki](https://larch.ee/work/hiki/)

FastAPI with async MongoDB serves the catalog. aiohttp scrapers collect it every day, and an enrichment pipeline resolves each title across four anime databases.

- Year: 2025
- Stack: Next.js, React, TypeScript, Tailwind CSS, Kotlin, Jetpack Compose, FastAPI, Python, MongoDB, Firebase, Google Cloud
- Live product: https://hiki.world

## Related service

### [Web platform development](https://larch.ee/services/web-platform-development/)

Fast, resilient platforms that grow with your business, not against it.

What you get:

- **SaaS platforms, real-time dashboards and multilingual apps**: Hiki’s FastAPI back end serves a catalog that readers browse in several languages.
- **The entire stack, from front end to database**: On Hiki we built both services: the Next.js front end, and the FastAPI back end with async MongoDB.
- **Deployed, monitored and scaled, not just built**: The back end runs on Cloud Run. Cloud Scheduler starts the daily scrapes, and Cloud Build deploys every push to main.

## How we use Python and FastAPI

The data behind the catalog. Bookstore listings are noisy. Hiki’s Python back end turns them into a catalog that readers can filter and search.

### Collecting: aiohttp scrapers

Every day, Google Cloud Scheduler starts Hiki’s scrapers. They are built on aiohttp, with rate limiting and exponential backoff, and they collect product data from several bookstores: names, prices, discounts, stock status and images. Change detection flags new arrivals, price drops and stock changes, so readers never miss an update.

### Enriching: four anime databases

A raw product name from a bookstore is often noisy and inconsistent. Hiki’s enrichment pipeline orchestrates several APIs to find the manga behind it. AniList is the primary source for scores, genres, tags, synopsis and cover art. Shikimori translates titles for product names written in Cyrillic, and Jikan and Kitsu are fallbacks for the edge cases. The pipeline generates title variants, handles both Cyrillic and Latin characters, and resolves even badly mangled names to their canonical manga entries. Bookstores list no genres, so this step is what makes Hiki filterable: the 21 genres and 100+ tags that readers filter by come from AniList.

### Serving: FastAPI and MongoDB

The API is FastAPI with async MongoDB through the Motor driver. MongoDB stores the catalog as flexible documents with compound indexes. The Next.js front end reads from this API and renders the catalog in every supported language.

The back end runs on Google Cloud Run, next to the front end, and Cloud Build deploys it on every push to main. Cloud Armor sits in front of it with geo-restrictions and an allowlist for crawlers.

## Other technologies

Used alongside it. Hiki’s FastAPI back end feeds a Next.js front end written in TypeScript. See what else we built with them.

- [Next.js](https://larch.ee/technologies/nextjs/): Hiki’s multilingual catalog front end and the Scout web app, both on Next.js 15 with the App Router.
- [TypeScript](https://larch.ee/technologies/typescript/): The language under all four products, from the web front ends to the seo-mcp server.
- [All technologies](https://larch.ee/technologies/): Seven technologies, each one running in a product we shipped.

## How to start

Tell us what you want to ship. Bring the idea. We’ll tell you how we’d build it and what it takes.

- Book a 30-minute call: https://calendly.com/nicholas-stackwise/30min
- Email: hello@larch.ee
