Skip to content

Anizip Api For Episode Metadata #162

Description

@itsmechinmoy

Describe your suggested feature:

Integrate AniZip API (https://api.ani.zip/) into Animiru to provide enhanced episode metadata similar to how Dantotsu implements it. Currently, Animiru lacks detailed episode information like titles, summaries, thumbnails, air dates, and ratings for individual episodes. This feature would significantly improve the user experience when browsing episodes.

Key functionality:

  • Fetch episode metadata (titles, summaries/overviews, thumbnails, ratings, air dates) from AniZip API
  • Automatically work when a user tracks an anime through AniList or MyAnimeList
  • Support both AniList and MAL ID lookups
  • Display enriched episode information in the episode list/view

Other details:

API Reference:

  • AniZip API endpoint: https://api.ani.zip/v1/episodes?anilist_id={id} or https://api.ani.zip/v1/episodes?mal_id={id}
  • Response format: JSON containing episode data with fields like title, summary, image, rating, airDate, etc.

API Response Examples:

By Anilist ID (https://api.ani.zip/v1/episodes?anilist_id=1):

{
  "titles": {
    "x-jat": "CowBe",
    "en": "Cowboy Bebop",
    "ja": "カウボーイビバップ",
    "zh": "星际牛仔",
    "de": "Cowboy Bebop",
    "es": "Cowboy Bebop",
    "fr": "Cowboy Bebop",
    "it": "Cowboy Bebop",
    "ko": "카우보이 비밥",
    "ru": "Ковбой Бибоп ТВ"
  },
  "episodes": {
    "1": {
      "tvdbShowId": 76885,
      "tvdbId": 219123,
      "seasonNumber": 1,
      "episodeNumber": 14,
      "absoluteEpisodeNumber": 4,
      "title": {
        "ja": "アステロイド・ブルース",
        "en": "Asteroid Blues",
        "de": "Der tödliche Deal",
        "es": "Canción Triste para un Asteroide",
        "pl": "Asteroidalny blues",
        "x-jat": "Asteroid Blues"
      },
      "airDate": "1998-11-13",
      "airDateUtc": "1998-11-13T08:00:00Z",
      "runtime": 25,
      "overview": "Faye teams up with Spike and Jet to track down a gang of space activists that plans on turning the human population into monkeys!",
      "image": "https://artworks.thetvdb.com/banners/episodes/76885/219123.jpg",
      "episode": "1",
      "anidbEid": 881,
      "length": 25,
      "airdate": "1998-10-24",
      "rating": "7.02",
      "summary": "Spike and Jet head to Tijuana to track down an outlaw smuggling a dangerous drug known as blood-eye. Jet wants the bounty, but Spike has eyes for a far prettier prize.\nSource: crunchyroll"
    },
    "2": {
      "tvdbShowId": 76885,
      "tvdbId": 219122,
      "seasonNumber": 1,
      "episodeNumber": 2,
      "absoluteEpisodeNumber": 3,
      "title": {
        "ja": "野良犬のストラット",
        "en": "Stray Dog Strut",
        "de": "Ein tierisches Geschäft",
        "es": "Strut Perro Callejero",
        "x-jat": "Norainu no Strut"
      },
      "airDate": "1998-04-10",
      "airDateUtc": "1998-04-10T08:00:00Z",
      "runtime": 25,
      "overview": "A night at the casino lands Spike and Jet in hot water when they cross paths with Faye Valentine, a stunning con artist wanted by the law – and the bad guys.",
      "image": "https://artworks.thetvdb.com/banners/episodes/76885/219122.jpg",
      "episode": "2",
      "anidbEid": 879,
      "length": 25,
      "airdate": "1998-04-03",
      "rating": "5.68",
      "summary": "Spike and Jet's next case takes them to Mars, where they'll to try apprehend a professional pet thief and a priceless data dog.\nSource: crunchyroll"
    }
  },
  "episodeCount": 26,
  "specialCount": 14,
  "images": [
    {
      "coverType": "Banner",
      "url": "https://artworks.thetvdb.com/banners/graphical/76885-g2.jpg"
    },
    {
      "coverType": "Poster",
      "url": "https://artworks.thetvdb.com/banners/posters/76885-3.jpg"
    },
    {
      "coverType": "Fanart",
      "url": "https://artworks.thetvdb.com/banners/fanart/original/76885-20.jpg"
    },
    {
      "coverType": "Clearlogo",
      "url": "https://artworks.thetvdb.com/banners/v4/series/76885/clearlogo/611b7facc3918.png"
    }
  ],
  "mappings": {
    "animeplanet_id": "cowboy-bebop",
    "kitsu_id": 1,
    "mal_id": 1,
    "type": "TV",
    "anilist_id": 1,
    "anisearch_id": 1572,
    "anidb_id": 23,
    "livechart_id": 3418,
    "thetvdb_id": 76885,
    "imdb_id": "tt0213338",
    "themoviedb_id": "30991"
  }
}

By MAL ID (https://api.ani.zip/v1/episodes?mal_id=1):

{
  "titles": {
    "x-jat": "CowBe",
    "en": "Cowboy Bebop",
    "ja": "カウボーイビバップ",
    "zh": "星际牛仔"
  },
  "episodes": {
    "1": {
      "tvdbShowId": 76885,
      "tvdbId": 219123,
      "seasonNumber": 1,
      "episodeNumber": 14,
      "absoluteEpisodeNumber": 4,
      "title": {
        "ja": "アステロイド・ブルース",
        "en": "Asteroid Blues",
        "x-jat": "Asteroid Blues"
      },
      "airDate": "1998-11-13",
      "airDateUtc": "1998-11-13T08:00:00Z",
      "runtime": 25,
      "overview": "Faye teams up with Spike and Jet to track down a gang of space activists that plans on turning the human population into monkeys!",
      "image": "https://artworks.thetvdb.com/banners/episodes/76885/219123.jpg",
      "episode": "1",
      "anidbEid": 881,
      "length": 25,
      "airdate": "1998-10-24",
      "rating": "7.02",
      "summary": "Spike and Jet head to Tijuana to track down an outlaw smuggling a dangerous drug known as blood-eye. Jet wants the bounty, but Spike has eyes for a far prettier prize.\nSource: crunchyroll"
    }
  },
  "episodeCount": 26,
  "specialCount": 14,
  "images": [
    {
      "coverType": "Clearlogo",
      "url": "https://artworks.thetvdb.com/banners/v4/series/76885/clearlogo/611b7facc3918.png"
    }
  ],
  "mappings": {
    "animeplanet_id": "cowboy-bebop",
    "kitsu_id": 1,
    "mal_id": 1,
    "type": "TV",
    "anilist_id": 1,
    "anisearch_id": 1572,
    "anidb_id": 23,
    "livechart_id": 3418,
    "thetvdb_id": 76885,
    "imdb_id": "tt0213338",
    "themoviedb_id": "30991"
  }
}

Key Fields to Extract:

  • titles - Multiple language titles for the anime
  • episodes.{number} - Episode-specific data:
    • title - Episode title in multiple languages
    • summary / overview - Episode description
    • image - Episode thumbnail
    • rating - Episode rating
    • airDate / airdate - Release date
    • episode - Episode number
  • mappings - Cross-reference IDs (anilist_id, mal_id, thetvdb_id, etc.)
  • images - Series artwork (Poster, Banner, Fanart, Clearlogo)
  • episodeCount / specialCount - Total episode counts

Implementation Reference (from NyanTV/Dantotsu):

// Data class for episode metadata
data class AniZipEpisodeMeta(
    val title: String? = null,
    val summary: String? = null,
    val overview: String? = null,
    val image: String? = null,
    val rating: String? = null,
    val airDate: String? = null,
)

// Service implementation example
object AniZipService {
    private const val EPISODES_URL = "https://api.ani.zip/v1/episodes"
    
    suspend fun getEpisodesByAnilistId(anilistId: String): Map<String, AniZipEpisodeMeta>
    suspend fun getEpisodesByMalId(malId: String): Map<String, AniZipEpisodeMeta>
}

Expected Integration Points:

  1. Add AniZipService to the project (similar to NyanTV implementation)
  2. Modify episode fetching logic to check for AniZip metadata when an anime is tracked
  3. Update episode UI to display enriched metadata (episode titles, thumbnails, summaries, etc.)
  4. Add caching mechanism to reduce API calls
  5. Fallback to existing data if AniZip fails or returns no data

Benefits:

  • Enhanced user experience with rich episode information
  • Better episode discovery and browsing
  • Consistent with other popular anime apps (Dantotsu, NyanTV)
  • Utilizes community-maintained AniZip dataset

Potential Implementation Challenges:

  • Handling rate limiting
  • Ensuring proper error handling when API is unavailable
  • Migrating existing episode data structure
  • Maintaining backward compatibility

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions