/googlecustomsearchapi

Google's custom search REST API client for Go

Primary LanguageGoApache License 2.0Apache-2.0

googlecustomsearchapi

GitHub release (latest by date) GitHub tag (latest by date) Go Report Card

Google's custom search REST API v1 client for Go

Example

func main() {
	httpc := http.DefaultClient

	gs := googlecustomsearchapi.New(httpc, "api-key-here", "engine-id-here")

	custom := map[string]string{
		`siteSearchFilter`: `i`,
		`siteSearch`:       `www.imdb.com`,
	}

	res, err := gs.Search(`the room`, 0, custom)
	if err != nil {
		panic(err)
	}

	for _, r := range res.Items {
		fmt.Printf(`%v %v`+"\n", r.Link, r.Title)
	}

}

References