Skip to content
/ verniy Public
forked from rl404/verniy

Unofficial Anilist GraphQL API Library for Go.

License

Notifications You must be signed in to change notification settings

n4kama/verniy

 
 

Repository files navigation

Verniy

Go Report Card License: MIT Go Reference

Verniy is an unofficial Anilist GraphQL API library using Go. Verniy will generate graphql query string according to your request, make request to Anilist, parse reponse body, and convert to a struct.

The goal of this library is to make a flexible and easy to call Anilist API. This library may not cover all available API but you are always welcome to make a pull request.

This library is built using Anilist official docs especially the graphql reference.

Features

  • Get anime data (details, characters, staff, stats)
  • Get manga data (details, characters, staff, stats)
  • Get character data (details, anime roles, manga roles)
  • Get voice actor/mangaka/staff data (details, character roles, anime roles, manga roles)
  • Get studio list and their produced anime
  • Get genre list
  • Get tag list
  • Get user data (details, favorite, anime list, manga list)
  • Get user data with OAuth2 Access Token for private profiles
  • Search anime
  • Search manga
  • Search character
  • Search voice actor/mangaka/staff
  • Built-in request rate limiting

Installation

go get github.com/rl404/verniy

Quick Start

package main

import (
	"github.com/rl404/verniy"
)

func main() {
    v := verniy.New()

    // Get anime One Piece data (with default fields).
    data, err := v.GetAnime(21)

    // Get anime One Piece data (with custom fields).
    data, err := v.GetAnime(21,
        verniy.MediaFieldID,
        verniy.MediaFieldTitle(
            verniy.MediaTitleFieldRomaji,
            verniy.MediaTitleFieldEnglish,
            verniy.MediaTitleFieldNative),
        verniy.MediaFieldType,
        verniy.MediaFieldFormat,
        verniy.MediaFieldStatusV2,
        verniy.MediaFieldDescription,
        verniy.MediaFieldStartDate,
        verniy.MediaFieldEndDate,
        verniy.MediaFieldSeason,
        verniy.MediaFieldSeasonYear)
}

For more usage, please go to the documentation or example folder.

Funct