Skip to content

Google's custom search REST API client for Go

License

Notifications You must be signed in to change notification settings

raspi/googlecustomsearchapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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