Documentation ¶
Overview ¶
Package imdb implements IMDb web API.
All operations require an http client such as:
client := http.DefaultClient
To search a title:
results, err := imdb.SearchTitle(client, "matrix") ...
results is a slice of imdb.Title results with basic information (Name, URL, Year).
To get detailed information on a title:
title, err := imdb.NewTitle(client, "tt0133093") ...
Actors, Rating, Description and other fields are available.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidID = errors.New("imdb: invalid ID")
)
Generic errors.
Functions ¶
This section is empty.
Types ¶
type ErrParse ¶
type ErrParse struct {
// contains filtered or unexported fields
}
An ErrParse represents a parsing error. It implements error interface.
func NewErrParse ¶
NewErrParse creates a parsing error with details.
type Media ¶
type Media struct { ID string `json:",omitempty"` TitleID string `json:",omitempty"` URL string `json:",omitempty"` ContentURL string `json:",omitempty"` }
A Media represents an IMDb media (poster, photos, etc.). It references to a Title by its ID.
type Name ¶
type Name struct { ID string `json:",omitempty"` URL string `json:",omitempty"` FullName string `json:",omitempty"` }
A Name represents an IMDb name (actor, director, writer, etc.).
type Title ¶
type Title struct { ID string `json:",omitempty"` URL string `json:",omitempty"` Name string `json:",omitempty"` Type string `json:",omitempty"` Year int `json:",omitempty"` Rating string `json:",omitempty"` RatingCount int `json:",omitempty"` Duration string `json:",omitempty"` Directors []Name `json:",omitempty"` Writers []Name `json:",omitempty"` Actors []Name `json:",omitempty"` Genres []string `json:",omitempty"` Languages []string `json:",omitempty"` Nationalities []string `json:",omitempty"` Description string `json:",omitempty"` Poster Media `json:",omitempty"` AKA []AKA `json:",omitempty"` }
A Title represents an IMDb title (movie, series, etc.).
func SearchTitle ¶
SearchTitle searches for titles matching name and returns partial Titles. A partial Title has only ID, URL, Name and Year set. A full Title can be obtained with NewTitle, at the cost of extra requests.