gocensys is a simple Go package for accessing the Censys API.
Successful API queries return native Go structs that can be used immediately, with no need for type assertions.
gocensys implements endpoints defined in the documentation: https://www.censys.io/api. More detailed information about the behavior of each particular endpoint can be found at the official documentation.
$ go get -u github.com/abadojack/gocensys
import "github.com/abadojack/gocensys"
HTTP basic auth is required using the API ID and secret that are shown under My Account.
api := gocensys.NewCensysAPI("your-uid", "your-secret", nil)
Executing queries on an authenticated CensysAPI struct is simple.
queryJob, err := api.StartQueryJob("select p110.pop3.ssl_2.certificate.parsed.issuer.province from ipv4.20160708 limit 1000;")
if err != nil {
log.Fatal(err)
}
fmt.Println(queryJob.JobID)
gocensys is free software licenced under the GNU LGPL licence. Details are provided in the LICENCE file.