Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Jikan-go

GoDoc Go Report Card

A Go wrapper for the Jikan v3 API.

Support for Jikan v4 API coming soon.

Documentation can be found at godoc.org

Refer to the official Jikan API documentation for clarification on request parameters.

Installation

To install/update: go get -u github.com/darenliang/jikan-go

To import: import "github.com/darenliang/jikan-go" and use as jikan

Usage

Basic Example
package main

import (
	"fmt"
	"github.com/darenliang/jikan-go"
)

func main() {
	// Get anime
	anime, err := jikan.GetAnime(1)
	if err != nil {
		panic(err)
	}
	fmt.Println(anime.Title)
}
Output:

Cowboy Bebop
Search Query Example

Consult the Jikan search reference for a list of search parameters.

package main

import (
	"fmt"
	"github.com/darenliang/jikan-go"
	"net/url"
)

func main() {
	// Setup query
	query := url.Values{}
	query.Set("q", "Cowboy Bebop")
	query.Set("type", "tv")

	// Search anime
	search, err := jikan.GetSearchAnime(query)
	if err != nil {
		panic(err)
	}
	fmt.Println(search.Results[0].Score)
}
Output:

8.79
Troubleshooting

If it is necessary to modify the http client (eg. modify timeout), you can access the client via jikan.Client.

Example: setting the client timeout from 60 seconds (default) to 10 seconds.

jikan.Client.Timeout = time.Second * 10

About

Go wrapper for the Jikan API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages