Quickstarts

Image request#

NOTE: Don't forget to change "image.jpg" to your image path and "image/jpeg" to the correct content type.

package main
import (
"bytes"
"io/ioutil"
"log"
"net/http"
)
func main() {
image, err := ioutil.ReadFile("image.jpg")
if err != nil {
log.Panic(err)
}
resp, err := http.Post("https://source.animeapis.com/v1beta2/search/image", "image/jpeg", bytes.NewBuffer(image))
if err != nil {
log.Panic(err)
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
log.Panicf("returned status code is %d", resp.StatusCode)
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Panic(err)
}
log.Print(string(body))
}

Video request#

NOTE: don't forget to change "video.webm" to your video path and "video/webm" to the correct content type.

package main
import (
"bytes"
"io/ioutil"
"log"
"net/http"
)
func main() {
video, err := ioutil.ReadFile("video.webm")
if err != nil {
log.Panic(err)
}
resp, err := http.Post("https://source.animeapis.com/v1beta2/search/video", "video/webm", bytes.NewBuffer(video))
if err != nil {
log.Panic(err)
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
log.Panicf("returned status code is %d", resp.StatusCode)
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Panic(err)
}
log.Print(string(body))
}

Signature request#

NOTE: A tutorial about extracting the signature via Ashen DSK is in progress.

package main
import (
"bytes"
"io/ioutil"
"log"
"net/http"
)
func main() {
signature := []byte(`{"signature": "FQYHDg4ODwcQEhAPDg8SEBYPEQ8QEBEgDw8QEBEeEBAODxA="}`)
resp, err := http.Post("https://source.animeapis.com/v1beta2/search/signature", "application/json", bytes.NewBuffer(signature))
if err != nil {
log.Panic(err)
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
log.Panicf("returned status code is %d", resp.StatusCode)
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Panic(err)
}
log.Print(string(body))
}

Example: Index video files#

Work in progress.

Example: Search Engine#

Work in progress.