Automating My Anime Collection: From Hundreds of Titles to GraphQL

I recently started processing a massive list of anime titles. We went through five distinct batches, covering everything from obscure OVAs like Amon Saga to modern hits like My Hero Academia. It was fascinating to see how the collection spans decades.

Collage of anime characters and posters
The eclectic mix of titles in my anime collection, ranging from classic OVAs to modern blockbusters.

The Aspect Ratio Transition

While going through the list, I stumbled upon a very specific technical curiosity: the transition from 4:3 to 16:9. Series like K-On! and Chobits had versions formatted for both aspect ratios during the early 2000s. This was a transitional period where studios often rendered openings twice—once for square screens, once for widescreen—to accommodate audiences still using CRT televisions.

The Automation Challenge

Faced with hundreds of titles, I realized manual processing wasn’t sustainable. We discussed automating the data gathering using PHP. Initially, we looked at scraping Wikipedia or using the Jikan API to fetch basic metadata like release years and summaries.

CRT vs Flat panel anime display
The visual shift between square and widescreen formats during the early 2000s.

However, after analyzing the requirements for richer data—studios, genres, exact dates—we switched our strategy entirely to AniList’s GraphQL API. It proved much more efficient for handling large-scale requests. We even wrote PHP code snippets to handle rate limiting with `usleep` calls and set up a SQLite caching system so we wouldn’t have to query the API repeatedly.

PHP API workflow diagram
The automated extraction pipeline for my anime collection using PHP and APIs.

While we didn’t build the final application during this session, the process of cleaning filenames, eliminating duplicates, and structuring the database queries was incredibly educational. It turned out that finding correct matches for titles like Berserk (1997) versus Berserk (2016) required a lot more logic than I initially anticipated.