Forked from: https://github.com/dkorunic/gomdb with some updates.
Go to file
Amarpreet Minhas 69487e08a5 Update response struct 2022-09-10 21:26:55 -04:00
.gitignore adding/updating gitignore 2016-06-20 12:21:36 -04:00
.travis.yml adding travis config 2016-06-20 13:59:07 -04:00
LICENSE Fixed: Removed executable permissions from files 2016-06-14 19:55:32 +05:30
README.md Update docs in regards to 4319c85. 2019-03-19 10:52:20 +01:00
go.mod Remove debug 2022-09-10 21:04:35 -04:00
gomdb.go Update response struct 2022-09-10 21:26:55 -04:00
gomdb_test.go Add go mod, rename imdb -> omdb, fix a broken test 2022-09-10 20:22:12 -04:00

README.md

The Golang Omdb API

Build Status GoDoc

Author: Christopher T. Herrera (eefretsoul AT gmail DOT com)

This API uses the omdbapi.com API by Brian Fritz


OMDBAPI.com

This is an excellent open database for movie and film content.

I strongly encourage you to check it out and contribute to keep it growing.

http://www.omdbapi.com


Project Usage

The API usage is very simple.

package main

import (
	"fmt"
	"github.com/eefret/gomdb"
)

func main() {
	api := gomdb.Init(YOUR_API_KEY)
	
	query := &gomdb.QueryData{Title: "Macbeth", SearchType: gomdb.MovieSearch}
	res, err := api.Search(query)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(res.Search)

	query = &gomdb.QueryData{Title: "Macbeth", Year: "2015"}
	res2, err := api.MovieByTitle(query)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(res2)

	query = &gomdb.QueryData{Title: "Rick and Morty", Season: "1", Episode: "8", SearchType: gomdb.EpisodeSearch}
	res3, err := api.MovieByTitle(query)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(res3)
}

	query = &gomdb.QueryData{ImdbId: "tt2884018"}
	res4, err := api.MovieByImdbID(query)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(res4)

	query = &gomdb.QueryData{ImdbId: "tt0944947", Season: "1", Episode: "1", SearchType: gomdb.EpisodeSearch}
	res5, err := api.MovieByImdbID(query)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(res5)

See the project documentation to see the Response Objects and stuff