Guide

Below you'll find examples using Fetch API but you can use any other http library out there.


Get a random quote

fetch('https://animechan.vercel.app/api/random')
.then(response => response.json())
.then(quote => console.log(quote))

Output

{
anime: '...',
character: '...',
quote: '...'
}

Get 10 random quotes

fetch('https://animechan.vercel.app/api/quotes')
.then(response => response.json())
.then(quotes => console.log(quotes))

Output

[{ anime: "...", character: "...", quote: "..." }, ...]

Get quotes by anime title

fetch('https://animechan.vercel.app/api/quotes/anime?title=naruto')
.then(response => response.json())
.then(quotes => console.log(quotes))

Output

[{ anime: "Naruto", character: "...", quote: "..." }, ...]

[NOTE: Default number of response is currently 10]

Get quotes by character name

fetch('https://animechan.vercel.app/api/quotes/character?name=saitama')
.then(response => response.json())
.then(quotes => console.log(quotes))

Output

[{ anime: "...", character: "Saitama", quote: "..." }, ...]

[NOTE: Default number of response is currently 10]

Get all the available anime

fetch('https://animechan.vercel.app/api/available/anime')
.then(response => response.json())
.then(anime => console.log(anime))

Output

[ "Hyouka", "Youjo Senki", ...]

Pagination

Pagination works only on the query endpoints. Default pagination count is 10 quotes per page.

fetch('https://animechan.vercel.app/api/quotes/anime?title=naruto&page=2')
.then(response => response.json())
.then(quotes => console.log(quotes))
// works on character queries too 👇
// https://animechan.vercel.app/api/quotes/character?name=luffy&page=2

Output

[{ anime: "Naruto", character: "...", quote: "..." }, ...9]

Important Notes

  1. Default rate limit is 100 requests per hour.
  2. Default number of quotes returned from query endpoints is 10.
  3. If you don't find the anime you are looking for then submit a request here.

Created ❤️ by rocktimsaikia © 2021